2 MAC APIs

The following table provides the list of WPAN APIs which can be used by the higher layer to interact with MAC layer.

Table 2-1. MAC APIs
S.No API Name Description API Type
1WPAN_Init()

Initializes all stack resources including the microcontroller and transceiver using functions provided by the PHY and the PAL

Asynchronous
2WPAN_Task()
  • It invokes the corresponding task functions of the MCL, PHY and PAL.
  • Using the MAC software package it is required to call this function frequently supporting a round robin approach.
  • This ensures that the different layers state machines are served and their queues are processed.
Asynchronous
3WPAN_MCPS_Datareq(uint8_t SrcAddrMode, WPAN_AddrSpec_t *DstAddrSpec, uint8_t msduLength, uint8_t *msdu, uint8_t msduHandle, uint8_t TxOptions)This function is called to initiate MCPS-DATA.request service and have it placed in the MCPS-SAP queue.Asynchronous
4WPAN_MCPS_PurgeReq(const uint8_t msduHandle)This function is called to initiate MCPS-PURGE.request service and have it placed in the MCPS-SAP queue.Asynchronous
5WPAN_MLME_AssociateReq(uint8_t LogicalChannel, uint8_t ChannelPage, WPAN_AddrSpec_t *CoordAddrSpec, uint8_t CapabilityInformation)This function is called to initiate MLME-ASSOCIATE.request service and have it placed in the MLME-SAP queue.Asynchronous
6WPAN_MLME_AssociateResp(uint64_t DeviceAddress, uint16_t AssocShortAddress, uint8_t status);This function called to initiate MLME-ASSOCIATE.response service and place it in the MLME-SAP queue.Asynchronous
7WPAN_MLME_DisassociateReq(WPAN_AddrSpec_t *DeviceAddrSpec, uint8_t DisassociateReason, bool TxIndirect)This function is called to initiate MLME-DISASSOCIATE.request service and have it placed in the MLME-SAP queue.Asynchronous
8WPAN_MLME_GetReq(uint8_t PIBAttribute)This function is called to initiate MLME-GET.request service and add it to the MLME-SAP queue in order to retrieve the PIB attributes.Asynchronous
9WPAN_MLME_OrphanResp(uint64_t OrphanAddress, uint16_t ShortAddress, bool AssociatedMember)This function is called to initiate MLME-ORPHAN.response service and add it in MLME_SAP queue.Asynchronous
10WPAN_MLME_PollReq(WPAN_AddrSpec_t *CoordAddrSpec)This function is called to initiate MLME-POLL.request service and have it placed in the MLME-SAP queue.Asynchronous
11WPAN_MLME_ResetReq(bool SetDefaultPib)This function is called to initiate MLME-RESET.request service and have it placed in the MLME-SAP queue, SetDefaultPib to set all PIB values to their respective defaults.Asynchronous
12WPAN_MLME_SetReq(uint8_t PIBAttribute, void *PIBAttributeValue)This function is called to initiate MLME-SET.request service and have it placed in MLME_SAP queue and for set PIB attributes.Asynchronous
13WPAN_MLME_RxEnableReq(bool DeferPermit, uint32_t RxOnTime, uint32_t RxOnDuration)This function is called to initiate MLME-RX-ENABLE.request service and have it placed in the MLME-SAP queue.Asynchronous
14WPAN_MLME_ScanReq(uint8_t ScanType, uint32_t ScanChannels, uint8_t ScanDuration, uint8_t ChannelPage)This function is called to initiate MLME-SCAN.request service and have it placed in the MLME-SAP queue.Asynchronous
15WPAN_MLME_StartReq(uint16_t PANId, uint8_t LogicalChannel, uint8_t ChannelPage, uint8_t BeaconOrder, uint8_t SuperframeOrder, bool PANCoordinator, bool BatteryLifeExtension, bool CoordRealignment)This function is called to initiate MLME-START service and have it placed in the MLME-SAP queueAsynchronous
16USR_MCPS_DataConf(uint8_t msduHandle, uint8_t status)Callback function that must be implemented by application (NHLE) for MAC service MCPS-DATA.confirmNA
17USR_MCPS_DataInd(WPAN_AddrSpec_t * SrcAddrSpec, WPAN_AddrSpec_t * DstAddrSpec,uint8_t msduLength, uint8_t * msdu,uint8_t mpduLinkQuality, uint8_t DSN, uint32_t Timestamp, uint8_t SecurityLevel, uint8_t KeyIdMode, uint8_t KeyIndex)Callback function that must be implemented by application (NHLE) for MAC service MCPS-DATA.indicationNA
18USR_MCPS_PurgeConf(uint8_t msduHandle, uint8_t status)Callback function that must be implemented by application (NHLE) for MAC service MCPS-PURGE.confirm (handle of MSDU to be purged and status of requested purge operation)NA
19USR_MLME_AssociateConf(uint16_t AssocShortAddress, uint8_t status)Callback function that must be implemented by application (NHLE) for MAC service MLME-ASSOCIATE.confirm (association status and allocated short address by coordinator)NA
20USR_MLME_AssociateInd(uint64_t DeviceAddress, uint8_t CapabilityInformation)Callback function that must be implemented by application (NHLE) for MAC service MLME-ASSOCIATE.indication (extended address of device requesting and capabilities of device requesting association)NA
21USR_MLME_BeaconNotifyInd(uint8_t BSN, WPAN_Pandescriptor_t *PANDescriptor, uint8_t PendAddrSpec, uint8_t *AddrList, uint8_t sduLength, uint8_t *sdu)Callback function that must be implemented by application (NHLE) for MAC service MLME-BEACON-NOTIFY.indicationNA
22USR_MLME_CommStatusInd(WPAN_AddrSpec_t *SrcAddrSpec, WPAN_AddrSpec_t *DstAddrSpec, uint8_t status) Callback function that must be implemented by application (NHLE) for MAC service MLME-COMM-STATUS.indicationNA
23USR_MLME_DisassociateConf(uint8_t status, WPAN_AddrSpec_t *DeviceAddrSpec)Callback function that must be implemented by application (NHLE) for MAC service MLME-DISASSOCIATE.confirm (status of requested disassociate operation and DeviceAddrSpec Pointer to WPAN_AddrSpec_t structure for device that has either requested disassociation or been instructed to disassociate by its coordinator)NA
24USR_MLME_DisassociateInd(uint64_t DeviceAddress, uint8_t DisassociateReason)User call back function for MLME-DISASSOCIATE.indication (extended address of device which initiated the disassociation request and Reason for the disassociation)NA
25USR_MLME_GetConf(uint8_t status,uint8_t PIBAttribute, uint8_t PIBAttributeIndex, void *PIBAttributeValue)Callback function that must be implemented by application (NHLE) for MAC service MLME-GET.confirm (status of requested PIB attribute get operation and retrieved PIB attribute and values)NA
26USR_MLME_OrphanInd(uint64_t OrphanAddress)Callback function that must be implemented by application (NHLE) for MAC service MLME-ORPHAN.indication (address of orphaned device)NA
27USR_MLME_PollConf(uint8_t status)Callback function that must be implemented by application (NHLE) for MAC service MLME-POLL.confirm (result of requested poll operation)NA
28USR_MLME_ResetConf(uint8_t status)Callback function that must be implemented by application (NHLE) for MAC service MLME-RESET.confirm (result of requested reset operation)NA
29USR_MLME_RxEnableConf(uint8_t status)Callback function that must be implemented by application (NHLE) for MAC service MLME-RX-ENABLE.confirm (result of requested receiver enable operation)NA
30USR_MLME_ScanConf(uint8_t status, uint8_t ScanType, uint8_t ChannelPage, uint32_t UnscannedChannels, uint8_t ResultListSize, void *ResultList)Callback function that must be implemented by application (NHLE) for MAC service MLME-SCAN.confirm
31USR_MLME_SetConf(uint8_t status, uint8_t PIBAttribute)Callback function that must be implemented by application (NHLE) for MAC service MLME-SET.confirm (result of requested PIB attribute set operation and updated PIB attribute)NA
32USR_MLME_StartConf(uint8_t status)Callback function that must be implemented by application (NHLE) for MAC service MLME-START.confirm (result of requested start operation)NA
33MAC_ReadyToSleep()This function is used to check the MAC layer for its status before Device going to sleep. This function verifies the MAC internal queues for the pending request/indication to process and returns the status.Asynchronous
34MAC_Wakeup()This function implements the post sleep functionalities. If device is going to Deep sleep, then this function must be called after device wakeup routine to retrieve the Retention RAM parameters to system RAMAsynchronous