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 #ifndef NET_CFG_H
iva2k 0:e614f7875b60 2 #define NET_CFG_H 1
iva2k 0:e614f7875b60 3
iva2k 0:e614f7875b60 4 //#define __LWIP_DEBUG
iva2k 1:3ee499525aa5 5 #define __DEBUG
iva2k 0:e614f7875b60 6
iva2k 0:e614f7875b60 7 //Configure build params for TCP/IP Stack
iva2k 0:e614f7875b60 8
iva2k 0:e614f7875b60 9 //Build GPRS Module (eg Telit Module) If
iva2k 0:e614f7875b60 10 #define NET_GPRS 0
iva2k 0:e614f7875b60 11
iva2k 0:e614f7875b60 12 #define NET_TELIT 0
iva2k 0:e614f7875b60 13 #define NET_TELIT_STACK 0
iva2k 0:e614f7875b60 14
iva2k 0:e614f7875b60 15 //Build PPP If
iva2k 0:e614f7875b60 16 #define NET_PPP 0
iva2k 0:e614f7875b60 17 #define NET_ZG2100 0
iva2k 0:e614f7875b60 18
iva2k 0:e614f7875b60 19 //Build Usb Host Stack
iva2k 0:e614f7875b60 20 #define NET_USB 0
iva2k 0:e614f7875b60 21
iva2k 0:e614f7875b60 22 //Build Usb Virtual Serial Port
iva2k 0:e614f7875b60 23 #define NET_USB_SERIAL 0
iva2k 0:e614f7875b60 24
iva2k 0:e614f7875b60 25 //Build Ethernet If
iva2k 0:e614f7875b60 26 //iva2k ?#define NET_ETH 0
iva2k 0:e614f7875b60 27 #define NET_ETH 1
iva2k 0:e614f7875b60 28
iva2k 0:e614f7875b60 29 //Build LWIP Stack
iva2k 0:e614f7875b60 30 //iva2k ?#define NET_LWIP_STACK 0
iva2k 0:e614f7875b60 31 #define NET_LWIP_STACK 1
iva2k 0:e614f7875b60 32
iva2k 0:e614f7875b60 33 #endif