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

Embed: (wiki syntax)

« Back to documentation index

api_msg_msg Struct Reference

api_msg_msg Struct Reference

This struct includes everything that is necessary to execute a function for a netconn in another thread context (mainly used to process netconns in the tcpip_thread context to be thread safe). More...

#include <api_msg.h>

Data Fields

struct netconnconn
 The netconn which to process - always needed: it includes the semaphore which is used to block the application thread until the function finished.
err_t err
 The return value of the function executed in tcpip_thread.
struct netbuf * b
 used for do_send

Detailed Description

This struct includes everything that is necessary to execute a function for a netconn in another thread context (mainly used to process netconns in the tcpip_thread context to be thread safe).

Definition at line 57 of file api_msg.h.


Field Documentation

struct netbuf* b

used for do_send

Definition at line 66 of file api_msg.h.

struct netconn* conn

The netconn which to process - always needed: it includes the semaphore which is used to block the application thread until the function finished.

Definition at line 60 of file api_msg.h.

err_t err

The return value of the function executed in tcpip_thread.

Definition at line 62 of file api_msg.h.