Example program with HTTPServer and sensor data streaming over TCPSockets, using Donatien Garnier's Net APIs and services code on top of LWIP. Files StreamServer.h and .cpp encapsulate streaming over TCPSockets. Broadcast is done by sendToAll(), and all incoming data is echoed back to the client. Echo code can be replaced with some remote control of the streaming interface. See main() that shows how to periodically send some data to all subscribed clients. To subscribe, a client should open a socket at <mbed_ip> port 123. I used few lines in TCL code to set up a quick sink for the data. HTTP files are served on port 80 concurrently to the streaming.

Dependencies:   mbed

Committer:
iva2k
Date:
Mon Jun 14 03:24:33 2010 +0000
Revision:
1:3ee499525aa5
Parent:
0:e614f7875b60

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
iva2k 0:e614f7875b60 1 /*
iva2k 0:e614f7875b60 2 * Author: Adam Dunkels <adam@sics.se>
iva2k 0:e614f7875b60 3 *
iva2k 0:e614f7875b60 4 */
iva2k 0:e614f7875b60 5 #ifndef __LWIP_ARCH_PERF_H__
iva2k 0:e614f7875b60 6 #define __LWIP_ARCH_PERF_H__
iva2k 0:e614f7875b60 7
iva2k 0:e614f7875b60 8 #define PERF_START
iva2k 0:e614f7875b60 9 #define PERF_STOP(x)
iva2k 0:e614f7875b60 10
iva2k 0:e614f7875b60 11 #define perf_init(fname)
iva2k 0:e614f7875b60 12
iva2k 0:e614f7875b60 13 #if 0
iva2k 0:e614f7875b60 14 #ifdef __cplusplus
iva2k 0:e614f7875b60 15 inline
iva2k 0:e614f7875b60 16 #endif
iva2k 0:e614f7875b60 17 void perf_init(char *fname) {
iva2k 0:e614f7875b60 18 return;
iva2k 0:e614f7875b60 19 }
iva2k 0:e614f7875b60 20 #endif
iva2k 0:e614f7875b60 21
iva2k 0:e614f7875b60 22
iva2k 0:e614f7875b60 23 #endif /* __LWIP_ARCH_PERF_H__ */