2.6.1 WPAN_MLME_AssociateReq Function

C

bool WPAN_MLME_AssociateReq(uint8_t LogicalChannel, uint8_t ChannelPage, WPAN_AddrSpec_t *CoordAddrSpec, uint8_t CapabilityInformation)

Summary

Initiate MLME-ASSOCIATE.request service and have it placed in the MLME-SAP queue.

Description

This function allows the device to request an association with coordinator. Initiate MLME-ASSOCIATE.request service and have it placed in the MLME-SAP queue. The MLME-ASSOCIATE.request primitive allows a device to request an association with a coordinator.

Precondition

WPAN_Init() should have been called before calling this function.

Parameters

ParamDescription
LogicalChannelThe logical channel on which to attempt association
ChannelPageThe channel page on which to attempt association
CoordAddrSpecPointer to WPAN_AddrSpec_t structure for coordinator
CapabilityInformationBitmap that describes the nodes capabilities :- @ref WPAN_CAP_ALTPANCOORD, WPAN_CAP_FFD, WPAN_CAP_PWRSOURCE, WPAN_CAP_RXONWHENIDLE, WPAN_CAP_ALLOCADDRESS

Returns

true - success; false - buffer not available or queue full.

Example

WPAN_AddrSpec_t coordAddrSpec;
coordAddrSpec.AddrMode = WPAN_ADDRMODE_SHORT;
coordAddrSpec.PANId = 0x1111;
coordAddrSpec.Addr.shortAddress = 0x0000U;
bool retVal = false;

retVal = WPAN_MLME_AssociateReq(
         13,
         0,
         &CoordAddrSpec,
         WPAN_CAP_ALLOCADDRESS);
if (true != retVal)
{
    printf("buffer not available or queue full");
}

Remarks

On the receipt of WPAN_MLME_AssociationReq, MAC layer will perform respective operation and asynchronously invokes USR_MLME_AssociateConf with proper status.