1.2.5.24 ADP_DISCOVERY_IND_CALLBACK Typedef

C

typedef void (*ADP_DISCOVERY_IND_CALLBACK)(ADP_PAN_DESCRIPTOR* pPanDescriptor);

Summary

Pointer to a Discovery Indication Event handler function.

Description

This data type defines the required function signature for the ADP Discovery Indication event handling callback function. The ADP Discovery Indication primitive is generated by the ADP layer to notify the application about the discovery of a new PAN coordinator or LBA. A client must register a pointer using the event handling function whose function signature (parameter and return value types) matches the types specified by this function pointer in order to receive Discovery Indication events back from module.

The discovered PAN Coordinator or LBA is encoded as a PAN Descriptor (See ADP_PAN_DESCRIPTOR) and set as parameter of the Discovery Indication.

Parameters

ParamDescription
pPanDescriptorPointer to PAN descriptor containing information about the PAN

Returns

None.

Example

App_DiscoveryIndication(ADP_PAN_DESCRIPTOR *panDescriptor)
{
    uint8_t mediaType = MAC_WRP_MEDIA_TYPE_REQ_PLC_BACKUP_RF;

    if (panDescriptor->mediaType == MAC_WRP_MEDIA_TYPE_IND_RF)
    {
        mediaType = MAC_WRP_MEDIA_TYPE_REQ_RF_BACKUP_PLC;
    }

    LBP_AdpNetworkJoinRequest(panDescriptor->panId, panDescriptor->lbaAddress, mediaType);
    // Wait for Network Join Confirm
}

Remarks

None.