2.5.5 G3 ADP API
The G3 ADP API functions are defined in the AdpApi.h file. This file contains the interface with G3 ADP API, which is the entry point to the G3 stack. This file is a copy of the embedded, the G3 USI Host interface is same as the one embedded stack provides.
- Request functions to send
messages or
data:
void AdpGetRequest(uint32_t u32AttributeId, uint16_t u16AttributeIndex); - Callbacks to manage confirm and indication messages received.
When a confirm or an indication message is received, the corresponding callback is called. The callbacks are initialized when the ADP layer is initialized:
void AdpInitialize(struct TAdpNotifications *pNotifications, enum TAdpBand band, enum EAdpDeviceType);
where,
- The first argument is a pointer to a
struct with the callback
functions:
struct TAdpNotifications { AdpDataConfirm fnctAdpDataConfirm; AdpDataIndication fnctAdpDataIndication; AdpDiscoveryConfirm fnctAdpDiscoveryConfirm; AdpDiscoveryIndication fnctAdpDiscoveryIndication; AdpNetworkStartConfirm fnctAdpNetworkStartConfirm; AdpNetworkJoinConfirm fnctAdpNetworkJoinConfirm; AdpNetworkLeaveIndication fnctAdpNetworkLeaveIndication; AdpNetworkLeaveConfirm fnctAdpNetworkLeaveConfirm; AdpResetConfirm fnctAdpResetConfirm; AdpSetConfirm fnctAdpSetConfirm; AdpMacSetConfirm fnctAdpMacSetConfirm; AdpGetConfirm fnctAdpGetConfirm; AdpMacGetConfirm fnctAdpMacGetConfirm; AdpLbpConfirm fnctAdpLbpConfirm; AdpLbpIndication fnctAdpLbpIndication; AdpRouteDiscoveryConfirm fnctAdpRouteDiscoveryConfirm; AdpPathDiscoveryConfirm fnctAdpPathDiscoveryConfirm; AdpNetworkStatusIndication fnctAdpNetworkStatusIndication; AdpBufferIndication fnctAdpBufferIndication; AdpPREQIndication fnctAdpPREQIndication; AdpUpdNonVolatileDataIndication fnctAdpUpdNonVolatileDataIndication; AdpRouteNotFoundIndication fnctAdpRouteNotFoundIndication; };Each callback must have the appropriate parameters. The definition of the callback format is in the same file (AdpApi.h).
If a callback is set to NULL, the corresponding confirm or indication message will not be received by any callback function.
- The second argument is the frequency
band target, whose type (TAdpBand) is defined in the AdpApiTypes.h file.
Valid values are as follows:
- ADP_BAND_CENELEC_A
- ADP_BAND_CENELEC_B
- ADP_BAND_FCC
- ADP_BAND_ARIB
- The third argument is the device type allows to run a Device or Coordinator device through the ADP Serialization.
