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

Revision:
0:e614f7875b60
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lwip/arch/sys_arch.h	Sat Jun 12 06:01:50 2010 +0000
@@ -0,0 +1,27 @@
+/*
+ * Author: Adam Dunkels <adam@sics.se>
+ *
+ */
+#ifndef __LWIP_SYS_ARCH_H__
+#define __LWIP_SYS_ARCH_H__
+
+typedef unsigned int u32_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//DG 2010
+void sys_init(void); /* To be called first */
+u32_t sys_jiffies(void); /* since power up. */
+
+/** Returns the current time in milliseconds,
+ * may be the same as sys_jiffies or at least based on it. */
+u32_t sys_now(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* __LWIP_ARCH_CC_H__ */