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.
Data Structures
api_msg | This struct contains a function to execute in another thread context and a struct api_msg_msg that serves as an argument for this function |
api_msg_msg | 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) |
dhcp_msg | Minimum set of fields of any DHCP message |
dns_api_msg | 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) |
eth_hdr | Ethernet header |
eth_vlan_hdr | VLAN header inserted between ethernet header and payload if 'type' in ethernet header is ETHTYPE_VLAN |
etharp_hdr | ARP message, see RFC 826 ("Packet format") |
etharp_q_entry | Struct for queueing outgoing packets for unknown address defined here to be accessed by memp.h |
icmp_echo_hdr | This is the standard ICMP header only that the u32_t data is splitted to two u16_t like ICMP echo needs it |
igmp_group | Igmp group structure - there is a list of groups for each interface these should really be linked from the interface, but if we keep them separate we will not affect the lwip original code too much |
in_addr | For compatibility with BSD code |
memp_malloc_helper | This structure is used to save the pool one element came from |
mib_array_node | Derived node, points to a fixed size const array of sub-identifiers plus a 'child' pointer |
mib_external_node | Derived node, has access functions for mib object in external memory or device using 'tree_level' and 'idx', with a range 0 |
mib_list_rootnode | Derived node, points to a doubly linked list of sub-identifiers plus a 'child' pointer |
mib_node | Node "base class" layout, the mandatory fields for a node |
mib_ram_array_node | Derived node, points to a fixed size mem_malloced array of sub-identifiers plus a 'child' pointer |
netconn | A netconn descriptor |
netif | Generic data structure used for all lwIP network interfaces |
obj_def | Object definition returned by (get_object_def)() |
sha1_context | SHA-1 context structure |
snmp_obj_id | Internal object identifier representation |
snmp_resp_header_lengths | Output response message header length fields |
snmp_trap_header_lengths | Output response message header length fields |
Generated on Tue Jul 12 2022 21:10:27 by 1.7.2