TI-15.4 Stack API
|
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
Functions | |
void * | ApiMac_init (bool enableFH) |
Initialize this module. More... | |
void | ApiMac_registerCallbacks (ApiMac_callbacks_t *pCallbacks) |
Register for MAC callbacks. More... | |
void | ApiMac_processIncoming (void) |
Process incoming messages from the MAC stack. More... | |
ApiMac_status_t | ApiMac_mcpsDataReq (ApiMac_mcpsDataReq_t *pData) |
This function sends application data to the MAC for transmission in a MAC data frame. The MAC can only buffer a certain number of data request frames. When the MAC is congested and cannot accept the data request it will initiate a callback (ApiMac_dataCnfFp_t) with an overflow status (ApiMac_status_transactionOverflow) . Eventually the MAC will become uncongested and initiate the callback (ApiMac_dataCnfFp_t) for a buffered request. At this point the application can attempt another data request. Using this scheme, the application can send data whenever it wants but it must queue data to be resent if it receives an overflow status. More... | |
ApiMac_status_t | ApiMac_mcpsPurgeReq (uint8_t msduHandle) |
This function purges and discards a data request from the MAC data queue. When the operation is complete the MAC sends a MCPS Purge Confirm which will initiate a callback (ApiMac_purgeCnfFp_t). More... | |
ApiMac_status_t | ApiMac_mlmeAssociateReq (ApiMac_mlmeAssociateReq_t *pData) |
This function sends an associate request to a coordinator device. The application shall attempt to associate only with a PAN that is currently allowing association, as indicated in the results of the scanning procedure. In a beacon-enabled PAN the beacon order must be set by using ApiMac_mlmeSetReq() before making the call to ApiMac_mlmeAssociateReq(). When the associate request is complete the appliction will receive the ApiMac_associateCnfFp_t callback. More... | |
ApiMac_status_t | ApiMac_mlmeAssociateRsp (ApiMac_mlmeAssociateRsp_t *pData) |
This function sends an associate response to a device requesting to associate. This function must be called after the ApiMac_associateIndFp_t callback. When the associate response is complete the callback ApiMac_commStatusIndFp_t is called to indicate the success or failure of the operation. More... | |
ApiMac_status_t | ApiMac_mlmeDisassociateReq (ApiMac_mlmeDisassociateReq_t *pData) |
This function is used by an associated device to notify the coordinator of its intent to leave the PAN. It is also used by the coordinator to instruct an associated device to leave the PAN. When the disassociate procedure is complete the applications callback ApiMac_disassociateCnfFp_t is called. More... | |
ApiMac_status_t | ApiMac_mlmeGetReqBool (ApiMac_attribute_bool_t pibAttribute, bool *pValue) |
This direct execute function retrieves an attribute value from the MAC PIB. More... | |
ApiMac_status_t | ApiMac_mlmeGetReqUint8 (ApiMac_attribute_uint8_t pibAttribute, uint8_t *pValue) |
This direct execute function retrieves an attribute value from the MAC PIB. More... | |
ApiMac_status_t | ApiMac_mlmeGetReqUint16 (ApiMac_attribute_uint16_t pibAttribute, uint16_t *pValue) |
This direct execute function retrieves an attribute value from the MAC PIB. More... | |
ApiMac_status_t | ApiMac_mlmeGetReqUint32 (ApiMac_attribute_uint32_t pibAttribute, uint32_t *pValue) |
This direct execute function retrieves an attribute value from the MAC PIB. More... | |
ApiMac_status_t | ApiMac_mlmeGetReqArray (ApiMac_attribute_array_t pibAttribute, uint8_t *pValue) |
This direct execute function retrieves an attribute value from the MAC PIB. More... | |
ApiMac_status_t | ApiMac_mlmeGetFhReqUint8 (ApiMac_FHAttribute_uint8_t pibAttribute, uint8_t *pValue) |
This direct execute function retrieves an attribute value from the MAC Frequency Hopping PIB. More... | |
ApiMac_status_t | ApiMac_mlmeGetFhReqUint16 (ApiMac_FHAttribute_uint16_t pibAttribute, uint16_t *pValue) |
This direct execute function retrieves an attribute value from the MAC Frequency Hopping PIB. More... | |
ApiMac_status_t | ApiMac_mlmeGetFhReqUint32 (ApiMac_FHAttribute_uint32_t pibAttribute, uint32_t *pValue) |
This direct execute function retrieves an attribute value from the MAC Frequency Hopping PIB. More... | |
ApiMac_status_t | ApiMac_mlmeGetFhReqArray (ApiMac_FHAttribute_array_t pibAttribute, uint8_t *pValue) |
This direct execute function retrieves an attribute value from the MAC Frequency Hopping PIB. More... | |
ApiMac_status_t | ApiMac_mlmeGetSecurityReqUint8 (ApiMac_securityAttribute_uint8_t pibAttribute, uint8_t *pValue) |
This direct execute function retrieves an attribute value from the MAC Secutity PIB. More... | |
ApiMac_status_t | ApiMac_mlmeGetSecurityReqUint16 (ApiMac_securityAttribute_uint16_t pibAttribute, uint16_t *pValue) |
This direct execute function retrieves an attribute value from the MAC Secutity PIB. More... | |
ApiMac_status_t | ApiMac_mlmeGetSecurityReqArray (ApiMac_securityAttribute_array_t pibAttribute, uint8_t *pValue) |
This direct execute function retrieves an attribute value from the MAC Secutity PIB. More... | |
ApiMac_status_t | ApiMac_mlmeGetSecurityReqStruct (ApiMac_securityAttribute_struct_t pibAttribute, void *pValue) |
This direct execute function retrieves an attribute value from the MAC Secutity PIB. More... | |
ApiMac_status_t | ApiMac_mlmeOrphanRsp (ApiMac_mlmeOrphanRsp_t *pData) |
This function is called in response to an orphan notification from a peer device. This function must be called after receiving an Orphan Indication Callback. When the orphan response is complete the Comm Status Indication Callback is called to indicate the success or failure of the operation. More... | |
ApiMac_status_t | ApiMac_mlmePollReq (ApiMac_mlmePollReq_t *pData) |
This function is used to request pending data from the coordinator. When the poll request is complete the Poll Confirm Callback is called. If a data frame of nonzero length is received from the coordinator the Poll Confirm Callback has a status ApiMac_status_success and then calls the Data Indication Callback for the received data. More... | |
ApiMac_status_t | ApiMac_mlmeResetReq (bool setDefaultPib) |
This direct execute function resets the MAC. This function must be called once at system startup before any other function in the management API is called. More... | |
ApiMac_status_t | ApiMac_mlmeScanReq (ApiMac_mlmeScanReq_t *pData) |
This function initiates an energy detect, active, passive, or orphan scan on one or more channels. An energy detect scan measures the peak energy on each requested channel. An active scan sends a beacon request on each channel and then listening for beacons. A passive scan is a receive-only operation that listens for beacons on each channel. An orphan scan is used to locate the coordinator with which the scanning device had previously associated. When a scan operation is complete the Scan Confirm callback is called. For active or passive scans the application sets the maxResults parameter the maximum number of PAN descriptors to return. If maxResults is greater than zero then the application must also set result.panDescriptor to point to a buffer of size maxResults * sizeof(ApiMac_panDesc_t) to store the results of the scan. The application must not access or deallocate this buffer until the Scan Confirm Callback is called. The MAC will store up to maxResults PAN descriptors and ignore duplicate beacons. An alternative way to get results for an active or passive scan is to set maxResults to zero or set PIB attribute ApiMac_attribute_autoRequest to FALSE. Then the MAC will not store results but rather call the Beacon Notify Indication Callback" for each beacon received. The application will not need to supply any memory to store the scan results but the MAC will not filter out duplicate beacons. For energy detect scans the application must set result.energyDetect to point to a buffer of size 18 bytes to store the results of the scan. The application must not access or deallocate this buffer until the Scan Confirm Callback is called. An energy detect, active or passive scan may be performed at any time if a scan is not already in progress. However a device cannot perform any other MAC management operation or send or receive MAC data until the scan is complete. More... | |
ApiMac_status_t | ApiMac_mlmeSetReqBool (ApiMac_attribute_bool_t pibAttribute, bool value) |
This direct execute function sets an attribute value in the MAC PIB. More... | |
ApiMac_status_t | ApiMac_mlmeSetReqUint8 (ApiMac_attribute_uint8_t pibAttribute, uint8_t value) |
This direct execute function sets an attribute value in the MAC PIB. More... | |
ApiMac_status_t | ApiMac_mlmeSetReqUint16 (ApiMac_attribute_uint16_t pibAttribute, uint16_t value) |
This direct execute function sets an attribute value in the MAC PIB. More... | |
ApiMac_status_t | ApiMac_mlmeSetReqUint32 (ApiMac_attribute_uint32_t pibAttribute, uint32_t value) |
This direct execute function sets an attribute value in the MAC PIB. More... | |
ApiMac_status_t | ApiMac_mlmeSetReqArray (ApiMac_attribute_array_t pibAttribute, uint8_t *pValue) |
This direct execute function sets an attribute value in the MAC PIB. More... | |
ApiMac_status_t | ApiMac_mlmeSetFhReqUint8 (ApiMac_FHAttribute_uint8_t pibAttribute, uint8_t value) |
This direct execute function sets an attribute value in the MAC Frequency Hopping PIB. More... | |
ApiMac_status_t | ApiMac_mlmeSetFhReqUint16 (ApiMac_FHAttribute_uint16_t pibAttribute, uint16_t value) |
This direct execute function sets an attribute value in the MAC Frequency Hopping PIB. More... | |
ApiMac_status_t | ApiMac_mlmeSetFhReqUint32 (ApiMac_FHAttribute_uint32_t pibAttribute, uint32_t value) |
This direct execute function sets an attribute value in the MAC Frequency Hopping PIB. More... | |
ApiMac_status_t | ApiMac_mlmeSetFhReqArray (ApiMac_FHAttribute_array_t pibAttribute, uint8_t *pValue) |
This direct execute function sets an attribute value in the MAC Frequency Hopping PIB. More... | |
ApiMac_status_t | ApiMac_mlmeSetSecurityReqUint8 (ApiMac_securityAttribute_uint8_t pibAttribute, uint8_t value) |
This direct execute function sets an attribute value in the MAC Security PIB. More... | |
ApiMac_status_t | ApiMac_mlmeSetSecurityReqUint16 (ApiMac_securityAttribute_uint16_t pibAttribute, uint16_t value) |
This direct execute function sets an attribute value in the MAC Security PIB. More... | |
ApiMac_status_t | ApiMac_mlmeSetSecurityReqArray (ApiMac_securityAttribute_array_t pibAttribute, uint8_t *pValue) |
This direct execute function sets an attribute value in the MAC Security PIB. More... | |
ApiMac_status_t | ApiMac_mlmeSetSecurityReqStruct (ApiMac_securityAttribute_struct_t pibAttribute, void *pValue) |
This direct execute function sets an attribute value in the MAC Security PIB. More... | |
ApiMac_status_t | ApiMac_mlmeStartReq (ApiMac_mlmeStartReq_t *pData) |
This function is called by a coordinator or PAN coordinator to start or reconfigure a network. Before starting a network the device must have set its short address. A PAN coordinator sets the short address by setting the attribute ApiMac_attribute_shortAddress. A coordinator sets the short address through association. When parameter panCoordinator is TRUE, the MAC automatically sets attributes ApiMac_attribute_panID and ApiMac_attribute_logicalChannel to the panId and logicalChannel parameters. If panCoordinator is FALSE, these parameters are ignored (they would already be set through association). The parameter beaconOrder controls whether the network is beacon-enabled or non beacon-enabled. For a beacon-enabled network this parameter also controls the beacon transmission interval. When the operation is complete the Start Confirm Callback is called. More... | |
ApiMac_status_t | ApiMac_mlmeSyncReq (ApiMac_mlmeSyncReq_t *pData) |
This function requests the MAC to synchronize with the coordinator by acquiring and optionally tracking its beacons. Synchronizing with the coordinator is recommended before associating in a beacon-enabled network. If the beacon could not be located on its initial search or during tracking, the MAC calls the Sync Loss Indication Callback with ApiMac_status_beaconLoss as the reason. Before calling this function the application must set PIB attributes ApiMac_attribute_beaconOrder, ApiMac_attribute_panId and either ApiMac_attribute_coordShortAddress or ApiMac_attribute_coordExtendedAddress to the address of the coordinator with which to synchronize. The application may wish to set PIB attribute ApiMac_attribute_autoRequest to FALSE before calling this function. Then when the MAC successfully synchronizes with the coordinator it will call the Beacon Notify Indication Callback". After receiving the callback the application may set ApiMac_attribute_autoRequest to TRUE to stop receiving beacon notifications. This function is only applicable to beacon-enabled networks. More... | |
uint8_t | ApiMac_randomByte (void) |
This function returns a random byte from the MAC random number generator. More... | |
ApiMac_status_t | ApiMac_updatePanId (uint16_t panId) |
Update Device Table entry and PIB with new Pan Id. More... | |
ApiMac_status_t | ApiMac_mlmeWSAsyncReq (ApiMac_mlmeWSAsyncReq_t *pData) |
This functions handles a WiSUN async request. The possible operation is Async Start or Async Stop. For the async start operation, the caller of this function can indicate which WiSUN async frame type to be sent on the specified channels. More... | |
ApiMac_status_t | ApiMac_startFH (void) |
This function starts the frequency hopping. Frequency hopping operation should have been enabled using ApiMac_enableFH() before calling this API. No need to call this API if you have called ApiMac_mlmeStartReq() with the startFH field set to true. More... | |
ApiMac_status_t | ApiMac_parsePayloadGroupIEs (uint8_t *pPayload, uint16_t payloadLen, ApiMac_payloadIeRec_t **pList) |
Parses the Group payload information element. This function creates a linked list (plist) from the Payload IE (pPayload). Each item in the linked list is a seperate Group IE with its own content. If no IEs are found pList will be set to NULL. The caller is responsible to release the memory for the linked list by calling ApiMac_freeIEList(). Call this function to create the list of Group IEs, then call ApiMac_parsePayloadSubIEs() to parse each of the group IE's content into sub IEs. More... | |
ApiMac_status_t | ApiMac_parsePayloadSubIEs (uint8_t *pContent, uint16_t contentLen, ApiMac_payloadIeRec_t **pList) |
Parses the payload sub information element. This function creates a linked list (pList) of sub IEs from the Group IE content (pContent). Each item in the linked list is a seperate sub IE with its own content. If no IEs are found pList will be set to NULL. The caller is responsible to release the memory for the linked list by calling ApiMac_freeIEList(). Call this function after calling ApiMac_parsePayloadGroupIEs(). More... | |
void | ApiMac_freeIEList (ApiMac_payloadIeRec_t *pList) |
Free the linked list allocated by ApiMac_parsePayloadGroupIEs() or ApiMac_parsePayloadSubIEs(). More... | |
ApiMac_status_t | ApiMac_enableFH (void) |
Enables the Frequency hopping operation. Make sure you call this function before setting any FH parameters or before calling ApiMac_mlmeStartReq() or ApiMac_startFH(), if you're using FH. More... | |
uint8_t | ApiMac_convertCapabilityInfo (ApiMac_capabilityInfo_t *pMsgcapInfo) |
Convert ApiMac_capabilityInfo_t data type to uint8 capInfo. More... | |
void | ApiMac_buildMsgCapInfo (uint8_t cInfo, ApiMac_capabilityInfo_t *pPBcapInfo) |
Convert from bitmask byte to API MAC capInfo. More... | |
ApiMac_status_t | ApiMac_secAddDevice (ApiMac_secAddDevice_t *pAddDevice) |
Adds a new MAC device table entry. More... | |
ApiMac_status_t | ApiMac_secDeleteDevice (ApiMac_sAddrExt_t *pExtAddr) |
Removes MAC device table entries. More... | |
ApiMac_status_t | ApiMac_secDeleteKeyAndAssocDevices (uint8_t keyIndex) |
Removes the key at the specified key Index and removes all MAC device table enteries associated with this key. Also removes(initializes) the key lookup list associated with this key. More... | |
ApiMac_status_t | ApiMac_secDeleteAllDevices (void) |
Removes all MAC device table entries. More... | |
ApiMac_status_t | ApiMac_secGetDefaultSourceKey (uint8_t keyId, uint32_t *pFrameCounter) |
Reads the frame counter value associated with a MAC security key indexed by the designated key identifier and the default key source. More... | |
ApiMac_status_t | ApiMac_secAddKeyInitFrameCounter (ApiMac_secAddKeyInitFrameCounter_t *pInfo) |
Adds the MAC security key, adds the associated lookup list for the key, initializes the frame counter to the value provided. It also duplicates the device table enteries (associated with the previous key if any) if available based on the flag dupDevFlag value and associates the device descriptor with this key. More... | |
#define APIMAC_KEY_MAX_LEN 16 |
Key Length
#define APIMAC_SADDR_EXT_LEN 8 |
IEEE Address Length
#define MAX_KEY_TABLE_ENTRIES 2 |
#define MAX_SECURITY_LEVEL_TABLE_ENTRIES 2 |
#define MAX_KEY_ID_LOOKUP_ENTRIES 1 |
#define MAX_KEY_DEVICE_TABLE_ENTRIES MAX_DEVICE_TABLE_ENTRIES |
#define MAX_NODE_KEY_ENTRIES 1 |
#define MAX_KEY_USAGE_TABLE_ENTRIES 2 |
#define APIMAC_MAX_KEY_TABLE_ENTRIES MAX_KEY_TABLE_ENTRIES |
Maximum number of key table entries
#define API_MAX_NODE_KEY_ENTRIES MAX_NODE_KEY_ENTRIES |
Maximum number of keys/device
#define APIMAC_KEYID_IMPLICIT_LEN 0 |
Key identifier field length - Implicit mode
#define APIMAC_KEYID_MODE1_LEN 1 |
Key identifier field length - mode 1
#define APIMAC_KEYID_MODE4_LEN 5 |
Key Identifier field length - mode 4
#define APIMAC_KEYID_MODE8_LEN 9 |
Key Identifier field length - mode 8
#define APIMAC_KEY_SOURCE_MAX_LEN 8 |
Key source maximum length in bytes
#define APIMAC_KEY_INDEX_LEN 1 |
Key index length in bytes
#define APIMAC_FRAME_COUNTER_LEN 4 |
Frame counter length in bytes
#define APIMAC_KEY_LOOKUP_SHORT_LEN 5 |
Key lookup data length in bytes - short length
#define APIMAC_KEY_LOOKUP_LONG_LEN 9 |
Key lookup data length in bytes - long length
#define APIMAC_MAX_KEY_LOOKUP_LEN APIMAC_KEY_LOOKUP_LONG_LEN |
Key lookup data length in bytes - lookup length
#define APIMAC_DATA_OFFSET 24 |
Bytes required for MAC header in data frame
#define APIMAC_MAX_BEACON_PAYLOAD 16 |
Maximum length allowed for the beacon payload
#define APIMAC_MIC_32_LEN 4 |
Length required for MIC-32 authentication
#define APIMAC_MIC_64_LEN 8 |
Length required for MIC-64 authentication
#define APIMAC_MIC_128_LEN 16 |
Length required for MIC-128 authentication
#define APIMAC_MHR_LEN 37 |
MHR length for received frame
#define APIMAC_CHANNEL_PAGE_9 9 |
Channel Page - standard-defined SUN PHY operating modes
#define APIMAC_CHANNEL_PAGE_10 10 |
Channel Page - MR-FSK Generic-PHY-defined PHY modes
#define APIMAC_CHANNEL_PAGE_NONE 0 |
Channel Page - none for IEEE modes
#define APIMAC_STANDARD_PHY_DESCRIPTOR_ENTRIES 5 |
Maximum number of Standard PHY descriptor entries
#define APIMAC_GENERIC_PHY_DESCRIPTOR_ENTRIES 10 |
Maximum number of Generic PHY descriptor entries
#define APIMAC_50KBPS_915MHZ_PHY_1 1 |
PHY IDs - 915MHz Frequency band operating mode # 1
#define APIMAC_50KBPS_868MHZ_PHY_3 3 |
868MHz Frequency band operating mode #1
#define APIMAC_50KBPS_433MHZ_PHY_128 128 |
433MHz Frequency band operating mode #1
#define APIMAC_5KBPS_915MHZ_PHY_129 129 |
PHY IDs - 915MHz LRM Frequency band operating mode # 1
#define APIMAC_5KBPS_433MHZ_PHY_130 130 |
433MHz LRM Frequency band operating mode #1
#define APIMAC_5KBPS_868MHZ_PHY_131 131 |
868MHz LRM Frequency band operating mode #1
#define APIMAC_200KBPS_915MHZ_PHY_132 132 |
PHY IDs - 915MHz Frequency band operating mode # 3
#define APIMAC_200KBPS_868MHZ_PHY_133 133 |
868MHz Frequency band operating mode #3
#define APIMAC_250KBPS_IEEE_PHY_0 0 |
Channel Page - none for IEEE modes
#define APIMAC_MRFSK_STD_PHY_ID_BEGIN APIMAC_50KBPS_915MHZ_PHY_1 |
PHY IDs - MRFSK Standard Phy ID start
#define APIMAC_MRFSK_STD_PHY_ID_END ( APIMAC_MRFSK_STD_PHY_ID_BEGIN + APIMAC_STANDARD_PHY_DESCRIPTOR_ENTRIES - 1 ) |
PHY IDs - MRFSK Standard Phy ID end
#define APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN APIMAC_50KBPS_433MHZ_PHY_128 |
PHY IDs - MRFSK Generic Phy ID start
#define APIMAC_MRFSK_GENERIC_PHY_ID_END ( APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN + APIMAC_GENERIC_PHY_DESCRIPTOR_ENTRIES - 1 ) |
PHY IDs - MRFSK Generic Phy ID end
#define APIMAC_PHY_DESCRIPTOR 0x01 |
PHY descriptor table entry
#define APIMAC_NO_EXTENDER 0x00 |
Range Extender Mode disable high gain
#define APIMAC_HIGH_GAIN_MODE 0x01 |
Range Extender Mode enable high gain
#define APIMAC_DEFAULT_PA 0x00 |
High PA Type default PA
#define APIMAC_HIGH_PA 0x01 |
High PA Type high PA
#define APIMAC_ADDR_USE_EXT 0xFFFE |
Special address value - Short address value indicating extended address is used
#define APIMAC_SHORT_ADDR_BROADCAST 0xFFFF |
Special address value - Broadcast short address
#define APIMAC_SHORT_ADDR_NONE 0xFFFF |
Special address value - Short address when there is no short address
#define APIMAC_RANDOM_SEED_LEN 32 |
The length of the random seed is set for maximum requirement which is 32
#define APIMAC_FH_UTT_IE 0x00000002 |
Frequency Hopping UTT IE Selection Bit
#define APIMAC_FH_BT_IE 0x00000008 |
Frequency Hopping BT IE Selection Bit
#define APIMAC_FH_US_IE 0x00010000 |
Frequency Hopping US IE Selection Bit
#define APIMAC_FH_BS_IE 0x00020000 |
Frequency Hopping BS IE Selection Bit
#define APIMAC_FH_HEADER_IE_MASK 0x000000FF |
Frequency hopping header IE's mask
#define APIMAC_FH_PROTO_DISPATCH_NONE 0x00 |
Frequency hopping Protocol dispatch values - Protocol dispatch none
#define APIMAC_FH_PROTO_DISPATCH_MHD_PDU 0x01 |
Frequency hopping Protocol dispatch values - Protocol dispatch MHD-PDU
#define APIMAC_FH_PROTO_DISPATCH_6LOWPAN 0x02 |
Frequency hopping Protocol dispatch values - Protocol dispatch 6LOWPAN
#define APIMAC_154G_MAX_NUM_CHANNEL 129 |
Maximum number of channels
#define APIMAC_154G_CHANNEL_BITMAP_SIZ ((APIMAC_154G_MAX_NUM_CHANNEL + 7) / 8) |
Bitmap size to hold the channel list
#define APIMAC_HEADER_IE_MAX 2 |
Maximum number of header IEs
#define APIMAC_PAYLOAD_IE_MAX 2 |
Maximum number of payload-IEs
#define APIMAC_PAYLOAD_SUB_IE_MAX 4 |
Maximum number of sub-IEs
#define APIMAC_SFS_BEACON_ORDER | ( | s | ) | ((s) & 0x0F) |
MACRO that returns the beacon order from the superframe specification
#define APIMAC_SFS_SUPERFRAME_ORDER | ( | s | ) | (((s) >> 4) & 0x0F) |
MACRO that returns the superframe order from the superframe specification
#define APIMAC_SFS_FINAL_CAP_SLOT | ( | s | ) | (((s) >> 8) & 0x0F) |
MACRO that returns the final CAP slot from the superframe specification
#define APIMAC_SFS_BLE | ( | s | ) | (((s) >> 12) & 0x01) |
MACRO that returns the battery life extension bit from the superframe specification
#define APIMAC_SFS_PAN_COORDINATOR | ( | s | ) | (((s) >> 14) & 0x01) |
MACRO that returns the PAN coordinator bit from the superframe specification
#define APIMAC_SFS_ASSOCIATION_PERMIT | ( | s | ) | (((s) >> 15) & 0x01) |
MACRO that returns the Associate Permit bit from the superframe specification
#define APIMAC_FH_MAX_BIT_MAP_SIZE 32 |
Max size of the Frequency Hopping Channel Map Size
#define APIMAC_FH_NET_NAME_SIZE_MAX 32 |
Max size of the Frequency Hopping Network Name
#define APIMAC_FH_GTK_HASH_SIZE 8 |
Size of the Frequency Hopping GTK Hash Size
typedef uint8_t ApiMac_sAddrExt_t[APIMAC_SADDR_EXT_LEN] |
Extended address
typedef struct _apimac_sdata ApiMac_sData_t |
Data buffer structure
typedef struct _apimac_mrfskphydesc ApiMac_MRFSKPHYDesc_t |
Generic PHY Descriptor. We are using this structure for both Channel Page 9 and Channel Page 10.
typedef struct _apimac_sec ApiMac_sec_t |
Common security type
typedef struct _apimac_keyidlookupdescriptor ApiMac_keyIdLookupDescriptor_t |
Key ID Lookup Descriptor
typedef struct _apimac_keydevicedescriptor ApiMac_keyDeviceDescriptor_t |
Key Device Descriptor
typedef struct _apimac_keyusagedescriptor ApiMac_keyUsageDescriptor_t |
Key Usage Descriptor
typedef struct _apimac_keydescriptor ApiMac_keyDescriptor_t |
Key Descriptor
typedef struct _apimac_devicedescriptor ApiMac_deviceDescriptor_t |
Device Descriptor
typedef struct _apimac_securityleveldescriptor ApiMac_securityLevelDescriptor_t |
Security Level Descriptor
typedef struct _apimac_secdevicedescriptor ApiMac_securityDeviceDescriptor_t |
Security Device Descriptor
typedef struct _apimac_securitykeyentry ApiMac_securityKeyEntry_t |
MAC key entry structure
Security PIB Key ID lookup entry for a Get/Set ApiMac_securityAttribute_keyIdLookupEntry
Security PIB Key ID device entry for a Get/Set ApiMac_securityAttribute_keyDeviceEntry
Security PIB Key ID usage entry for a Get/Set ApiMac_securityAttribute_keyUsageEntry
typedef struct _apimac_securitypibkeyentry ApiMac_securityPibKeyEntry_t |
Security PIB Key entry for a Get/Set ApiMac_securityAttribute_keyEntry
typedef struct _apimac_securitypibdeviceentry ApiMac_securityPibDeviceEntry_t |
Security PIB device entry for a Get/Set ApiMac_securityAttribute_deviceEntry
Security PIB level entry for a Get/Set ApiMac_securityAttribute_securityLevelEntry
typedef struct _apimac_capabilityinfo ApiMac_capabilityInfo_t |
Structure defines the Capabilities Information bit field.
typedef struct _apimac_txoptions ApiMac_txOptions_t |
Data Request Transmit Options
typedef struct _apimac_mcpsdatareq ApiMac_mcpsDataReq_t |
MCPS data request type
typedef struct _apimac_payloadieitem ApiMac_payloadIeItem_t |
Structure a Payload information Item
typedef struct _apimac_payloadierec ApiMac_payloadIeRec_t |
A Payload IE Link List record
typedef struct _apimac_mcpsdataind ApiMac_mcpsDataInd_t |
MCPS data indication type
typedef struct _apimac_mcpsdatacnf ApiMac_mcpsDataCnf_t |
MCPS data confirm type
typedef struct _apimac_mcpspurgecnf ApiMac_mcpsPurgeCnf_t |
MCPS purge confirm type
typedef struct _apimac_pandesc ApiMac_panDesc_t |
PAN descriptor type
typedef struct _apimac_macmlmeassociatereq ApiMac_mlmeAssociateReq_t |
MLME associate request type
typedef struct _apimac_mlmeassociatersp ApiMac_mlmeAssociateRsp_t |
MLME associate response type
typedef struct _apimac_mlmedisassociatereq ApiMac_mlmeDisassociateReq_t |
MLME disassociate request type
typedef struct _apimac_mlmeorphanrsp ApiMac_mlmeOrphanRsp_t |
MLME orphan response type
typedef struct _apimac_mlmepollreq ApiMac_mlmePollReq_t |
MLME poll request type
typedef struct _apimac_mlmescanreq ApiMac_mlmeScanReq_t |
MLME scan request type
typedef struct _apimac_mpmParams ApiMac_mpmParams_t |
MPM(Multi-PHY layer management) parameters
typedef struct _apimac_mlmestartreq ApiMac_mlmeStartReq_t |
MLME start request type
typedef struct _apimac_mlmesyncreq ApiMac_mlmeSyncReq_t |
MAC_MlmeSyncReq type
typedef struct _apimac_mlmewsasyncreq ApiMac_mlmeWSAsyncReq_t |
MLME WiSUN Async request type
typedef struct _apimac_secadddevice ApiMac_secAddDevice_t |
Structure to pass information to the ApiMac_secAddDevice().
Structure to pass information to the ApiMac_secAddKeyInitFrameCounter().
typedef struct _apimac_mlmeassociateind ApiMac_mlmeAssociateInd_t |
MAC_MLME_ASSOCIATE_IND type
typedef struct _apimac_mlmeassociatecnf ApiMac_mlmeAssociateCnf_t |
MAC_MLME_ASSOCIATE_CNF type
typedef struct _apimac_mlmedisassociateind ApiMac_mlmeDisassociateInd_t |
MAC_MLME_DISASSOCIATE_IND type
typedef struct _apimac_mlmediassociatecnf ApiMac_mlmeDisassociateCnf_t |
MAC_MLME_DISASSOCIATE_CNF type
typedef struct _apimac_beacondata ApiMac_beaconData_t |
MAC Beacon data type
typedef struct _apimac_coexist ApiMac_coexist_t |
Coexistence Information element content type
typedef struct _apimac_ebeacondata ApiMac_eBeaconData_t |
MAC Enhanced beacon data type
typedef struct _apimac_mlmeorphanind ApiMac_mlmeOrphanInd_t |
MAC_MLME_ORPHAN_IND type
typedef struct _apimac_mlmescancnf ApiMac_mlmeScanCnf_t |
MAC_MLME_SCAN_CNF type
typedef struct _apimac_mlmestartcnf ApiMac_mlmeStartCnf_t |
MAC_MLME_START_CNF type
typedef struct _apimac_mlmesynclossind ApiMac_mlmeSyncLossInd_t |
MAC_MLME_SYNC_LOSS_IND type
typedef struct _apimac_mlmepollcnf ApiMac_mlmePollCnf_t |
MAC_MLME_POLL_CNF type
typedef struct _apimac_mlmecommstatusind ApiMac_mlmeCommStatusInd_t |
MAC_MLME_COMM_STATUS_IND type
typedef struct _apimac_mlmepollind ApiMac_mlmePollInd_t |
MAC_MLME_POLL_IND type
MAC_MLME_WS_ASYNC_FRAME_IND type
typedef struct _apimac_mlmewsasynccnf ApiMac_mlmeWsAsyncCnf_t |
MAC_MLME_WS_ASYNC_FRAME_CNF type
typedef void(* ApiMac_associateIndFp_t) (ApiMac_mlmeAssociateInd_t *pAssocInd) |
Associate Indication Callback function pointer prototype for the callback table
typedef void(* ApiMac_associateCnfFp_t) (ApiMac_mlmeAssociateCnf_t *pAssocCnf) |
Assocate Confirmation Callback function pointer prototype for the callback table
typedef void(* ApiMac_disassociateIndFp_t) (ApiMac_mlmeDisassociateInd_t *pDisassociateInd) |
Disassociate Indication Callback function pointer prototype for the callback table
typedef void(* ApiMac_disassociateCnfFp_t) (ApiMac_mlmeDisassociateCnf_t *pDisassociateCnf) |
Disassociate Confirm Callback function pointer prototype for the callback table
typedef void(* ApiMac_beaconNotifyIndFp_t) (ApiMac_mlmeBeaconNotifyInd_t *pBeaconNotifyInd) |
Beacon Notify Indication Callback function pointer prototype for the callback table
typedef void(* ApiMac_orphanIndFp_t) (ApiMac_mlmeOrphanInd_t *pOrphanInd) |
Orphan Indication Callback function pointer prototype for the callback table
typedef void(* ApiMac_scanCnfFp_t) (ApiMac_mlmeScanCnf_t *pScanCnf) |
Scan Confirmation Callback function pointer prototype for the callback table
typedef void(* ApiMac_startCnfFp_t) (ApiMac_mlmeStartCnf_t *pStartCnf) |
Start Confirmation Callback function pointer prototype for the callback table
typedef void(* ApiMac_syncLossIndFp_t) (ApiMac_mlmeSyncLossInd_t *pSyncLossInd) |
Sync Loss Indication Callback function pointer prototype for the callback table
typedef void(* ApiMac_pollCnfFp_t) (ApiMac_mlmePollCnf_t *pPollCnf) |
Poll Confirm Callback function pointer prototype for the callback table
typedef void(* ApiMac_commStatusIndFp_t) (ApiMac_mlmeCommStatusInd_t *pCommStatus) |
Comm Status Indication Callback function pointer prototype for the callback table
typedef void(* ApiMac_pollIndFp_t) (ApiMac_mlmePollInd_t *pPollInd) |
Poll Indication Callback function pointer prototype for the callback table
typedef void(* ApiMac_dataCnfFp_t) (ApiMac_mcpsDataCnf_t *pDataCnf) |
Data Confirmation Callback function pointer prototype for the callback table
typedef void(* ApiMac_dataIndFp_t) (ApiMac_mcpsDataInd_t *pDataInd) |
Data Indication Callback function pointer prototype for the callback table
typedef void(* ApiMac_purgeCnfFp_t) (ApiMac_mcpsPurgeCnf_t *pPurgeCnf) |
Purge Confirmation Callback function pointer prototype for the callback table
typedef void(* ApiMac_wsAsyncIndFp_t) (ApiMac_mlmeWsAsyncInd_t *pWsAsyncInd) |
WiSUN Async Indication Callback function pointer prototype for the callback table
typedef void(* ApiMac_wsAsyncCnfFp_t) (ApiMac_mlmeWsAsyncCnf_t *pWsAsyncCnf) |
WiSUN Async Confirmation Callback function pointer prototype for the callback table
typedef void(* ApiMac_unprocessedFp_t) (uint16_t param1, uint16_t param2, void *pMsg) |
Unprocessed Message Callback function pointer prototype for the callback table. This function will be called when an unrecognized message is received.
typedef struct _apimac_callbacks ApiMac_callbacks_t |
Structure containing all the MAC callbacks (indications). To receive the confirmation or indication fill in the associated callback with a pointer to the function that will handle that callback. To ignore a callback set that function pointer to NULL.
enum ApiMac_assocStatus_t |
enum ApiMac_addrType_t |
Address types - used to set addrMode field of the ApiMac_sAddr_t structure.
Enumerator | |
---|---|
ApiMac_addrType_none | Address not present |
ApiMac_addrType_short | Short Address (16 bits) |
ApiMac_addrType_extended | Extended Address (64 bits) |
enum ApiMac_beaconType_t |
Beacon types in the ApiMac_mlmeBeaconNotifyInd_t structure.
Enumerator | |
---|---|
ApiMac_beaconType_normal | normal beacon type |
ApiMac_beaconType_enhanced | enhanced beacon type |
Comm Status Indication Reasons
enum ApiMac_status_t |
General MAC Status values
enum ApiMac_secLevel_t |
MAC Security Levels
enum ApiMac_keyIdMode_t |
Standard PIB Get and Set Attributes - size bool
Standard PIB Get and Set Attributes - size uint8_t
Standard PIB Get and Set Attributes - size uint16_t
Standard PIB Get and Set Attributes - size uint32_t
Standard PIB Get and Set Attributes - these attributes are array of bytes
Security PIB Get and Set Attributes - size uint8_t
Security PIB Get and Set Attributes - size uint16_t
Security PIB Get and Set Attributes - array of bytes
Security PIB Get and Set Attributes - these attributes are structures
Enumerator | |
---|---|
ApiMac_securityAttribute_keyTable | A table of KeyDescriptor, entries, each containing keys and related information required for secured communications. This is a SET only attribute. Call ApiMac_mlmeSetSecurityReqStruct() with pValue set to NULL, the MAC will build the table. |
ApiMac_securityAttribute_keyIdLookupEntry | The key lookup table entry, part of an entry of the key table. To GET or SET to this attribute, setup the keyIndex and keyIdLookupIndex fields of ApiMac_securityPibKeyIdLookupEntry_t, call ApiMac_mlmeGetSecurityReqStruct() or ApiMac_mlmeSetSecurityReqStruct() with a pointer to the ApiMac_securityPibKeyIdLookupEntry_t structure. For the GET, the lookupEntry field will contain the required data. |
ApiMac_securityAttribute_keyDeviceEntry | The key device entry, part of an entry of the key table. To GET or SET to this attribute, setup the keyIndex and keyDeviceIndex fields of ApiMac_securityPibKeyDeviceEntry_t, call ApiMac_mlmeGetSecurityReqStruct() or ApiMac_mlmeSetSecurityReqStruct() with a pointer to the ApiMac_securityPibKeyDeviceEntry_t structure. For the GET, the deviceEntry field will contain the required data. |
ApiMac_securityAttribute_keyUsageEntry | The key usage entry, part of an entry of the key table. To GET or SET to this attribute, setup the keyIndex and keyUsageIndex fields of ApiMac_securityPibKeyUsageEntry_t, call ApiMac_mlmeGetSecurityReqStruct() or ApiMac_mlmeSetSecurityReqStruct() with a pointer to the ApiMac_securityPibKeyUsageEntry_t structure. For the GET, the usageEntry field will contain the required data. |
ApiMac_securityAttribute_keyEntry | The MAC key entry, an entry of the key table. To GET or SET to this attribute, setup the keyIndex field of ApiMac_securityPibKeyEntry_t, call ApiMac_mlmeGetSecurityReqStruct() or ApiMac_mlmeSetSecurityReqStruct() with a pointer to the ApiMac_securityPibKeyEntry_t structure. For the GET, the rest of the fields will contain the required data. |
ApiMac_securityAttribute_deviceEntry | The MAC device entry, an entry of the device table. To GET or SET to this attribute, setup the deviceIndex field of ApiMac_securityPibDeviceEntry_t, call ApiMac_mlmeGetSecurityReqStruct() or ApiMac_mlmeSetSecurityReqStruct() with a pointer to the ApiMac_securityPibDeviceEntry_t structure. For the GET, the deviceEntry field will contain the required data. |
ApiMac_securityAttribute_securityLevelEntry | The MAC security level entry, an entry of the security level table. To GET or SET to this attribute, setup the levelIndex field of ApiMac_securityPibSecurityLevelEntry_t, call ApiMac_mlmeGetSecurityReqStruct() or ApiMac_mlmeSetSecurityReqStruct() with a pointer to the ApiMac_securityPibSecurityLevelEntry_t structure. For the GET, the levelEntry field will contain the required data. |
Frequency Hopping PIB Get and Set Attributes - size uint8_t
Frequency Hopping PIB Get and Set Attributes - size uint16_t
Frequency Hopping PIB Get and Set Attributes - array of bytes
enum ApiMac_fhFrameType_t |
FH Frame Types
enum ApiMac_MLMESubIE_t |
enum ApiMac_wisunSubIE_t |
WiSUN Sub IEs
enum ApiMac_scantype_t |
Scan Types
WiSUN Async Frame Types
void* ApiMac_init | ( | bool | enableFH | ) |
Initialize this module.
enableFH | - true to enable frequency hopping, false to not. |
void ApiMac_registerCallbacks | ( | ApiMac_callbacks_t * | pCallbacks | ) |
Register for MAC callbacks.
pCallbacks | - pointer to callback structure |
void ApiMac_processIncoming | ( | void | ) |
Process incoming messages from the MAC stack.
ApiMac_status_t ApiMac_mcpsDataReq | ( | ApiMac_mcpsDataReq_t * | pData | ) |
This function sends application data to the MAC for transmission in a MAC data frame.
The MAC can only buffer a certain number of data request frames. When the MAC is congested and cannot accept the data request it will initiate a callback (ApiMac_dataCnfFp_t) with an overflow status (ApiMac_status_transactionOverflow) . Eventually the MAC will become uncongested and initiate the callback (ApiMac_dataCnfFp_t) for a buffered request. At this point the application can attempt another data request. Using this scheme, the application can send data whenever it wants but it must queue data to be resent if it receives an overflow status.
pData | - pointer to parameter structure |
ApiMac_status_t ApiMac_mcpsPurgeReq | ( | uint8_t | msduHandle | ) |
This function purges and discards a data request from the MAC data queue. When the operation is complete the MAC sends a MCPS Purge Confirm which will initiate a callback (ApiMac_purgeCnfFp_t).
msduHandle | - The application-defined handle value |
ApiMac_status_t ApiMac_mlmeAssociateReq | ( | ApiMac_mlmeAssociateReq_t * | pData | ) |
This function sends an associate request to a coordinator device. The application shall attempt to associate only with a PAN that is currently allowing association, as indicated in the results of the scanning procedure. In a beacon-enabled PAN the beacon order must be set by using ApiMac_mlmeSetReq() before making the call to ApiMac_mlmeAssociateReq().
When the associate request is complete the appliction will receive the ApiMac_associateCnfFp_t callback.
pData | - Pointer to parameters structure. |
ApiMac_status_t ApiMac_mlmeAssociateRsp | ( | ApiMac_mlmeAssociateRsp_t * | pData | ) |
This function sends an associate response to a device requesting to associate. This function must be called after the ApiMac_associateIndFp_t callback. When the associate response is complete the callback ApiMac_commStatusIndFp_t is called to indicate the success or failure of the operation.
pData | - Pointer to parameters structure. |
ApiMac_status_t ApiMac_mlmeDisassociateReq | ( | ApiMac_mlmeDisassociateReq_t * | pData | ) |
This function is used by an associated device to notify the coordinator of its intent to leave the PAN. It is also used by the coordinator to instruct an associated device to leave the PAN. When the disassociate procedure is complete the applications callback ApiMac_disassociateCnfFp_t is called.
pData | - Pointer to parameters structure. |
ApiMac_status_t ApiMac_mlmeGetReqBool | ( | ApiMac_attribute_bool_t | pibAttribute, |
bool * | pValue | ||
) |
This direct execute function retrieves an attribute value from the MAC PIB.
pibAttribute | - The attribute identifier |
pValue | - pointer to the attribute value |
ApiMac_status_t ApiMac_mlmeGetReqUint8 | ( | ApiMac_attribute_uint8_t | pibAttribute, |
uint8_t * | pValue | ||
) |
This direct execute function retrieves an attribute value from the MAC PIB.
pibAttribute | - The attribute identifier |
pValue | - pointer to the attribute value |
ApiMac_status_t ApiMac_mlmeGetReqUint16 | ( | ApiMac_attribute_uint16_t | pibAttribute, |
uint16_t * | pValue | ||
) |
This direct execute function retrieves an attribute value from the MAC PIB.
pibAttribute | - The attribute identifier |
pValue | - pointer to the attribute value |
ApiMac_status_t ApiMac_mlmeGetReqUint32 | ( | ApiMac_attribute_uint32_t | pibAttribute, |
uint32_t * | pValue | ||
) |
This direct execute function retrieves an attribute value from the MAC PIB.
pibAttribute | - The attribute identifier |
pValue | - pointer to the attribute value |
ApiMac_status_t ApiMac_mlmeGetReqArray | ( | ApiMac_attribute_array_t | pibAttribute, |
uint8_t * | pValue | ||
) |
This direct execute function retrieves an attribute value from the MAC PIB.
pibAttribute | - The attribute identifier |
pValue | - pointer to the attribute value |
ApiMac_status_t ApiMac_mlmeGetFhReqUint8 | ( | ApiMac_FHAttribute_uint8_t | pibAttribute, |
uint8_t * | pValue | ||
) |
This direct execute function retrieves an attribute value from the MAC Frequency Hopping PIB.
pibAttribute | - The attribute identifier |
pValue | - pointer to the attribute value |
ApiMac_status_t ApiMac_mlmeGetFhReqUint16 | ( | ApiMac_FHAttribute_uint16_t | pibAttribute, |
uint16_t * | pValue | ||
) |
This direct execute function retrieves an attribute value from the MAC Frequency Hopping PIB.
pibAttribute | - The attribute identifier |
pValue | - pointer to the attribute value |
ApiMac_status_t ApiMac_mlmeGetFhReqUint32 | ( | ApiMac_FHAttribute_uint32_t | pibAttribute, |
uint32_t * | pValue | ||
) |
This direct execute function retrieves an attribute value from the MAC Frequency Hopping PIB.
pibAttribute | - The attribute identifier |
pValue | - pointer to the attribute value |
ApiMac_status_t ApiMac_mlmeGetFhReqArray | ( | ApiMac_FHAttribute_array_t | pibAttribute, |
uint8_t * | pValue | ||
) |
This direct execute function retrieves an attribute value from the MAC Frequency Hopping PIB.
pibAttribute | - The attribute identifier |
pValue | - pointer to the attribute value |
ApiMac_status_t ApiMac_mlmeGetSecurityReqUint8 | ( | ApiMac_securityAttribute_uint8_t | pibAttribute, |
uint8_t * | pValue | ||
) |
This direct execute function retrieves an attribute value from the MAC Secutity PIB.
pibAttribute | - The attribute identifier |
pValue | - pointer to the attribute value |
ApiMac_status_t ApiMac_mlmeGetSecurityReqUint16 | ( | ApiMac_securityAttribute_uint16_t | pibAttribute, |
uint16_t * | pValue | ||
) |
This direct execute function retrieves an attribute value from the MAC Secutity PIB.
pibAttribute | - The attribute identifier |
pValue | - pointer to the attribute value |
ApiMac_status_t ApiMac_mlmeGetSecurityReqArray | ( | ApiMac_securityAttribute_array_t | pibAttribute, |
uint8_t * | pValue | ||
) |
This direct execute function retrieves an attribute value from the MAC Secutity PIB.
pibAttribute | - The attribute identifier |
pValue | - pointer to the attribute value |
ApiMac_status_t ApiMac_mlmeGetSecurityReqStruct | ( | ApiMac_securityAttribute_struct_t | pibAttribute, |
void * | pValue | ||
) |
This direct execute function retrieves an attribute value from the MAC Secutity PIB.
pibAttribute | - The attribute identifier |
pValue | - pointer to the attribute value |
ApiMac_status_t ApiMac_mlmeOrphanRsp | ( | ApiMac_mlmeOrphanRsp_t * | pData | ) |
This function is called in response to an orphan notification from a peer device. This function must be called after receiving an Orphan Indication Callback. When the orphan response is complete the Comm Status Indication Callback is called to indicate the success or failure of the operation.
pData | - Pointer to parameters structure. |
ApiMac_status_t ApiMac_mlmePollReq | ( | ApiMac_mlmePollReq_t * | pData | ) |
This function is used to request pending data from the coordinator. When the poll request is complete the Poll Confirm Callback is called. If a data frame of nonzero length is received from the coordinator the Poll Confirm Callback has a status ApiMac_status_success and then calls the Data Indication Callback for the received data.
pData | - Pointer to parameters structure. |
ApiMac_status_t ApiMac_mlmeResetReq | ( | bool | setDefaultPib | ) |
This direct execute function resets the MAC. This function must be called once at system startup before any other function in the management API is called.
setDefaultPib | - Set to TRUE to reset the MAC PIB to its default values. |
ApiMac_status_t ApiMac_mlmeScanReq | ( | ApiMac_mlmeScanReq_t * | pData | ) |
This function initiates an energy detect, active, passive, or orphan scan on one or more channels. An energy detect scan measures the peak energy on each requested channel. An active scan sends a beacon request on each channel and then listening for beacons. A passive scan is a receive-only operation that listens for beacons on each channel. An orphan scan is used to locate the coordinator with which the scanning device had previously associated. When a scan operation is complete the Scan Confirm callback is called.
For active or passive scans the application sets the maxResults parameter the maximum number of PAN descriptors to return. If maxResults is greater than zero then the application must also set result.panDescriptor to point to a buffer of size maxResults * sizeof(ApiMac_panDesc_t) to store the results of the scan. The application must not access or deallocate this buffer until the Scan Confirm Callback is called. The MAC will store up to maxResults PAN descriptors and ignore duplicate beacons.
An alternative way to get results for an active or passive scan is to set maxResults to zero or set PIB attribute ApiMac_attribute_autoRequest to FALSE. Then the MAC will not store results but rather call the Beacon Notify Indication Callback" for each beacon received. The application will not need to supply any memory to store the scan results but the MAC will not filter out duplicate beacons.
For energy detect scans the application must set result.energyDetect to point to a buffer of size 18 bytes to store the results of the scan. The application must not access or deallocate this buffer until the Scan Confirm Callback is called.
An energy detect, active or passive scan may be performed at any time if a scan is not already in progress. However a device cannot perform any other MAC management operation or send or receive MAC data until the scan is complete.
pData | - Pointer to parameters structure. |
ApiMac_status_t ApiMac_mlmeSetReqBool | ( | ApiMac_attribute_bool_t | pibAttribute, |
bool | value | ||
) |
This direct execute function sets an attribute value in the MAC PIB.
pibAttribute | - The attribute identifier |
value | - the attribute value |
ApiMac_status_t ApiMac_mlmeSetReqUint8 | ( | ApiMac_attribute_uint8_t | pibAttribute, |
uint8_t | value | ||
) |
This direct execute function sets an attribute value in the MAC PIB.
pibAttribute | - The attribute identifier |
value | - the attribute value |
ApiMac_status_t ApiMac_mlmeSetReqUint16 | ( | ApiMac_attribute_uint16_t | pibAttribute, |
uint16_t | value | ||
) |
This direct execute function sets an attribute value in the MAC PIB.
pibAttribute | - The attribute identifier |
value | - the attribute value |
ApiMac_status_t ApiMac_mlmeSetReqUint32 | ( | ApiMac_attribute_uint32_t | pibAttribute, |
uint32_t | value | ||
) |
This direct execute function sets an attribute value in the MAC PIB.
pibAttribute | - The attribute identifier |
value | - the attribute value |
ApiMac_status_t ApiMac_mlmeSetReqArray | ( | ApiMac_attribute_array_t | pibAttribute, |
uint8_t * | pValue | ||
) |
This direct execute function sets an attribute value in the MAC PIB.
pibAttribute | - The attribute identifier |
pValue | - the attribute value |
ApiMac_status_t ApiMac_mlmeSetFhReqUint8 | ( | ApiMac_FHAttribute_uint8_t | pibAttribute, |
uint8_t | value | ||
) |
This direct execute function sets an attribute value in the MAC Frequency Hopping PIB.
pibAttribute | - The attribute identifier |
value | - the attribute value |
ApiMac_status_t ApiMac_mlmeSetFhReqUint16 | ( | ApiMac_FHAttribute_uint16_t | pibAttribute, |
uint16_t | value | ||
) |
This direct execute function sets an attribute value in the MAC Frequency Hopping PIB.
pibAttribute | - The attribute identifier |
value | - the attribute value |
ApiMac_status_t ApiMac_mlmeSetFhReqUint32 | ( | ApiMac_FHAttribute_uint32_t | pibAttribute, |
uint32_t | value | ||
) |
This direct execute function sets an attribute value in the MAC Frequency Hopping PIB.
pibAttribute | - The attribute identifier |
value | - the attribute value |
ApiMac_status_t ApiMac_mlmeSetFhReqArray | ( | ApiMac_FHAttribute_array_t | pibAttribute, |
uint8_t * | pValue | ||
) |
This direct execute function sets an attribute value in the MAC Frequency Hopping PIB.
pibAttribute | - The attribute identifier |
pValue | - pointer to the attribute value |
ApiMac_status_t ApiMac_mlmeSetSecurityReqUint8 | ( | ApiMac_securityAttribute_uint8_t | pibAttribute, |
uint8_t | value | ||
) |
This direct execute function sets an attribute value in the MAC Security PIB.
pibAttribute | - The attribute identifier |
value | - the attribute value |
ApiMac_status_t ApiMac_mlmeSetSecurityReqUint16 | ( | ApiMac_securityAttribute_uint16_t | pibAttribute, |
uint16_t | value | ||
) |
This direct execute function sets an attribute value in the MAC Security PIB.
pibAttribute | - The attribute identifier |
value | - the attribute value |
ApiMac_status_t ApiMac_mlmeSetSecurityReqArray | ( | ApiMac_securityAttribute_array_t | pibAttribute, |
uint8_t * | pValue | ||
) |
This direct execute function sets an attribute value in the MAC Security PIB.
pibAttribute | - The attribute identifier |
pValue | - pointer to the attribute value |
ApiMac_status_t ApiMac_mlmeSetSecurityReqStruct | ( | ApiMac_securityAttribute_struct_t | pibAttribute, |
void * | pValue | ||
) |
This direct execute function sets an attribute value in the MAC Security PIB.
pibAttribute | - The attribute identifier |
pValue | - pointer to the attribute value |
ApiMac_status_t ApiMac_mlmeStartReq | ( | ApiMac_mlmeStartReq_t * | pData | ) |
This function is called by a coordinator or PAN coordinator to start or reconfigure a network. Before starting a network the device must have set its short address. A PAN coordinator sets the short address by setting the attribute ApiMac_attribute_shortAddress. A coordinator sets the short address through association.
When parameter panCoordinator is TRUE, the MAC automatically sets attributes ApiMac_attribute_panID and ApiMac_attribute_logicalChannel to the panId and logicalChannel parameters. If panCoordinator is FALSE, these parameters are ignored (they would already be set through association).
The parameter beaconOrder controls whether the network is beacon-enabled or non beacon-enabled. For a beacon-enabled network this parameter also controls the beacon transmission interval.
When the operation is complete the Start Confirm Callback is called.
pData | - Pointer to parameters structure. |
ApiMac_status_t ApiMac_mlmeSyncReq | ( | ApiMac_mlmeSyncReq_t * | pData | ) |
This function requests the MAC to synchronize with the coordinator by acquiring and optionally tracking its beacons. Synchronizing with the coordinator is recommended before associating in a beacon-enabled network. If the beacon could not be located on its initial search or during tracking, the MAC calls the Sync Loss Indication Callback with ApiMac_status_beaconLoss as the reason.
Before calling this function the application must set PIB attributes ApiMac_attribute_beaconOrder, ApiMac_attribute_panId and either ApiMac_attribute_coordShortAddress or ApiMac_attribute_coordExtendedAddress to the address of the coordinator with which to synchronize.
The application may wish to set PIB attribute ApiMac_attribute_autoRequest to FALSE before calling this function. Then when the MAC successfully synchronizes with the coordinator it will call the Beacon Notify Indication Callback". After receiving the callback the application may set ApiMac_attribute_autoRequest to TRUE to stop receiving beacon notifications.
This function is only applicable to beacon-enabled networks.
pData | - Pointer to parameters structure. |
uint8_t ApiMac_randomByte | ( | void | ) |
This function returns a random byte from the MAC random number generator.
ApiMac_status_t ApiMac_updatePanId | ( | uint16_t | panId | ) |
Update Device Table entry and PIB with new Pan Id.
panId | - the new Pan ID |
ApiMac_status_t ApiMac_mlmeWSAsyncReq | ( | ApiMac_mlmeWSAsyncReq_t * | pData | ) |
This functions handles a WiSUN async request. The possible operation is Async Start or Async Stop. For the async start operation, the caller of this function can indicate which WiSUN async frame type to be sent on the specified channels.
pData | pointer to the asynchronous parameters structure |
ApiMac_status_t ApiMac_startFH | ( | void | ) |
This function starts the frequency hopping. Frequency hopping operation should have been enabled using ApiMac_enableFH() before calling this API. No need to call this API if you have called ApiMac_mlmeStartReq() with the startFH field set to true.
ApiMac_status_t ApiMac_parsePayloadGroupIEs | ( | uint8_t * | pPayload, |
uint16_t | payloadLen, | ||
ApiMac_payloadIeRec_t ** | pList | ||
) |
Parses the Group payload information element. This function creates a linked list (plist) from the Payload IE (pPayload). Each item in the linked list is a seperate Group IE with its own content.
If no IEs are found pList will be set to NULL.
The caller is responsible to release the memory for the linked list by calling ApiMac_freeIEList().
Call this function to create the list of Group IEs, then call ApiMac_parsePayloadSubIEs() to parse each of the group IE's content into sub IEs.
pPayload | - pointer to the buffer with the payload IEs. |
payloadLen | - length of the buffer with the payload IEs. |
pList | - pointer to link list pointer. |
ApiMac_status_t ApiMac_parsePayloadSubIEs | ( | uint8_t * | pContent, |
uint16_t | contentLen, | ||
ApiMac_payloadIeRec_t ** | pList | ||
) |
Parses the payload sub information element. This function creates a linked list (pList) of sub IEs from the Group IE content (pContent). Each item in the linked list is a seperate sub IE with its own content.
If no IEs are found pList will be set to NULL.
The caller is responsible to release the memory for the linked list by calling ApiMac_freeIEList().
Call this function after calling ApiMac_parsePayloadGroupIEs().
pContent | - pointer to the buffer with the sub IEs. |
contentLen | - length of the buffer with the payload IEs. |
pList | - pointer to link list pointer. |
void ApiMac_freeIEList | ( | ApiMac_payloadIeRec_t * | pList | ) |
Free the linked list allocated by ApiMac_parsePayloadGroupIEs() or ApiMac_parsePayloadSubIEs().
pList | - pointer to linked list |
ApiMac_status_t ApiMac_enableFH | ( | void | ) |
Enables the Frequency hopping operation. Make sure you call this function before setting any FH parameters or before calling ApiMac_mlmeStartReq() or ApiMac_startFH(), if you're using FH.
uint8_t ApiMac_convertCapabilityInfo | ( | ApiMac_capabilityInfo_t * | pMsgcapInfo | ) |
Convert ApiMac_capabilityInfo_t data type to uint8 capInfo.
pMsgcapInfo | - CapabilityInfo pointer |
void ApiMac_buildMsgCapInfo | ( | uint8_t | cInfo, |
ApiMac_capabilityInfo_t * | pPBcapInfo | ||
) |
Convert from bitmask byte to API MAC capInfo.
cInfo | - source |
pPBcapInfo | - destination |
ApiMac_status_t ApiMac_secAddDevice | ( | ApiMac_secAddDevice_t * | pAddDevice | ) |
Adds a new MAC device table entry.
pAddDevice | - Add device information |
ApiMac_status_t ApiMac_secDeleteDevice | ( | ApiMac_sAddrExt_t * | pExtAddr | ) |
Removes MAC device table entries.
pExtAddr | - extended address of the device table entries that shall be removed |
ApiMac_status_t ApiMac_secDeleteKeyAndAssocDevices | ( | uint8_t | keyIndex | ) |
Removes the key at the specified key Index and removes all MAC device table enteries associated with this key. Also removes(initializes) the key lookup list associated with this key.
keyIndex | - mac secuirty key table index of the key to be removed. |
ApiMac_status_t ApiMac_secDeleteAllDevices | ( | void | ) |
Removes all MAC device table entries.
ApiMac_status_t ApiMac_secGetDefaultSourceKey | ( | uint8_t | keyId, |
uint32_t * | pFrameCounter | ||
) |
Reads the frame counter value associated with a MAC security key indexed by the designated key identifier and the default key source.
keyId | - Key ID. |
pFrameCounter | - pointer to a buffer to store the outgoing frame counter of the key. |
ApiMac_status_t ApiMac_secAddKeyInitFrameCounter | ( | ApiMac_secAddKeyInitFrameCounter_t * | pInfo | ) |
Adds the MAC security key, adds the associated lookup list for the key, initializes the frame counter to the value provided. It also duplicates the device table enteries (associated with the previous key if any) if available based on the flag dupDevFlag value and associates the device descriptor with this key.
pInfo | - structure need to perform this function. |