1.8.1 Application Example

The G3 Coordinator UDP Cycles/Responder application implements a G3-Hybrid Coordinator, capable of creating a G3 network. Once the devices are joined to the network, after 2 minutes since the last join, the Coordinator starts cycling the joined devices with UDP requests. This application also replies to UDP and ICMPv6 requests.

This application can be used to pass the G3 Conformance certification tests. By default the application is not configured for G3 Conformance tests. In order to configure it, the function APP_G3_MANAGEMENT_SetConformanceConfig() must be called. In the provided example this is done at initialization if macro APP_G3_MANAGEMENT_CONFORMANCE_TEST is defined, but the user could implement another method to configure it dynamically. When the application is configured for G3 Conformance tests, the UDP cycling in disabled.

The G3 Coordinator UDP Cycles/Responder application shows debug information and information about the cycles through a serial port, whose settings are:
In order to separate functionalities, there are five application files, each one with its own state machine:
  • G3 management (app_g3_management.c): It manages the G3 stack, including:
    • Network creation.
    • Configuration of G3 stack (ADP and MAC) parameters, including specific configuration for G3 Conformance tests.
  • TCP/IP management (app_tcpip_management.c): It configures the TCP/IP stack, including:
    • Set IPv6 addresses.
    • Specific configuration for the G3 stack.
  • UDP responder (app_udp_responder.c): It opens an UDP server socket and handles the messages defined in G3 Conformance tests.
  • Extensible Authentication Protocol (EAP) server (app_eap_server.c): It manages the LBP Coordinator module, accepting the join requests by devices and maintaining the list of joined devices.
  • Cycles (app_cycles.c): It manages the cycles of the joined devices. Once the devices are joined to the network, after 2 minutes since the last join, it starts cycling the joined devices with UDP requests (using an UDP client socket). The results are displayed through a serial port.
  • Storage: It contains the Extended Address (EUI64) generation and non-volatile data storage.
    • For PIC32CXMT (app_storate_pic32cxmt.c) it is implemented using UniqueID, User Signature, GPBR and SUPC power-down detection.
    • For WBZ45 (app_storate_wbz451.c) it is implemented using True Random Number Generator (TRNG) and Persistent Data Server (PDS).

In the following subsections each application file is described in more detail.