nRF5 IoT SDK  v0.9.0
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
lwIP Stack based UDP Examples

In order to demonstrate the use of UDP as transport on lwIP, a server that responds to a client message is defined. The data formats and message exchange is described in Figure 1 below.

msc_lwip_tcp_client_n_server
Figure 1: UDP data exchange.

As UDP is used as transport and has no tight coupling with BLE, the server and clients could be PC-based applications talking to the kits running a complementary role. The only prerequisite for this is that the UDP client knows the server's IPv6 address. This concept of communication between PC application to nRF5x example on the kit, or nRF5x to nRF5x, is emphasized in Figure 2 below.


lwIP_UDP_Overall.svg
Figure 2: Setup of lwIP based IPv6 UDP examples.


Note
The client does not wait for the response before sending the next request. Requests are sent periodically every 200 ms. The data send is initiated 2 s after the network interface is up for the stack. The server itself never initiates a request to the client.

Client

Server