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

dns_api_msg Struct Reference

dns_api_msg Struct Reference

As do_gethostbyname requires more arguments but doesn't require a netconn, it has its own struct (to avoid struct api_msg getting bigger than necessary). More...

#include <api_msg.h>

Data Fields

const char * name
 Hostname to query or dotted IP address string.
ip_addr_t * addr
 Rhe resolved address is stored here.
sys_sem_t * sem
 This semaphore is posted when the name is resolved, the application thread should wait on it.
err_t * err
 Errors are given back here.

Detailed Description

As do_gethostbyname requires more arguments but doesn't require a netconn, it has its own struct (to avoid struct api_msg getting bigger than necessary).

do_gethostbyname must be called using tcpip_callback instead of tcpip_apimsg (see netconn_gethostbyname).

Definition at line 123 of file api_msg.h.


Field Documentation

ip_addr_t* addr

Rhe resolved address is stored here.

Definition at line 127 of file api_msg.h.

err_t* err

Errors are given back here.

Definition at line 132 of file api_msg.h.

const char* name

Hostname to query or dotted IP address string.

Definition at line 125 of file api_msg.h.

sys_sem_t* sem

This semaphore is posted when the name is resolved, the application thread should wait on it.

Definition at line 130 of file api_msg.h.