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_SYS_ARCH_H__
iva2k 0:e614f7875b60 6 #define __LWIP_SYS_ARCH_H__
iva2k 0:e614f7875b60 7
iva2k 0:e614f7875b60 8 typedef unsigned int u32_t;
iva2k 0:e614f7875b60 9
iva2k 0:e614f7875b60 10 #ifdef __cplusplus
iva2k 0:e614f7875b60 11 extern "C" {
iva2k 0:e614f7875b60 12 #endif
iva2k 0:e614f7875b60 13
iva2k 0:e614f7875b60 14 //DG 2010
iva2k 0:e614f7875b60 15 void sys_init(void); /* To be called first */
iva2k 0:e614f7875b60 16 u32_t sys_jiffies(void); /* since power up. */
iva2k 0:e614f7875b60 17
iva2k 0:e614f7875b60 18 /** Returns the current time in milliseconds,
iva2k 0:e614f7875b60 19 * may be the same as sys_jiffies or at least based on it. */
iva2k 0:e614f7875b60 20 u32_t sys_now(void);
iva2k 0:e614f7875b60 21
iva2k 0:e614f7875b60 22 #ifdef __cplusplus
iva2k 0:e614f7875b60 23 }
iva2k 0:e614f7875b60 24 #endif
iva2k 0:e614f7875b60 25
iva2k 0:e614f7875b60 26
iva2k 0:e614f7875b60 27 #endif /* __LWIP_ARCH_CC_H__ */