1.7.1.2 TCP/IP Management

The TCP/IP management application file (app_tcpip_management.c) configures the TCP/IP stack.

The state machine is implemented in the APP_TCPIP_MANAGEMENT_Tasks() function. The different states are:
  • APP_TCPIP_MANAGEMENT_STATE_WAIT_TCPIP_READY: TCP/IP stack status is checked and when it is ready, the net handle is get (G3ADPMAC) and IPv6 addresses are configured.
    • The _APP_TCPIP_MANAGEMENT_SetIPv6Addresses() function configures the TCP/IP stack:
      • Set link-local address (LLA) defined by G3 specification, based on PAN ID and Short Address, using TCPIP_IPV6_UnicastAddressAdd() function.
      • Set unique local link address (ULA), based on PAN ID and Extended Address, using TCPIP_IPV6_UnicastAddressAdd() function.
      • Set PAN ID in TCP/IP stack, using TCPIP_IPV6_G3PLC_PanIdSet function. This is important for the TCP/IP stack to recognize all G3 LLA as neighbors.
      • Add Coordinator LLA to NDP neighbor table as router, using TCPIP_IPV6_NeighborAddressAdd() function.
    • If G3 Conformance test is configured, _APP_TCPIP_MANAGEMENT_SetConformance() is called to add Conformance multi-cast addresses to IPv6 multi-cast listener list, using TCPIP_IPV6_MulticastListenerAdd() function.
  • APP_TCPIP_MANAGEMENT_STATE_CONFIGURED: TCP/IP stack is configured and there is nothing more to do. In FreeRTOS mode the task is suspended forever using a semaphore.
  • APP_TCPIP_MANAGEMENT_STATE_ERROR: There was an error during TCP/IP stack initialization.
There are another functions that are called from G3 management application:
  • APP_TCPIP_MANAGEMENT_SetConformanceConfig(): Configures the application for G3 Conformance certification tests (_APP_TCPIP_MANAGEMENT_SetConformance() function).
  • APP_TCPIP_MANAGEMENT_NetworkJoined(): Called when the Device joins to the network. If TCP/IP stack is ready, IPv6 addresses are configured using _APP_TCPIP_MANAGEMENT_SetIPv6Addresses() function.
  • APP_TCPIP_MANAGEMENT_NetworkDisconnected(): Called when the Device leaves the network. IPv6 addresses are removed from TCP/IP stack, using TCPIP_IPV6_AddressUnicastRemove() and TCPIP_IPV6_NeighborAddressDelete() functions.