Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of webserverBlinky by
Diff: main.cpp
- Revision:
- 129:b8a0b0e8cff1
- Parent:
- 128:e5958d143e9d
- Child:
- 130:45ee0d648a72
--- a/main.cpp Sun Aug 13 02:18:18 2017 +0000 +++ b/main.cpp Sun Aug 13 11:27:25 2017 +0000 @@ -46,6 +46,7 @@ // here we define the OPTIONAL, second debug serial port for the various target boards // insert your target board's port here if it's not in yet - if it works, please send it to me - thanks!!! +// note - if you enable this, some packets may initially be missed which will cause some retransmits #ifdef SERIAL_PORT_MONITOR_YES #if defined(TARGET_LPC1768) Serial xx(p9, p10); // Second serial port on LPC1768 - not required to run, if you get compile error here, change #define SERIAL_PORT_MONITOR_YES to #define SERIAL_PORT_MONITOR_NO @@ -665,10 +666,10 @@ // we end up here if we enter the following javascript in a web browser console: x = new WebSocket("ws://172.10.10.2"); int webSocketHandler(char * dataStart) { - if (v0) putsWhileCheckingInput("WebSocket Request\n"); int n=0; // byte counter char * key = strstr(dataStart, "Sec-WebSocket-Key: "); // search for the key in the payload if (key != NULL) { + if (v0) putsWhileCheckingInput("WebSocket Request\n"); char challenge [70]; strncpy(challenge,key+19,70); // a local buffer *strchr(challenge,'\r')=0; // insert null so we can use sprintf @@ -744,7 +745,7 @@ n=n+sprintf(n+dataStart, "<script>setTimeout(function(){location.reload();},10);</script><body>%d</body>",ppp.httpPageCount); #else // /x is a very short page, in fact, it is only a decimal number showing the http Page count - n=n+sprintf(n+dataStart,"%d",ppp.httpPageCount); // not really valid html but fast - most browsers and curl are ok with it + n=n+sprintf(n+dataStart,"%d ",ppp.httpPageCount); // not really valid html but fast - most browsers and curl are ok with it #endif #endif } else {