1.8.1.4 EAP Server
The Extensible Authentication Protocol (EAP) server application file (app_eap_server.c) manages the LBP Coordinator module, accepting the join requests by devices and maintaining the list of joined devices.
The state machine is implemented in the
APP_EAP_SERVER_Tasks()
function.
The different states are:APP_EAP_SERVER_STATE_WAIT_NETWORK_STARTED
: ADP status is checked and when the G3 network has been started (ADP_STATUS_LBP_CONNECTED
), the LBP Coordinator module is initialized, including callback configuration and parameters configuration (PSK and GMK).APP_EAP_SERVER_NETWORK_STARTED
: The G3 network is started (ADP_STATUS_LBP_CONNECTED
). TheLBP_UpdateLbpSlots()
function is called to maintain the state machine of the LBP Coordinator module.APP_EAP_SERVER_STATE_ERROR
: There was an error during G3 stack initialization, probably because neither PLC nor RF transceivers are available.
Three LBP Coordinator callbacks are registered:
_LBP_COORD_JoinRequestIndication()
: It indicates that a device wants to join to the network. If it is not in the blacklist and the maximum number of devices has not been reached, a valid short address is assigned so the join request is accepted._LBP_COORD_JoinCompleteIndication()
: It indicates the completion of a device’s join process. The device is added to the list of joined devices._LBP_COORD_LeaveIndication()
: It indicates that a device has left the network. The device is removed from the list of joined devices.
There are two functions that are called from cycles application:
APP_EAP_SERVER_GetNumDevicesJoined()
: Returns the number of devices joined to the network.APP_EAP_SERVER_GetDeviceAddress()
: Returns the Extended Address (EUI64) and Short Address of the requested device.
There are another functions that not used, but are implemented as an example for the
user:
APP_EAP_SERVER_LaunchRekeying()
: Launches the re-keying process .APP_EAP_SERVER_KickDevice()
: Kicks a device from the network, giving its Short Address.APP_EAP_SERVER_AddToBlacklist()
: Adds a device to the blacklist, giving its Extended Address (EUI64). If that device tries to join, it will be denied.