2.6.3 WPAN_MLME_AssociateResp Function

C

bool WPAN_MLME_AssociateResp(uint64_t DeviceAddress, uint16_t AssocShortAddress,uint8_t status)

Summary

Initiate MLME-ASSOCIATE.response service and place it in the MLME-SAP queue.

Description

This function is used to send the associate response on the receipt of Associate Indication from MAC layer. It initiates MLME-ASSOCIATE.response service and place it in the MLME-SAP queue. The MLME-ASSOCIATE.response primitive is used to initiate a response to an MLMEASSOCIATE.indication primitive.

Precondition

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

Parameters

ParamDescription
DeviceAddressExtended address for device requesting association
AssocShortAddressShort address allocated on successful association
statusStatus of the association attempt. Valid values:- @ref ASSOCIATION_SUCCESSFUL, PAN_AT_CAPACITY, PAN_ACCESS_DENIED, ASSOCIATION_RESERVED

Returns

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

Example

usr_mlme_associate_ind_t *mlmeAssocInd;
usr_mlme_associate_ind_t assocInd;
assocInd.CapabilityInformation = mlmeAssocInd->CapabilityInformation;
assocInd.DeviceAddress = mlmeAssocInd->DeviceAddress;
uint16_t associate_short_addr = 0x0001U;

bool retVal = false;
retVal = WPAN_MLME_AssociateResp(assocInd.DeviceAddress, associate_short_addr, ASSOCIATION_SUCCESSFUL);
if (true != retVal)
{
      printf("buffer not available or queue full");
}

Remarks

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