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

netCfg.h

Committer:
iva2k
Date:
2010-06-14
Revision:
1:3ee499525aa5
Parent:
0:e614f7875b60

File content as of revision 1:3ee499525aa5:

#ifndef NET_CFG_H
#define NET_CFG_H 1

//#define __LWIP_DEBUG
#define __DEBUG

//Configure build params for TCP/IP Stack

//Build GPRS Module (eg Telit Module) If
#define NET_GPRS 0

#define NET_TELIT 0
#define NET_TELIT_STACK 0

//Build PPP If
#define NET_PPP 0
#define NET_ZG2100 0

//Build Usb Host Stack
#define NET_USB 0

//Build Usb Virtual Serial Port
#define NET_USB_SERIAL 0

//Build Ethernet If
//iva2k ?#define NET_ETH 0
#define NET_ETH 1

//Build LWIP Stack
//iva2k ?#define NET_LWIP_STACK 0
#define NET_LWIP_STACK 1

#endif