Typical controller demo program based on Seeed Arch Max. Features: - Multi-thread architecture - Inter-thread message communication - Independent command shell using thread - HTTPD with CGI, WS, RPC - Key & value pair configuration load/save
Dependencies: CMDB EthernetInterface HTTPD dconfig mbed-rpc mbed-rtos mbed storage_on_flash
Diff: httpd_service.cpp
- Revision:
- 2:d7ffadba49b9
- Parent:
- 0:2ffd10976643
diff -r a20044f85ee6 -r d7ffadba49b9 httpd_service.cpp --- a/httpd_service.cpp Fri Apr 10 11:54:18 2015 +0000 +++ b/httpd_service.cpp Wed Jun 17 01:55:19 2015 +0000 @@ -42,11 +42,12 @@ int i; char buf[256]; - i = httpd->receive(id, buf, sizeof(buf)); + i = httpd->receive(id, buf, sizeof(buf)-1); if (i < 0) return; buf[i] = 0; - printf("WS %d %s\r\n", id, buf); + //printf("WS %d %s\r\n", id, buf); + printf("WS%d %d\r\n", id, i); httpd->sendWebsocket(id, buf, i); } @@ -80,3 +81,4 @@ printf("httpd ready\r\n"); } +