TI-15.4 Stack API  4.20.00.14
Data Structures | Macros | Typedefs | Enumerations | Functions
api_mac.h File Reference
#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  ApiMac_sAddr_t
 
struct  _apimac_sdata
 
struct  _apimac_mrfskphydesc
 
struct  _apimac_sec
 
struct  _apimac_keyidlookupdescriptor
 
struct  _apimac_keydevicedescriptor
 
struct  _apimac_keyusagedescriptor
 
struct  _apimac_keydescriptor
 
struct  _apimac_devicedescriptor
 
struct  _apimac_securityleveldescriptor
 
struct  ApiMac_frameCntr_t
 
struct  _apimac_secdevicedescriptor
 
struct  _apimac_securitykeyentry
 
struct  _apimac_securitypibkeyidlookupentry
 
struct  _apimac_securitypibkeydeviceentry
 
struct  _apimac_securitypibkeyusageentry
 
struct  _apimac_securitypibkeyentry
 
struct  _apimac_securitypibdeviceentry
 
struct  _apimac_securitypiblevelentry
 
struct  _apimac_capabilityinfo
 
struct  _apimac_txoptions
 
struct  _apimac_mcpsdatareq
 
struct  _apimac_payloadieitem
 
struct  _apimac_payloadierec
 
struct  _apimac_mcpsdataind
 
struct  _apimac_mcpsdatacnf
 
struct  _apimac_mcpspurgecnf
 
struct  _apimac_pandesc
 
struct  _apimac_macmlmeassociatereq
 
struct  _apimac_mlmeassociatersp
 
struct  _apimac_mlmedisassociatereq
 
struct  _apimac_mlmeorphanrsp
 
struct  _apimac_mlmepollreq
 
struct  _apimac_mlmescanreq
 
struct  _apimac_mpmParams
 
struct  _apimac_mlmestartreq
 
struct  _apimac_mlmesyncreq
 
struct  _apimac_mlmewsasyncreq
 
struct  _apimac_secadddevice
 
struct  _apimac_secaddkeyinitframecounter
 
struct  _apimac_mlmeassociateind
 
struct  _apimac_mlmeassociatecnf
 
struct  _apimac_mlmedisassociateind
 
struct  _apimac_mlmediassociatecnf
 
struct  _apimac_beacondata
 
struct  _apimac_coexist
 
struct  _apimac_ebeacondata
 
struct  ApiMac_mlmeBeaconNotifyInd_t
 
struct  _apimac_mlmeorphanind
 
struct  _apimac_mlmescancnf
 
struct  _apimac_mlmestartcnf
 
struct  _apimac_mlmesynclossind
 
struct  _apimac_mlmepollcnf
 
struct  _apimac_mlmecommstatusind
 
struct  _apimac_mlmepollind
 
struct  _apimac_mlmewsasynccnf
 
struct  _apimac_callbacks
 

Macros

#define APIMAC_KEY_MAX_LEN   16
 
#define APIMAC_SADDR_EXT_LEN   8
 
#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
 
#define API_MAX_NODE_KEY_ENTRIES   MAX_NODE_KEY_ENTRIES
 
#define APIMAC_KEYID_IMPLICIT_LEN   0
 
#define APIMAC_KEYID_MODE1_LEN   1
 
#define APIMAC_KEYID_MODE4_LEN   5
 
#define APIMAC_KEYID_MODE8_LEN   9
 
#define APIMAC_KEY_SOURCE_MAX_LEN   8
 
#define APIMAC_KEY_INDEX_LEN   1
 
#define APIMAC_FRAME_COUNTER_LEN   4
 
#define APIMAC_KEY_LOOKUP_SHORT_LEN   5
 
#define APIMAC_KEY_LOOKUP_LONG_LEN   9
 
#define APIMAC_MAX_KEY_LOOKUP_LEN   APIMAC_KEY_LOOKUP_LONG_LEN
 
#define APIMAC_DATA_OFFSET   24
 
#define APIMAC_MAX_BEACON_PAYLOAD   16
 
#define APIMAC_MIC_32_LEN   4
 
#define APIMAC_MIC_64_LEN   8
 
#define APIMAC_MIC_128_LEN   16
 
#define APIMAC_MHR_LEN   37
 
#define APIMAC_CHANNEL_PAGE_9   9
 
#define APIMAC_CHANNEL_PAGE_10   10
 
#define APIMAC_CHANNEL_PAGE_NONE   0
 
#define APIMAC_STANDARD_PHY_DESCRIPTOR_ENTRIES   5
 
#define APIMAC_GENERIC_PHY_DESCRIPTOR_ENTRIES   10
 
#define APIMAC_50KBPS_915MHZ_PHY_1   1
 
#define APIMAC_50KBPS_868MHZ_PHY_3   3
 
#define APIMAC_50KBPS_433MHZ_PHY_128   128
 
#define APIMAC_5KBPS_915MHZ_PHY_129   129
 
#define APIMAC_5KBPS_433MHZ_PHY_130   130
 
#define APIMAC_5KBPS_868MHZ_PHY_131   131
 
#define APIMAC_200KBPS_915MHZ_PHY_132   132
 
#define APIMAC_200KBPS_868MHZ_PHY_133   133
 
#define APIMAC_250KBPS_IEEE_PHY_0   0
 
#define APIMAC_MRFSK_STD_PHY_ID_BEGIN   APIMAC_50KBPS_915MHZ_PHY_1
 
#define APIMAC_MRFSK_STD_PHY_ID_END   ( APIMAC_MRFSK_STD_PHY_ID_BEGIN + APIMAC_STANDARD_PHY_DESCRIPTOR_ENTRIES - 1 )
 
#define APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN   APIMAC_50KBPS_433MHZ_PHY_128
 
#define APIMAC_MRFSK_GENERIC_PHY_ID_END   ( APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN + APIMAC_GENERIC_PHY_DESCRIPTOR_ENTRIES - 1 )
 
#define APIMAC_PHY_DESCRIPTOR   0x01
 
#define APIMAC_NO_EXTENDER   0x00
 
#define APIMAC_HIGH_GAIN_MODE   0x01
 
#define APIMAC_DEFAULT_PA   0x00
 
#define APIMAC_HIGH_PA   0x01
 
#define APIMAC_ADDR_USE_EXT   0xFFFE
 
#define APIMAC_SHORT_ADDR_BROADCAST   0xFFFF
 
#define APIMAC_SHORT_ADDR_NONE   0xFFFF
 
#define APIMAC_RANDOM_SEED_LEN   32
 
#define APIMAC_FH_UTT_IE   0x00000002
 
#define APIMAC_FH_BT_IE   0x00000008
 
#define APIMAC_FH_US_IE   0x00010000
 
#define APIMAC_FH_BS_IE   0x00020000
 
#define APIMAC_FH_HEADER_IE_MASK   0x000000FF
 
#define APIMAC_FH_PROTO_DISPATCH_NONE   0x00
 
#define APIMAC_FH_PROTO_DISPATCH_MHD_PDU   0x01
 
#define APIMAC_FH_PROTO_DISPATCH_6LOWPAN   0x02
 
#define APIMAC_154G_MAX_NUM_CHANNEL   129
 
#define APIMAC_154G_CHANNEL_BITMAP_SIZ   ((APIMAC_154G_MAX_NUM_CHANNEL + 7) / 8)
 
#define APIMAC_HEADER_IE_MAX   2
 
#define APIMAC_PAYLOAD_IE_MAX   2
 
#define APIMAC_PAYLOAD_SUB_IE_MAX   4
 
#define APIMAC_SFS_BEACON_ORDER(s)   ((s) & 0x0F)
 
#define APIMAC_SFS_SUPERFRAME_ORDER(s)   (((s) >> 4) & 0x0F)
 
#define APIMAC_SFS_FINAL_CAP_SLOT(s)   (((s) >> 8) & 0x0F)
 
#define APIMAC_SFS_BLE(s)   (((s) >> 12) & 0x01)
 
#define APIMAC_SFS_PAN_COORDINATOR(s)   (((s) >> 14) & 0x01)
 
#define APIMAC_SFS_ASSOCIATION_PERMIT(s)   (((s) >> 15) & 0x01)
 
#define APIMAC_FH_MAX_BIT_MAP_SIZE   32
 
#define APIMAC_FH_NET_NAME_SIZE_MAX   32
 
#define APIMAC_FH_GTK_HASH_SIZE   8
 

Typedefs

typedef uint8_t ApiMac_sAddrExt_t[APIMAC_SADDR_EXT_LEN]
 
typedef struct _apimac_sdata ApiMac_sData_t
 
typedef struct _apimac_mrfskphydesc ApiMac_MRFSKPHYDesc_t
 
typedef struct _apimac_sec ApiMac_sec_t
 
typedef struct _apimac_keyidlookupdescriptor ApiMac_keyIdLookupDescriptor_t
 
typedef struct _apimac_keydevicedescriptor ApiMac_keyDeviceDescriptor_t
 
typedef struct _apimac_keyusagedescriptor ApiMac_keyUsageDescriptor_t
 
typedef struct _apimac_keydescriptor ApiMac_keyDescriptor_t
 
typedef struct _apimac_devicedescriptor ApiMac_deviceDescriptor_t
 
typedef struct _apimac_securityleveldescriptor ApiMac_securityLevelDescriptor_t
 
typedef struct _apimac_secdevicedescriptor ApiMac_securityDeviceDescriptor_t
 
typedef struct _apimac_securitykeyentry ApiMac_securityKeyEntry_t
 
typedef struct _apimac_securitypibkeyidlookupentry ApiMac_securityPibKeyIdLookupEntry_t
 
typedef struct _apimac_securitypibkeydeviceentry ApiMac_securityPibKeyDeviceEntry_t
 
typedef struct _apimac_securitypibkeyusageentry ApiMac_securityPibKeyUsageEntry_t
 
typedef struct _apimac_securitypibkeyentry ApiMac_securityPibKeyEntry_t
 
typedef struct _apimac_securitypibdeviceentry ApiMac_securityPibDeviceEntry_t
 
typedef struct _apimac_securitypiblevelentry ApiMac_securityPibSecurityLevelEntry_t
 
typedef struct _apimac_capabilityinfo ApiMac_capabilityInfo_t
 
typedef struct _apimac_txoptions ApiMac_txOptions_t
 
typedef struct _apimac_mcpsdatareq ApiMac_mcpsDataReq_t
 
typedef struct _apimac_payloadieitem ApiMac_payloadIeItem_t
 
typedef struct _apimac_payloadierec ApiMac_payloadIeRec_t
 
typedef struct _apimac_mcpsdataind ApiMac_mcpsDataInd_t
 
typedef struct _apimac_mcpsdatacnf ApiMac_mcpsDataCnf_t
 
typedef struct _apimac_mcpspurgecnf ApiMac_mcpsPurgeCnf_t
 
typedef struct _apimac_pandesc ApiMac_panDesc_t
 
typedef struct _apimac_macmlmeassociatereq ApiMac_mlmeAssociateReq_t
 
typedef struct _apimac_mlmeassociatersp ApiMac_mlmeAssociateRsp_t
 
typedef struct _apimac_mlmedisassociatereq ApiMac_mlmeDisassociateReq_t
 
typedef struct _apimac_mlmeorphanrsp ApiMac_mlmeOrphanRsp_t
 
typedef struct _apimac_mlmepollreq ApiMac_mlmePollReq_t
 
typedef struct _apimac_mlmescanreq ApiMac_mlmeScanReq_t
 
typedef struct _apimac_mpmParams ApiMac_mpmParams_t
 
typedef struct _apimac_mlmestartreq ApiMac_mlmeStartReq_t
 
typedef struct _apimac_mlmesyncreq ApiMac_mlmeSyncReq_t
 
typedef struct _apimac_mlmewsasyncreq ApiMac_mlmeWSAsyncReq_t
 
typedef struct _apimac_secadddevice ApiMac_secAddDevice_t
 
typedef struct _apimac_secaddkeyinitframecounter ApiMac_secAddKeyInitFrameCounter_t
 
typedef struct _apimac_mlmeassociateind ApiMac_mlmeAssociateInd_t
 
typedef struct _apimac_mlmeassociatecnf ApiMac_mlmeAssociateCnf_t
 
typedef struct _apimac_mlmedisassociateind ApiMac_mlmeDisassociateInd_t
 
typedef struct _apimac_mlmediassociatecnf ApiMac_mlmeDisassociateCnf_t
 
typedef struct _apimac_beacondata ApiMac_beaconData_t
 
typedef struct _apimac_coexist ApiMac_coexist_t
 
typedef struct _apimac_ebeacondata ApiMac_eBeaconData_t
 
typedef struct _apimac_mlmeorphanind ApiMac_mlmeOrphanInd_t
 
typedef struct _apimac_mlmescancnf ApiMac_mlmeScanCnf_t
 
typedef struct _apimac_mlmestartcnf ApiMac_mlmeStartCnf_t
 
typedef struct _apimac_mlmesynclossind ApiMac_mlmeSyncLossInd_t
 
typedef struct _apimac_mlmepollcnf ApiMac_mlmePollCnf_t
 
typedef struct _apimac_mlmecommstatusind ApiMac_mlmeCommStatusInd_t
 
typedef struct _apimac_mlmepollind ApiMac_mlmePollInd_t
 
typedef ApiMac_mcpsDataInd_t ApiMac_mlmeWsAsyncInd_t
 
typedef struct _apimac_mlmewsasynccnf ApiMac_mlmeWsAsyncCnf_t
 
typedef void(* ApiMac_associateIndFp_t) (ApiMac_mlmeAssociateInd_t *pAssocInd)
 
typedef void(* ApiMac_associateCnfFp_t) (ApiMac_mlmeAssociateCnf_t *pAssocCnf)
 
typedef void(* ApiMac_disassociateIndFp_t) (ApiMac_mlmeDisassociateInd_t *pDisassociateInd)
 
typedef void(* ApiMac_disassociateCnfFp_t) (ApiMac_mlmeDisassociateCnf_t *pDisassociateCnf)
 
typedef void(* ApiMac_beaconNotifyIndFp_t) (ApiMac_mlmeBeaconNotifyInd_t *pBeaconNotifyInd)
 
typedef void(* ApiMac_orphanIndFp_t) (ApiMac_mlmeOrphanInd_t *pOrphanInd)
 
typedef void(* ApiMac_scanCnfFp_t) (ApiMac_mlmeScanCnf_t *pScanCnf)
 
typedef void(* ApiMac_startCnfFp_t) (ApiMac_mlmeStartCnf_t *pStartCnf)
 
typedef void(* ApiMac_syncLossIndFp_t) (ApiMac_mlmeSyncLossInd_t *pSyncLossInd)
 
typedef void(* ApiMac_pollCnfFp_t) (ApiMac_mlmePollCnf_t *pPollCnf)
 
typedef void(* ApiMac_commStatusIndFp_t) (ApiMac_mlmeCommStatusInd_t *pCommStatus)
 
typedef void(* ApiMac_pollIndFp_t) (ApiMac_mlmePollInd_t *pPollInd)
 
typedef void(* ApiMac_dataCnfFp_t) (ApiMac_mcpsDataCnf_t *pDataCnf)
 
typedef void(* ApiMac_dataIndFp_t) (ApiMac_mcpsDataInd_t *pDataInd)
 
typedef void(* ApiMac_purgeCnfFp_t) (ApiMac_mcpsPurgeCnf_t *pPurgeCnf)
 
typedef void(* ApiMac_wsAsyncIndFp_t) (ApiMac_mlmeWsAsyncInd_t *pWsAsyncInd)
 
typedef void(* ApiMac_wsAsyncCnfFp_t) (ApiMac_mlmeWsAsyncCnf_t *pWsAsyncCnf)
 
typedef void(* ApiMac_unprocessedFp_t) (uint16_t param1, uint16_t param2, void *pMsg)
 
typedef struct _apimac_callbacks ApiMac_callbacks_t
 

Enumerations

enum  ApiMac_assocStatus_t { ApiMac_assocStatus_success = 0, ApiMac_assocStatus_panAtCapacity = 1, ApiMac_assocStatus_panAccessDenied = 2 }
 
enum  ApiMac_addrType_t { ApiMac_addrType_none = 0, ApiMac_addrType_short = 2, ApiMac_addrType_extended = 3 }
 
enum  ApiMac_beaconType_t { ApiMac_beaconType_normal = 0, ApiMac_beaconType_enhanced = 1 }
 
enum  ApiMac_disassocateReason_t { ApiMac_disassocateReason_coord = 1, ApiMac_disassocateReason_device = 2 }
 
enum  ApiMac_commStatusReason_t { ApiMac_commStatusReason_assocRsp = 0, ApiMac_commStatusReason_orphanRsp = 1, ApiMac_commStatusReason_rxSecure = 2 }
 
enum  ApiMac_status_t {
  ApiMac_status_success = 0, ApiMac_status_subSystemError = 0x25, ApiMac_status_commandIDError = 0x26, ApiMac_status_lengthError = 0x27,
  ApiMac_status_unsupportedType = 0x28, ApiMac_status_autoAckPendingAllOn = 0xFE, ApiMac_status_autoAckPendingAllOff = 0xFF, ApiMac_status_beaconLoss = 0xE0,
  ApiMac_status_channelAccessFailure = 0xE1, ApiMac_status_counterError = 0xDB, ApiMac_status_denied = 0xE2, ApiMac_status_disabledTrxFailure = 0xE3,
  ApiMac_status_frameTooLong = 0xE5, ApiMac_status_improperKeyType = 0xDC, ApiMac_status_improperSecurityLevel = 0xDD, ApiMac_status_invalidAddress = 0xF5,
  ApiMac_status_invalidGts = 0xE6, ApiMac_status_invalidHandle = 0xE7, ApiMac_status_invalidIndex = 0xF9, ApiMac_status_invalidParameter = 0xE8,
  ApiMac_status_limitReached = 0xFA, ApiMac_status_noAck = 0xE9, ApiMac_status_noBeacon = 0xEA, ApiMac_status_noData = 0xEB,
  ApiMac_status_noShortAddress = 0xEC, ApiMac_status_onTimeTooLong = 0xF6, ApiMac_status_outOfCap = 0xED, ApiMac_status_panIdConflict = 0xEE,
  ApiMac_status_pastTime = 0xF7, ApiMac_status_readOnly = 0xFB, ApiMac_status_realignment = 0xEF, ApiMac_status_scanInProgress = 0xFC,
  ApiMac_status_securityError = 0xE4, ApiMac_status_superframeOverlap = 0xFD, ApiMac_status_trackingOff = 0xF8, ApiMac_status_transactionExpired = 0xF0,
  ApiMac_status_transactionOverflow = 0xF1, ApiMac_status_txActive = 0xF2, ApiMac_status_unavailableKey = 0xF3, ApiMac_status_unsupportedAttribute = 0xF4,
  ApiMac_status_unsupportedLegacy = 0xDE, ApiMac_status_unsupportedSecurity = 0xDF, ApiMac_status_unsupported = 0x18, ApiMac_status_badState = 0x19,
  ApiMac_status_noResources = 0x1A, ApiMac_status_ackPending = 0x1B, ApiMac_status_noTime = 0x1C, ApiMac_status_txAborted = 0x1D,
  ApiMac_status_duplicateEntry = 0x1E, ApiMac_status_fhError = 0x61, ApiMac_status_fhIeNotSupported = 0x62, ApiMac_status_fhNotInAsync = 0x63,
  ApiMac_status_fhNotInNeighborTable = 0x64, ApiMac_status_fhOutSlot = 0x65, ApiMac_status_fhInvalidAddress = 0x66, ApiMac_status_fhIeFormatInvalid = 0x67,
  ApiMac_status_fhPibNotSupported = 0x68, ApiMac_status_fhPibReadOnly = 0x69, ApiMac_status_fhPibInvalidParameter = 0x6A, ApiMac_status_fhInvalidFrameType = 0x6B,
  ApiMac_status_fhExpiredNode = 0x6C, ApiMac_status_fhNoPatch = 0x6D
}
 
enum  ApiMac_secLevel_t {
  ApiMac_secLevel_none = 0, ApiMac_secLevel_mic32 = 1, ApiMac_secLevel_mic64 = 2, ApiMac_secLevel_mic128 = 3,
  ApiMac_secLevel_enc = 4, ApiMac_secLevel_encMic32 = 5, ApiMac_secLevel_encMic64 = 6, ApiMac_secLevel_encMic128 = 7
}
 
enum  ApiMac_keyIdMode_t { ApiMac_keyIdMode_implicit = 0, ApiMac_keyIdMode_1 = 1, ApiMac_keyIdMode_4 = 2, ApiMac_keyIdMode_8 = 3 }
 
enum  ApiMac_attribute_bool_t {
  ApiMac_attribute_associatePermit = 0x41, ApiMac_attribute_autoRequest = 0x42, ApiMac_attribute_battLifeExt = 0x43, ApiMac_attribute_gtsPermit = 0x4D,
  ApiMac_attribute_promiscuousMode = 0x51, ApiMac_attribute_RxOnWhenIdle = 0x52, ApiMac_attribute_associatedPanCoord = 0x56, ApiMac_attribute_timestampSupported = 0x5C,
  ApiMac_attribute_securityEnabled = 0x5D, ApiMac_attribute_includeMPMIE = 0x62, ApiMac_attribute_fcsType = 0xE9
}
 
enum  ApiMac_attribute_uint8_t {
  ApiMac_attribute_ackWaitDuration = 0x40, ApiMac_attribute_battLifeExtPeriods = 0x44, ApiMac_attribute_beaconPayloadLength = 0x46, ApiMac_attribute_beaconOrder = 0x47,
  ApiMac_attribute_bsn = 0x49, ApiMac_attribute_dsn = 0x4C, ApiMac_attribute_maxCsmaBackoffs = 0x4E, ApiMac_attribute_backoffExponent = 0x4F,
  ApiMac_attribute_superframeOrder = 0x54, ApiMac_attribute_maxBackoffExponent = 0x57, ApiMac_attribute_maxFrameRetries = 0x59, ApiMac_attribute_responseWaitTime = 0x5A,
  ApiMac_attribute_syncSymbolOffset = 0x5B, ApiMac_attribute_eBeaconSequenceNumber = 0x5E, ApiMac_attribute_eBeaconOrder = 0x5F, ApiMac_attribute_offsetTimeslot = 0x61,
  ApiMac_attribute_phyTransmitPowerSigned = 0xE0, ApiMac_attribute_logicalChannel = 0xE1, ApiMac_attribute_altBackoffExponent = 0xE3, ApiMac_attribute_deviceBeaconOrder = 0xE4,
  ApiMac_attribute_rf4cePowerSavings = 0xE5, ApiMac_attribute_frameVersionSupport = 0xE6, ApiMac_attribute_channelPage = 0xE7, ApiMac_attribute_phyCurrentDescriptorId = 0xE8,
  ApiMac_attribute_rssiThreshold = 0xF4, ApiMac_attribute_rangeExtender = 0xF5, ApiMac_attribute_enDataAckPending = 0xF6, ApiMac_attribute_rfFreq = 0xF7,
  ApiMac_attribute_paType = 0xF8
}
 
enum  ApiMac_attribute_uint16_t {
  ApiMac_attribute_coordShortAddress = 0x4B, ApiMac_attribute_panId = 0x50, ApiMac_attribute_shortAddress = 0x53, ApiMac_attribute_transactionPersistenceTime = 0x55,
  ApiMac_attribute_maxFrameTotalWaitTime = 0x58, ApiMac_attribute_eBeaconOrderNBPAN = 0x60
}
 
enum  ApiMac_attribute_uint32_t {
  ApiMac_attribute_beaconTxTime = 0x48, ApiMac_attribute_diagRxCrcPass = 0xEA, ApiMac_attribute_diagRxCrcFail = 0xEB, ApiMac_attribute_diagRxBroadcast = 0xEC,
  ApiMac_attribute_diagTxBroadcast = 0xED, ApiMac_attribute_diagRxUnicast = 0xEE, ApiMac_attribute_diagTxUnicast = 0xEF, ApiMac_attribute_diagTxUnicastRetry = 0xF0,
  ApiMac_attribute_diagTxUnicastFail = 0xF1, ApiMac_attribute_diagRxSecureFail = 0xF2, ApiMac_attribute_diagTxSecureFail = 0xF3
}
 
enum  ApiMac_attribute_array_t { ApiMac_attribute_beaconPayload = 0x45, ApiMac_attribute_coordExtendedAddress = 0x4A, ApiMac_attribute_extendedAddress = 0xE2 }
 
enum  ApiMac_securityAttribute_uint8_t { ApiMac_securityAttribute_securityLevelTableEntries = 0x83, ApiMac_securityAttribute_autoRequestSecurityLevel = 0x85, ApiMac_securityAttribute_autoRequestKeyIdMode = 0x86, ApiMac_securityAttribute_autoRequestKeyIndex = 0x88 }
 
enum  ApiMac_securityAttribute_uint16_t { ApiMac_securityAttribute_keyTableEntries = 0x81, ApiMac_securityAttribute_deviceTableEntries = 0x82, ApiMac_securityAttribute_panCoordShortAddress = 0x8B }
 
enum  ApiMac_securityAttribute_array_t { ApiMac_securityAttribute_autoRequestKeySource = 0x87, ApiMac_securityAttribute_defaultKeySource = 0x89, ApiMac_securityAttribute_panCoordExtendedAddress = 0x8A }
 
enum  ApiMac_securityAttribute_struct_t {
  ApiMac_securityAttribute_keyTable = 0x71, ApiMac_securityAttribute_keyIdLookupEntry = 0xD0, ApiMac_securityAttribute_keyDeviceEntry = 0xD1, ApiMac_securityAttribute_keyUsageEntry = 0xD2,
  ApiMac_securityAttribute_keyEntry = 0xD3, ApiMac_securityAttribute_deviceEntry = 0xD4, ApiMac_securityAttribute_securityLevelEntry = 0xD5
}
 
enum  ApiMac_FHAttribute_uint8_t {
  ApiMac_FHAttribute_unicastDwellInterval = 0x2004, ApiMac_FHAttribute_broadcastDwellInterval = 0x2005, ApiMac_FHAttribute_clockDrift = 0x2006, ApiMac_FHAttribute_timingAccuracy = 0x2007,
  ApiMac_FHAttribute_unicastChannelFunction = 0x2008, ApiMac_FHAttribute_broadcastChannelFunction = 0x2009, ApiMac_FHAttribute_useParentBSIE = 0x200A, ApiMac_FHAttribute_routingCost = 0x200F,
  ApiMac_FHAttribute_routingMethod = 0x2010, ApiMac_FHAttribute_eapolReady = 0x2011, ApiMac_FHAttribute_fanTPSVersion = 0x2012, ApiMac_FHAttribute_CsmaBaseBacoff = 0x201A
}
 
enum  ApiMac_FHAttribute_uint16_t {
  ApiMac_FHAttribute_broadcastSchedId = 0x200B, ApiMac_FHAttribute_unicastFixedChannel = 0x200C, ApiMac_FHAttribute_broadcastFixedChannel = 0x200D, ApiMac_FHAttribute_panSize = 0x200E,
  ApiMac_FHAttribute_panVersion = 0x2014, ApiMac_FHAttribute_neighborValidTime = 0x2019, ApiMac_FHAttribute_numNonSleepDevice = 0x201b, ApiMac_FHAttribute_numSleepDevice = 0x201c,
  ApiMac_FHAttribute_numTempTableNode = 0x201d
}
 
enum  ApiMac_FHAttribute_uint32_t { ApiMac_FHAttribute_BCInterval = 0x2001 }
 
enum  ApiMac_FHAttribute_array_t {
  ApiMac_FHAttribute_trackParentEUI = 0x2000, ApiMac_FHAttribute_unicastExcludedChannels = 0x2002, ApiMac_FHAttribute_broadcastExcludedChannels = 0x2003, ApiMac_FHAttribute_netName = 0x2013,
  ApiMac_FHAttribute_gtk0Hash = 0x2015, ApiMac_FHAttribute_gtk1Hash = 0x2016, ApiMac_FHAttribute_gtk2Hash = 0x2017, ApiMac_FHAttribute_gtk3Hash = 0x2018
}
 
enum  ApiMac_fhFrameType_t {
  ApiMac_fhFrameType_panAdvert = 0x00, ApiMac_fhFrameType_panAdvertSolicit = 0x01, ApiMac_fhFrameType_config = 0x02, ApiMac_fhFrameType_configSolicit = 0x03,
  ApiMac_fhFrameType_data = 0x04, ApiMac_fhFrameType_ack = 0x05, ApiMac_fhFrameType_eapol = 0x06, ApiMac_fhFrameType_invalid = 0xFF
}
 
enum  ApiMac_payloadIEGroup_t { ApiMac_payloadIEGroup_ESDU = 0x00, ApiMac_payloadIEGroup_MLME = 0x01, ApiMac_payloadIEGroup_WiSUN = 0x04, ApiMac_payloadIEGroup_term = 0x0F }
 
enum  ApiMac_MLMESubIE_t { ApiMac_MLMESubIE_coexist = 0x21, ApiMac_MLMESubIE_sunDevCap = 0x22, ApiMac_MLMESubIE_sunFSKGenPhy = 0x23 }
 
enum  ApiMac_wisunSubIE_t {
  ApiMac_wisunSubIE_USIE = 1, ApiMac_wisunSubIE_BSIE = 2, ApiMac_wisunSubIE_PANIE = 4, ApiMac_wisunSubIE_netNameIE = 5,
  ApiMac_wisunSubIE_PANVersionIE = 6, ApiMac_wisunSubIE_GTKHashIE = 7
}
 
enum  ApiMac_scantype_t {
  ApiMac_scantype_energyDetect = 0, ApiMac_scantype_active = 1, ApiMac_scantype_passive = 2, ApiMac_scantype_orphan = 3,
  ApiMac_scantype_activeEnhanced = 5
}
 
enum  ApiMac_wisunAsycnOperation_t { ApiMac_wisunAsycnOperation_start = 0, ApiMac_wisunAsycnOperation_stop = 1 }
 
enum  ApiMac_wisunAsyncFrame_t { ApiMac_wisunAsyncFrame_advertisement = 0, ApiMac_wisunAsyncFrame_advertisementSolicit = 1, ApiMac_wisunAsyncFrame_config = 2, ApiMac_wisunAsyncFrame_configSolicit = 3 }
 
enum  ApiMac_fhDispatchType_t { ApiMac_fhDispatchType_none = 0, ApiMac_fhDispatchType_MHD_PDU = 1, ApiMac_fhDispatchType_6LowPAN = 2 }
 

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...
 

Macro Definition Documentation

§ APIMAC_KEY_MAX_LEN

#define APIMAC_KEY_MAX_LEN   16

Key Length

§ APIMAC_SADDR_EXT_LEN

#define APIMAC_SADDR_EXT_LEN   8

IEEE Address Length

§ MAX_KEY_TABLE_ENTRIES

#define MAX_KEY_TABLE_ENTRIES   2

§ MAX_SECURITY_LEVEL_TABLE_ENTRIES

#define MAX_SECURITY_LEVEL_TABLE_ENTRIES   2

§ MAX_KEY_ID_LOOKUP_ENTRIES

#define MAX_KEY_ID_LOOKUP_ENTRIES   1

§ MAX_KEY_DEVICE_TABLE_ENTRIES

#define MAX_KEY_DEVICE_TABLE_ENTRIES   MAX_DEVICE_TABLE_ENTRIES

§ MAX_NODE_KEY_ENTRIES

#define MAX_NODE_KEY_ENTRIES   1

§ MAX_KEY_USAGE_TABLE_ENTRIES

#define MAX_KEY_USAGE_TABLE_ENTRIES   2

§ APIMAC_MAX_KEY_TABLE_ENTRIES

#define APIMAC_MAX_KEY_TABLE_ENTRIES   MAX_KEY_TABLE_ENTRIES

Maximum number of key table entries

§ API_MAX_NODE_KEY_ENTRIES

#define API_MAX_NODE_KEY_ENTRIES   MAX_NODE_KEY_ENTRIES

Maximum number of keys/device

§ APIMAC_KEYID_IMPLICIT_LEN

#define APIMAC_KEYID_IMPLICIT_LEN   0

Key identifier field length - Implicit mode

§ APIMAC_KEYID_MODE1_LEN

#define APIMAC_KEYID_MODE1_LEN   1

Key identifier field length - mode 1

§ APIMAC_KEYID_MODE4_LEN

#define APIMAC_KEYID_MODE4_LEN   5

Key Identifier field length - mode 4

§ APIMAC_KEYID_MODE8_LEN

#define APIMAC_KEYID_MODE8_LEN   9

Key Identifier field length - mode 8

§ APIMAC_KEY_SOURCE_MAX_LEN

#define APIMAC_KEY_SOURCE_MAX_LEN   8

Key source maximum length in bytes

§ APIMAC_KEY_INDEX_LEN

#define APIMAC_KEY_INDEX_LEN   1

Key index length in bytes

§ APIMAC_FRAME_COUNTER_LEN

#define APIMAC_FRAME_COUNTER_LEN   4

Frame counter length in bytes

§ APIMAC_KEY_LOOKUP_SHORT_LEN

#define APIMAC_KEY_LOOKUP_SHORT_LEN   5

Key lookup data length in bytes - short length

§ APIMAC_KEY_LOOKUP_LONG_LEN

#define APIMAC_KEY_LOOKUP_LONG_LEN   9

Key lookup data length in bytes - long length

§ APIMAC_MAX_KEY_LOOKUP_LEN

#define APIMAC_MAX_KEY_LOOKUP_LEN   APIMAC_KEY_LOOKUP_LONG_LEN

Key lookup data length in bytes - lookup length

§ APIMAC_DATA_OFFSET

#define APIMAC_DATA_OFFSET   24

Bytes required for MAC header in data frame

§ APIMAC_MAX_BEACON_PAYLOAD

#define APIMAC_MAX_BEACON_PAYLOAD   16

Maximum length allowed for the beacon payload

§ APIMAC_MIC_32_LEN

#define APIMAC_MIC_32_LEN   4

Length required for MIC-32 authentication

§ APIMAC_MIC_64_LEN

#define APIMAC_MIC_64_LEN   8

Length required for MIC-64 authentication

§ APIMAC_MIC_128_LEN

#define APIMAC_MIC_128_LEN   16

Length required for MIC-128 authentication

§ APIMAC_MHR_LEN

#define APIMAC_MHR_LEN   37

MHR length for received frame

  • FCF (2) + Seq (1) + Addr Fields (20) + Security HDR (14)

§ APIMAC_CHANNEL_PAGE_9

#define APIMAC_CHANNEL_PAGE_9   9

Channel Page - standard-defined SUN PHY operating modes

§ APIMAC_CHANNEL_PAGE_10

#define APIMAC_CHANNEL_PAGE_10   10

Channel Page - MR-FSK Generic-PHY-defined PHY modes

§ APIMAC_CHANNEL_PAGE_NONE

#define APIMAC_CHANNEL_PAGE_NONE   0

Channel Page - none for IEEE modes

§ APIMAC_STANDARD_PHY_DESCRIPTOR_ENTRIES

#define APIMAC_STANDARD_PHY_DESCRIPTOR_ENTRIES   5

Maximum number of Standard PHY descriptor entries

§ APIMAC_GENERIC_PHY_DESCRIPTOR_ENTRIES

#define APIMAC_GENERIC_PHY_DESCRIPTOR_ENTRIES   10

Maximum number of Generic PHY descriptor entries

§ APIMAC_50KBPS_915MHZ_PHY_1

#define APIMAC_50KBPS_915MHZ_PHY_1   1

PHY IDs - 915MHz Frequency band operating mode # 1

§ APIMAC_50KBPS_868MHZ_PHY_3

#define APIMAC_50KBPS_868MHZ_PHY_3   3

868MHz Frequency band operating mode #1

§ APIMAC_50KBPS_433MHZ_PHY_128

#define APIMAC_50KBPS_433MHZ_PHY_128   128

433MHz Frequency band operating mode #1

§ APIMAC_5KBPS_915MHZ_PHY_129

#define APIMAC_5KBPS_915MHZ_PHY_129   129

PHY IDs - 915MHz LRM Frequency band operating mode # 1

§ APIMAC_5KBPS_433MHZ_PHY_130

#define APIMAC_5KBPS_433MHZ_PHY_130   130

433MHz LRM Frequency band operating mode #1

§ APIMAC_5KBPS_868MHZ_PHY_131

#define APIMAC_5KBPS_868MHZ_PHY_131   131

868MHz LRM Frequency band operating mode #1

§ APIMAC_200KBPS_915MHZ_PHY_132

#define APIMAC_200KBPS_915MHZ_PHY_132   132

PHY IDs - 915MHz Frequency band operating mode # 3

§ APIMAC_200KBPS_868MHZ_PHY_133

#define APIMAC_200KBPS_868MHZ_PHY_133   133

868MHz Frequency band operating mode #3

§ APIMAC_250KBPS_IEEE_PHY_0

#define APIMAC_250KBPS_IEEE_PHY_0   0

Channel Page - none for IEEE modes

§ APIMAC_MRFSK_STD_PHY_ID_BEGIN

#define APIMAC_MRFSK_STD_PHY_ID_BEGIN   APIMAC_50KBPS_915MHZ_PHY_1

PHY IDs - MRFSK Standard Phy ID start

§ APIMAC_MRFSK_STD_PHY_ID_END

#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

§ APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN

#define APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN   APIMAC_50KBPS_433MHZ_PHY_128

PHY IDs - MRFSK Generic Phy ID start

§ APIMAC_MRFSK_GENERIC_PHY_ID_END

#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

§ APIMAC_PHY_DESCRIPTOR

#define APIMAC_PHY_DESCRIPTOR   0x01

PHY descriptor table entry

§ APIMAC_NO_EXTENDER

#define APIMAC_NO_EXTENDER   0x00

Range Extender Mode disable high gain

§ APIMAC_HIGH_GAIN_MODE

#define APIMAC_HIGH_GAIN_MODE   0x01

Range Extender Mode enable high gain

§ APIMAC_DEFAULT_PA

#define APIMAC_DEFAULT_PA   0x00

High PA Type default PA

§ APIMAC_HIGH_PA

#define APIMAC_HIGH_PA   0x01

High PA Type high PA

§ APIMAC_ADDR_USE_EXT

#define APIMAC_ADDR_USE_EXT   0xFFFE

Special address value - Short address value indicating extended address is used

§ APIMAC_SHORT_ADDR_BROADCAST

#define APIMAC_SHORT_ADDR_BROADCAST   0xFFFF

Special address value - Broadcast short address

§ APIMAC_SHORT_ADDR_NONE

#define APIMAC_SHORT_ADDR_NONE   0xFFFF

Special address value - Short address when there is no short address

§ APIMAC_RANDOM_SEED_LEN

#define APIMAC_RANDOM_SEED_LEN   32

The length of the random seed is set for maximum requirement which is 32

§ APIMAC_FH_UTT_IE

#define APIMAC_FH_UTT_IE   0x00000002

Frequency Hopping UTT IE Selection Bit

§ APIMAC_FH_BT_IE

#define APIMAC_FH_BT_IE   0x00000008

Frequency Hopping BT IE Selection Bit

§ APIMAC_FH_US_IE

#define APIMAC_FH_US_IE   0x00010000

Frequency Hopping US IE Selection Bit

§ APIMAC_FH_BS_IE

#define APIMAC_FH_BS_IE   0x00020000

Frequency Hopping BS IE Selection Bit

§ APIMAC_FH_HEADER_IE_MASK

#define APIMAC_FH_HEADER_IE_MASK   0x000000FF

Frequency hopping header IE's mask

§ APIMAC_FH_PROTO_DISPATCH_NONE

#define APIMAC_FH_PROTO_DISPATCH_NONE   0x00

Frequency hopping Protocol dispatch values - Protocol dispatch none

§ APIMAC_FH_PROTO_DISPATCH_MHD_PDU

#define APIMAC_FH_PROTO_DISPATCH_MHD_PDU   0x01

Frequency hopping Protocol dispatch values - Protocol dispatch MHD-PDU

§ APIMAC_FH_PROTO_DISPATCH_6LOWPAN

#define APIMAC_FH_PROTO_DISPATCH_6LOWPAN   0x02

Frequency hopping Protocol dispatch values - Protocol dispatch 6LOWPAN

§ APIMAC_154G_MAX_NUM_CHANNEL

#define APIMAC_154G_MAX_NUM_CHANNEL   129

Maximum number of channels

§ APIMAC_154G_CHANNEL_BITMAP_SIZ

#define APIMAC_154G_CHANNEL_BITMAP_SIZ   ((APIMAC_154G_MAX_NUM_CHANNEL + 7) / 8)

Bitmap size to hold the channel list

§ APIMAC_HEADER_IE_MAX

#define APIMAC_HEADER_IE_MAX   2

Maximum number of header IEs

§ APIMAC_PAYLOAD_IE_MAX

#define APIMAC_PAYLOAD_IE_MAX   2

Maximum number of payload-IEs

§ APIMAC_PAYLOAD_SUB_IE_MAX

#define APIMAC_PAYLOAD_SUB_IE_MAX   4

Maximum number of sub-IEs

§ APIMAC_SFS_BEACON_ORDER

#define APIMAC_SFS_BEACON_ORDER (   s)    ((s) & 0x0F)

MACRO that returns the beacon order from the superframe specification

§ APIMAC_SFS_SUPERFRAME_ORDER

#define APIMAC_SFS_SUPERFRAME_ORDER (   s)    (((s) >> 4) & 0x0F)

MACRO that returns the superframe order from the superframe specification

§ APIMAC_SFS_FINAL_CAP_SLOT

#define APIMAC_SFS_FINAL_CAP_SLOT (   s)    (((s) >> 8) & 0x0F)

MACRO that returns the final CAP slot from the superframe specification

§ APIMAC_SFS_BLE

#define APIMAC_SFS_BLE (   s)    (((s) >> 12) & 0x01)

MACRO that returns the battery life extension bit from the superframe specification

§ APIMAC_SFS_PAN_COORDINATOR

#define APIMAC_SFS_PAN_COORDINATOR (   s)    (((s) >> 14) & 0x01)

MACRO that returns the PAN coordinator bit from the superframe specification

§ APIMAC_SFS_ASSOCIATION_PERMIT

#define APIMAC_SFS_ASSOCIATION_PERMIT (   s)    (((s) >> 15) & 0x01)

MACRO that returns the Associate Permit bit from the superframe specification

§ APIMAC_FH_MAX_BIT_MAP_SIZE

#define APIMAC_FH_MAX_BIT_MAP_SIZE   32

Max size of the Frequency Hopping Channel Map Size

§ APIMAC_FH_NET_NAME_SIZE_MAX

#define APIMAC_FH_NET_NAME_SIZE_MAX   32

Max size of the Frequency Hopping Network Name

§ APIMAC_FH_GTK_HASH_SIZE

#define APIMAC_FH_GTK_HASH_SIZE   8

Size of the Frequency Hopping GTK Hash Size

Typedef Documentation

§ ApiMac_sAddrExt_t

typedef uint8_t ApiMac_sAddrExt_t[APIMAC_SADDR_EXT_LEN]

Extended address

§ ApiMac_sData_t

typedef struct _apimac_sdata ApiMac_sData_t

Data buffer structure

§ ApiMac_MRFSKPHYDesc_t

Generic PHY Descriptor. We are using this structure for both Channel Page 9 and Channel Page 10.

§ ApiMac_sec_t

typedef struct _apimac_sec ApiMac_sec_t

Common security type

§ ApiMac_keyIdLookupDescriptor_t

Key ID Lookup Descriptor

§ ApiMac_keyDeviceDescriptor_t

Key Device Descriptor

§ ApiMac_keyUsageDescriptor_t

Key Usage Descriptor

§ ApiMac_keyDescriptor_t

Key Descriptor

§ ApiMac_deviceDescriptor_t

Device Descriptor

§ ApiMac_securityLevelDescriptor_t

Security Level Descriptor

§ ApiMac_securityDeviceDescriptor_t

Security Device Descriptor

§ ApiMac_securityKeyEntry_t

MAC key entry structure

§ ApiMac_securityPibKeyIdLookupEntry_t

Security PIB Key ID lookup entry for a Get/Set ApiMac_securityAttribute_keyIdLookupEntry

§ ApiMac_securityPibKeyDeviceEntry_t

Security PIB Key ID device entry for a Get/Set ApiMac_securityAttribute_keyDeviceEntry

§ ApiMac_securityPibKeyUsageEntry_t

Security PIB Key ID usage entry for a Get/Set ApiMac_securityAttribute_keyUsageEntry

§ ApiMac_securityPibKeyEntry_t

Security PIB Key entry for a Get/Set ApiMac_securityAttribute_keyEntry

§ ApiMac_securityPibDeviceEntry_t

Security PIB device entry for a Get/Set ApiMac_securityAttribute_deviceEntry

§ ApiMac_securityPibSecurityLevelEntry_t

Security PIB level entry for a Get/Set ApiMac_securityAttribute_securityLevelEntry

§ ApiMac_capabilityInfo_t

Structure defines the Capabilities Information bit field.

§ ApiMac_txOptions_t

Data Request Transmit Options

§ ApiMac_mcpsDataReq_t

MCPS data request type

§ ApiMac_payloadIeItem_t

Structure a Payload information Item

§ ApiMac_payloadIeRec_t

A Payload IE Link List record

§ ApiMac_mcpsDataInd_t

MCPS data indication type

§ ApiMac_mcpsDataCnf_t

MCPS data confirm type

§ ApiMac_mcpsPurgeCnf_t

MCPS purge confirm type

§ ApiMac_panDesc_t

PAN descriptor type

§ ApiMac_mlmeAssociateReq_t

MLME associate request type

§ ApiMac_mlmeAssociateRsp_t

MLME associate response type

§ ApiMac_mlmeDisassociateReq_t

MLME disassociate request type

§ ApiMac_mlmeOrphanRsp_t

MLME orphan response type

§ ApiMac_mlmePollReq_t

MLME poll request type

§ ApiMac_mlmeScanReq_t

MLME scan request type

§ ApiMac_mpmParams_t

MPM(Multi-PHY layer management) parameters

§ ApiMac_mlmeStartReq_t

MLME start request type

§ ApiMac_mlmeSyncReq_t

MAC_MlmeSyncReq type

§ ApiMac_mlmeWSAsyncReq_t

MLME WiSUN Async request type

§ ApiMac_secAddDevice_t

Structure to pass information to the ApiMac_secAddDevice().

§ ApiMac_secAddKeyInitFrameCounter_t

Structure to pass information to the ApiMac_secAddKeyInitFrameCounter().

§ ApiMac_mlmeAssociateInd_t

MAC_MLME_ASSOCIATE_IND type

§ ApiMac_mlmeAssociateCnf_t

MAC_MLME_ASSOCIATE_CNF type

§ ApiMac_mlmeDisassociateInd_t

MAC_MLME_DISASSOCIATE_IND type

§ ApiMac_mlmeDisassociateCnf_t

MAC_MLME_DISASSOCIATE_CNF type

§ ApiMac_beaconData_t

MAC Beacon data type

§ ApiMac_coexist_t

Coexistence Information element content type

§ ApiMac_eBeaconData_t

MAC Enhanced beacon data type

§ ApiMac_mlmeOrphanInd_t

MAC_MLME_ORPHAN_IND type

§ ApiMac_mlmeScanCnf_t

MAC_MLME_SCAN_CNF type

§ ApiMac_mlmeStartCnf_t

MAC_MLME_START_CNF type

§ ApiMac_mlmeSyncLossInd_t

MAC_MLME_SYNC_LOSS_IND type

§ ApiMac_mlmePollCnf_t

MAC_MLME_POLL_CNF type

§ ApiMac_mlmeCommStatusInd_t

MAC_MLME_COMM_STATUS_IND type

§ ApiMac_mlmePollInd_t

MAC_MLME_POLL_IND type

§ ApiMac_mlmeWsAsyncInd_t

MAC_MLME_WS_ASYNC_FRAME_IND type

§ ApiMac_mlmeWsAsyncCnf_t

MAC_MLME_WS_ASYNC_FRAME_CNF type

§ ApiMac_associateIndFp_t

typedef void(* ApiMac_associateIndFp_t) (ApiMac_mlmeAssociateInd_t *pAssocInd)

Associate Indication Callback function pointer prototype for the callback table

§ ApiMac_associateCnfFp_t

typedef void(* ApiMac_associateCnfFp_t) (ApiMac_mlmeAssociateCnf_t *pAssocCnf)

Assocate Confirmation Callback function pointer prototype for the callback table

§ ApiMac_disassociateIndFp_t

typedef void(* ApiMac_disassociateIndFp_t) (ApiMac_mlmeDisassociateInd_t *pDisassociateInd)

Disassociate Indication Callback function pointer prototype for the callback table

§ ApiMac_disassociateCnfFp_t

typedef void(* ApiMac_disassociateCnfFp_t) (ApiMac_mlmeDisassociateCnf_t *pDisassociateCnf)

Disassociate Confirm Callback function pointer prototype for the callback table

§ ApiMac_beaconNotifyIndFp_t

typedef void(* ApiMac_beaconNotifyIndFp_t) (ApiMac_mlmeBeaconNotifyInd_t *pBeaconNotifyInd)

Beacon Notify Indication Callback function pointer prototype for the callback table

§ ApiMac_orphanIndFp_t

typedef void(* ApiMac_orphanIndFp_t) (ApiMac_mlmeOrphanInd_t *pOrphanInd)

Orphan Indication Callback function pointer prototype for the callback table

§ ApiMac_scanCnfFp_t

typedef void(* ApiMac_scanCnfFp_t) (ApiMac_mlmeScanCnf_t *pScanCnf)

Scan Confirmation Callback function pointer prototype for the callback table

§ ApiMac_startCnfFp_t

typedef void(* ApiMac_startCnfFp_t) (ApiMac_mlmeStartCnf_t *pStartCnf)

Start Confirmation Callback function pointer prototype for the callback table

§ ApiMac_syncLossIndFp_t

typedef void(* ApiMac_syncLossIndFp_t) (ApiMac_mlmeSyncLossInd_t *pSyncLossInd)

Sync Loss Indication Callback function pointer prototype for the callback table

§ ApiMac_pollCnfFp_t

typedef void(* ApiMac_pollCnfFp_t) (ApiMac_mlmePollCnf_t *pPollCnf)

Poll Confirm Callback function pointer prototype for the callback table

§ ApiMac_commStatusIndFp_t

typedef void(* ApiMac_commStatusIndFp_t) (ApiMac_mlmeCommStatusInd_t *pCommStatus)

Comm Status Indication Callback function pointer prototype for the callback table

§ ApiMac_pollIndFp_t

typedef void(* ApiMac_pollIndFp_t) (ApiMac_mlmePollInd_t *pPollInd)

Poll Indication Callback function pointer prototype for the callback table

§ ApiMac_dataCnfFp_t

typedef void(* ApiMac_dataCnfFp_t) (ApiMac_mcpsDataCnf_t *pDataCnf)

Data Confirmation Callback function pointer prototype for the callback table

§ ApiMac_dataIndFp_t

typedef void(* ApiMac_dataIndFp_t) (ApiMac_mcpsDataInd_t *pDataInd)

Data Indication Callback function pointer prototype for the callback table

§ ApiMac_purgeCnfFp_t

typedef void(* ApiMac_purgeCnfFp_t) (ApiMac_mcpsPurgeCnf_t *pPurgeCnf)

Purge Confirmation Callback function pointer prototype for the callback table

§ ApiMac_wsAsyncIndFp_t

typedef void(* ApiMac_wsAsyncIndFp_t) (ApiMac_mlmeWsAsyncInd_t *pWsAsyncInd)

WiSUN Async Indication Callback function pointer prototype for the callback table

§ ApiMac_wsAsyncCnfFp_t

typedef void(* ApiMac_wsAsyncCnfFp_t) (ApiMac_mlmeWsAsyncCnf_t *pWsAsyncCnf)

WiSUN Async Confirmation Callback function pointer prototype for the callback table

§ ApiMac_unprocessedFp_t

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.

§ 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.

Enumeration Type Documentation

§ ApiMac_assocStatus_t

Associate Response status types

Enumerator
ApiMac_assocStatus_success 

Success, join allowed

ApiMac_assocStatus_panAtCapacity 

PAN at capacity

ApiMac_assocStatus_panAccessDenied 

PAN access denied

§ 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)

§ ApiMac_beaconType_t

Beacon types in the ApiMac_mlmeBeaconNotifyInd_t structure.

Enumerator
ApiMac_beaconType_normal 

normal beacon type

ApiMac_beaconType_enhanced 

enhanced beacon type

§ ApiMac_disassocateReason_t

Disassociate Reasons

Enumerator
ApiMac_disassocateReason_coord 

The coordinator wishes the device to disassociate

ApiMac_disassocateReason_device 

The device itself wishes to disassociate

§ ApiMac_commStatusReason_t

Comm Status Indication Reasons

Enumerator
ApiMac_commStatusReason_assocRsp 

Reason for comm status indication was in response to an Associate Response

ApiMac_commStatusReason_orphanRsp 

Reason for comm status indication was in response to an Orphan Response

ApiMac_commStatusReason_rxSecure 

Reason for comm status indication was result of recieving a secure frame

§ ApiMac_status_t

General MAC Status values

Enumerator
ApiMac_status_success 

Operation successful

ApiMac_status_subSystemError 

MAC Co-Processor only - Subsystem Error

ApiMac_status_commandIDError 

MAC Co-Processor only - Command ID error

ApiMac_status_lengthError 

MAC Co-Processor only - Length error

ApiMac_status_unsupportedType 

MAC Co-Processor only - Unsupported Extended Type

ApiMac_status_autoAckPendingAllOn 

The AUTOPEND pending all is turned on

ApiMac_status_autoAckPendingAllOff 

The AUTOPEND pending all is turned off

ApiMac_status_beaconLoss 

The beacon was lost following a synchronization request

ApiMac_status_channelAccessFailure 

The operation or data request failed because of activity on the channel

ApiMac_status_counterError 

The frame counter puportedly applied by the originator of the received frame is invalid

ApiMac_status_denied 

The MAC was not able to enter low power mode

ApiMac_status_disabledTrxFailure 

Unused

ApiMac_status_frameTooLong 

The received frame or frame resulting from an operation or data request is too long to be processed by the MAC

ApiMac_status_improperKeyType 

The key purportedly applied by the originator of the received frame is not allowed

ApiMac_status_improperSecurityLevel 

The security level purportedly applied by the originator of the received frame does not meet the minimum security level

ApiMac_status_invalidAddress 

The data request failed because neither the source address nor destination address parameters were present

ApiMac_status_invalidGts 

Unused

ApiMac_status_invalidHandle 

The purge request contained an invalid handle

ApiMac_status_invalidIndex 

Unused

ApiMac_status_invalidParameter 

The API function parameter is out of range

ApiMac_status_limitReached 

The scan terminated because the PAN descriptor storage limit was reached

ApiMac_status_noAck 

The operation or data request failed because no acknowledgement was received

ApiMac_status_noBeacon 

The scan request failed because no beacons were received or the orphan scan failed because no coordinator realignment was received

ApiMac_status_noData 

The associate request failed because no associate response was received or the poll request did not return any data

ApiMac_status_noShortAddress 

The short address parameter of the start request was invalid

ApiMac_status_onTimeTooLong 

Unused

ApiMac_status_outOfCap 

Unused

ApiMac_status_panIdConflict 

A PAN identifier conflict has been detected and communicated to the PAN coordinator

ApiMac_status_pastTime 

Unused

ApiMac_status_readOnly 

A set request was issued with a read-only identifier

ApiMac_status_realignment 

A coordinator realignment command has been received

ApiMac_status_scanInProgress 

The scan request failed because a scan is already in progress

ApiMac_status_securityError 

Cryptographic processing of the received secure frame failed

ApiMac_status_superframeOverlap 

The beacon start time overlapped the coordinator transmission time

ApiMac_status_trackingOff 

The start request failed because the device is not tracking the beacon of its coordinator

ApiMac_status_transactionExpired 

The associate response, disassociate request, or indirect data transmission failed because the peer device did not respond before the transaction expired or was purged

ApiMac_status_transactionOverflow 

The request failed because MAC data buffers are full

ApiMac_status_txActive 

Unused

ApiMac_status_unavailableKey 

The operation or data request failed because the security key is not available

ApiMac_status_unsupportedAttribute 

The set or get request failed because the attribute is not supported

ApiMac_status_unsupportedLegacy 

The received frame was secured with legacy security which is not supported

ApiMac_status_unsupportedSecurity 

The security of the received frame is not supported

ApiMac_status_unsupported 

The operation is not supported in the current configuration

ApiMac_status_badState 

The operation could not be performed in the current state

ApiMac_status_noResources 

The operation could not be completed because no memory resources were available

ApiMac_status_ackPending 

For internal use only

ApiMac_status_noTime 

For internal use only

ApiMac_status_txAborted 

For internal use only

ApiMac_status_duplicateEntry 

For internal use only - A duplicated entry is added to the source matching table

ApiMac_status_fhError 

Frequency Hopping - General error

ApiMac_status_fhIeNotSupported 

Frequency Hopping - IE is not supported

ApiMac_status_fhNotInAsync 

Frequency Hopping - There is no ASYNC message in the MAC TX queue

ApiMac_status_fhNotInNeighborTable 

Frequency Hopping - Destination address is not in neighbor table

ApiMac_status_fhOutSlot 

Frequency Hopping - Not in UC or BC dwell time slot

ApiMac_status_fhInvalidAddress 

Frequency Hopping - Invalid address

ApiMac_status_fhIeFormatInvalid 

Frequency Hopping - IE format is wrong

ApiMac_status_fhPibNotSupported 

Frequency Hopping - PIB is not supported

ApiMac_status_fhPibReadOnly 

Frequency Hopping - PIB is read only

ApiMac_status_fhPibInvalidParameter 

Frequency Hopping - PIB API invalid parameter

ApiMac_status_fhInvalidFrameType 

Frequency Hopping - Invalid frame type

ApiMac_status_fhExpiredNode 

Frequency Hopping - Expired node

ApiMac_status_fhNoPatch 

Frequency Hopping - No Patch Needed

§ ApiMac_secLevel_t

MAC Security Levels

Enumerator
ApiMac_secLevel_none 

No security is used

ApiMac_secLevel_mic32 

MIC-32 authentication is used

ApiMac_secLevel_mic64 

MIC-64 authentication is used

ApiMac_secLevel_mic128 

MIC-128 authentication is used

ApiMac_secLevel_enc 

AES encryption is used

ApiMac_secLevel_encMic32 

AES encryption and MIC-32 authentication are used

ApiMac_secLevel_encMic64 

AES encryption and MIC-64 authentication are used

ApiMac_secLevel_encMic128 

AES encryption and MIC-128 authentication are used

§ ApiMac_keyIdMode_t

Key Identifier Mode

Enumerator
ApiMac_keyIdMode_implicit 

Key is determined implicitly

ApiMac_keyIdMode_1 

Key is determined from the 1-byte key index

ApiMac_keyIdMode_4 

Key is determined from the 4-byte key index

ApiMac_keyIdMode_8 

Key is determined from the 8-byte key index

§ ApiMac_attribute_bool_t

Standard PIB Get and Set Attributes - size bool

Enumerator
ApiMac_attribute_associatePermit 

TRUE if a coordinator is currently allowing association

ApiMac_attribute_autoRequest 

TRUE if a device automatically sends a data request if its address is listed in the beacon frame

ApiMac_attribute_battLifeExt 

TRUE if battery life extension is enabled

ApiMac_attribute_gtsPermit 

TRUE if the PAN coordinator accepts GTS requests

ApiMac_attribute_promiscuousMode 

TRUE if the MAC is in promiscuous mode

ApiMac_attribute_RxOnWhenIdle 

TRUE if the MAC enables its receiver during idle periods

ApiMac_attribute_associatedPanCoord 

TRUE if the device is associated to the PAN coordinator

ApiMac_attribute_timestampSupported 

TRUE if the MAC supports RX and TX timestamps

ApiMac_attribute_securityEnabled 

TRUE if security is enabled

ApiMac_attribute_includeMPMIE 

TRUE if MPM IE needs to be included

ApiMac_attribute_fcsType 

FCS type

§ ApiMac_attribute_uint8_t

Standard PIB Get and Set Attributes - size uint8_t

Enumerator
ApiMac_attribute_ackWaitDuration 

The maximum number of symbols to wait for an acknowledgment frame

ApiMac_attribute_battLifeExtPeriods 

The number of backoff periods during which the receiver is enabled following a beacon in battery life extension mode

ApiMac_attribute_beaconPayloadLength 

The length in bytes of the beacon payload, the maximum value for this parameters is APIMAC_MAX_BEACON_PAYLOAD.

ApiMac_attribute_beaconOrder 

How often the coordinator transmits a beacon

ApiMac_attribute_bsn 

The beacon sequence number

ApiMac_attribute_dsn 

The data or MAC command frame sequence number

ApiMac_attribute_maxCsmaBackoffs 

The maximum number of backoffs the CSMA-CA algorithm will attempt before declaring a channel failure

ApiMac_attribute_backoffExponent 

The minimum value of the backoff exponent in the CSMA-CA algorithm. If this value is set to 0, collision avoidance is disabled during the first iteration of the algorithm. Also for the slotted version of the CSMA-CA algorithm with the battery life extension enabled, the minimum value of the backoff exponent will be at least 2

ApiMac_attribute_superframeOrder 

This specifies the length of the active portion of the superframe

ApiMac_attribute_maxBackoffExponent 

The maximum value of the backoff exponent in the CSMA-CA algorithm

ApiMac_attribute_maxFrameRetries 

The maximum number of retries allowed after a transmission failure

ApiMac_attribute_responseWaitTime 

The maximum number of symbols a device shall wait for a response command to be available following a request command in multiples of aBaseSuperframeDuration

ApiMac_attribute_syncSymbolOffset 

The timestamp offset from SFD in symbols

ApiMac_attribute_eBeaconSequenceNumber 

Enhanced beacon sequence number

ApiMac_attribute_eBeaconOrder 

Enhanced beacon order in a beacon enabled network

ApiMac_attribute_offsetTimeslot 

Offset time slot from the beacon

ApiMac_attribute_phyTransmitPowerSigned 

Duplicate transmit power attribute in signed (2's complement) dBm unit

ApiMac_attribute_logicalChannel 

The logical channel

ApiMac_attribute_altBackoffExponent 

alternate minimum backoff exponent

ApiMac_attribute_deviceBeaconOrder 

Device beacon order

ApiMac_attribute_rf4cePowerSavings 

valid values are true and false

ApiMac_attribute_frameVersionSupport 

Currently supports 0 and 1. If 0, frame Version is always 0 and set to 1 only for secure frames. If 1, frame version will be set to 1 only if packet len > 102 or for secure frames

ApiMac_attribute_channelPage 

Channel Page

ApiMac_attribute_phyCurrentDescriptorId 

PHY Descriptor ID, used to support channel page number and index into descriptor table

ApiMac_attribute_rssiThreshold 

RSSI threshold for CCA, expressed as a signed int with range -127 to 127

ApiMac_attribute_rangeExtender 

Range Extender Mode from 0 to 2

ApiMac_attribute_enDataAckPending 

enable Ack Pending for Data Pkts

ApiMac_attribute_rfFreq 

RF Freq Selection from 1 to 2

ApiMac_attribute_paType 

RF PA Selection from 0 to 1

§ ApiMac_attribute_uint16_t

Standard PIB Get and Set Attributes - size uint16_t

Enumerator
ApiMac_attribute_coordShortAddress 

The short address assigned to the coordinator with which the device is associated. A value of MAC_ADDR_USE_EXT indicates that the coordinator is using its extended address

ApiMac_attribute_panId 

The PAN identifier. If this value is 0xffff, the device is not associated

ApiMac_attribute_shortAddress 

The short address that the device uses to communicate in the PAN. If the device is a PAN coordinator, this value shall be set before calling MAC_StartReq(). Otherwise the value is allocated during association. Value MAC_ADDR_USE_EXT indicates that the device is associated but not using a short address

ApiMac_attribute_transactionPersistenceTime 

The maximum time in beacon intervals that a transaction is stored by a coordinator and indicated in the beacon

ApiMac_attribute_maxFrameTotalWaitTime 

The maximum number of CAP symbols in a beacon-enabled PAN, or symbols in a non beacon-enabled PAN, to wait for a frame intended as a response to a data request frame

ApiMac_attribute_eBeaconOrderNBPAN 

Enhanced beacon order in a non-beacon enabled network

§ ApiMac_attribute_uint32_t

Standard PIB Get and Set Attributes - size uint32_t

Enumerator
ApiMac_attribute_beaconTxTime 

The time the device transmitted its last beacon frame, in backoff period units

ApiMac_attribute_diagRxCrcPass 

Diagnostics PIB - Received CRC pass counter

ApiMac_attribute_diagRxCrcFail 

Diagnostics PIB - Received CRC fail counter

ApiMac_attribute_diagRxBroadcast 

Diagnostics PIB - Received broadcast counter

ApiMac_attribute_diagTxBroadcast 

Diagnostics PIB - Transmitted broadcast counter

ApiMac_attribute_diagRxUnicast 

Diagnostics PIB - Received unicast counter

ApiMac_attribute_diagTxUnicast 

Diagnostics PIB - Transmitted unicast counter

ApiMac_attribute_diagTxUnicastRetry 

Diagnostics PIB - Transmitted unicast retry counter

ApiMac_attribute_diagTxUnicastFail 

Diagnostics PIB - Transmitted unicast fail counter

ApiMac_attribute_diagRxSecureFail 

Diagnostics PIB - Received Security fail counter

ApiMac_attribute_diagTxSecureFail 

Diagnostics PIB - Transmit Security fail counter

§ ApiMac_attribute_array_t

Standard PIB Get and Set Attributes - these attributes are array of bytes

Enumerator
ApiMac_attribute_beaconPayload 

The contents of the beacon payload

ApiMac_attribute_coordExtendedAddress 

The extended address of the coordinator with which the device is associated

ApiMac_attribute_extendedAddress 

The extended address of the device

§ ApiMac_securityAttribute_uint8_t

Security PIB Get and Set Attributes - size uint8_t

Enumerator
ApiMac_securityAttribute_securityLevelTableEntries 

The number of entries in macSecurityLevelTable

ApiMac_securityAttribute_autoRequestSecurityLevel 

The security level used for automatic data requests

ApiMac_securityAttribute_autoRequestKeyIdMode 

The key identifier mode used for automatic data requests

ApiMac_securityAttribute_autoRequestKeyIndex 

The index of the key used for automatic data requests

§ ApiMac_securityAttribute_uint16_t

Security PIB Get and Set Attributes - size uint16_t

Enumerator
ApiMac_securityAttribute_keyTableEntries 

The number of entries in macKeyTable

ApiMac_securityAttribute_deviceTableEntries 

The number of entries in macDeviceTable

ApiMac_securityAttribute_panCoordShortAddress 

The 16-bit short address assigned to the PAN coordinator

§ ApiMac_securityAttribute_array_t

Security PIB Get and Set Attributes - array of bytes

Enumerator
ApiMac_securityAttribute_autoRequestKeySource 

The originator of the key used for automatic data requests

ApiMac_securityAttribute_defaultKeySource 

The originator of the default key used for key ID mode 0x01

ApiMac_securityAttribute_panCoordExtendedAddress 

The 64-bit address of the PAN coordinator

§ ApiMac_securityAttribute_struct_t

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.

§ ApiMac_FHAttribute_uint8_t

Frequency Hopping PIB Get and Set Attributes - size uint8_t

Enumerator
ApiMac_FHAttribute_unicastDwellInterval 

Duration of node's unicast slot (in milliseconds) - uint8_t

ApiMac_FHAttribute_broadcastDwellInterval 

Duration of node's broadcast slot (in milliseconds) - uint8_t

ApiMac_FHAttribute_clockDrift 

Clock drift in PPM - uint8_t

ApiMac_FHAttribute_timingAccuracy 

Timing accuracy in 10 microsecond resolution - uint8_t

ApiMac_FHAttribute_unicastChannelFunction 

Unicast channel hopping function - uint8_t

ApiMac_FHAttribute_broadcastChannelFunction 

Broadcast channel hopping function - uint8_t

ApiMac_FHAttribute_useParentBSIE 

Node is propagating parent's BS-IE - uint8_t

ApiMac_FHAttribute_routingCost 

Estimate of routing path ETX to the PAN coordinator - uint8_t

ApiMac_FHAttribute_routingMethod 

RPL(1), MHDS(0) - uint8_t

ApiMac_FHAttribute_eapolReady 

Node can accept EAPOL message - uint8_t

ApiMac_FHAttribute_fanTPSVersion 

Wi-SUN FAN version - uint8_t

ApiMac_FHAttribute_CsmaBaseBacoff 

Additional base wait time to sense target channel

§ ApiMac_FHAttribute_uint16_t

Frequency Hopping PIB Get and Set Attributes - size uint16_t

Enumerator
ApiMac_FHAttribute_broadcastSchedId 

Broadcast schedule ID for broadcast channel hopping sequence - uint16_t

ApiMac_FHAttribute_unicastFixedChannel 

Unicast channel number when no hopping - uint16_t

ApiMac_FHAttribute_broadcastFixedChannel 

Broadcast channel number when no hopping - uint16_t

ApiMac_FHAttribute_panSize 

Number of nodes in the PAN - uint16_t

ApiMac_FHAttribute_panVersion 

PAN version to notify PAN configuration changes - uint16_t

ApiMac_FHAttribute_neighborValidTime 

Time in min during which the node info considered as valid - uint16_t

ApiMac_FHAttribute_numNonSleepDevice 

Number of non-sleepy device - uint16_t

ApiMac_FHAttribute_numSleepDevice 

Number of sleepy device - uint16_t

ApiMac_FHAttribute_numTempTableNode 

Number of temp table node - uint16_t

§ ApiMac_FHAttribute_uint32_t

Frequency Hopping PIB Get and Set Attributes - size uint32_t

Enumerator
ApiMac_FHAttribute_BCInterval 

Time between start of two broadcast slots (in milliseconds) - uint32_t

§ ApiMac_FHAttribute_array_t

Frequency Hopping PIB Get and Set Attributes - array of bytes

Enumerator
ApiMac_FHAttribute_trackParentEUI 

The parent EUI address - ApiMac_sAddrExt_t

ApiMac_FHAttribute_unicastExcludedChannels 

Unicast excluded channels - APIMAC_FH_MAX_BIT_MAP_SIZE

ApiMac_FHAttribute_broadcastExcludedChannels 

Broadcast excluded channels - APIMAC_FH_MAX_BIT_MAP_SIZE

ApiMac_FHAttribute_netName 

Network Name - APIMAC_FH_NET_NAME_SIZE_MAX uint8_t

ApiMac_FHAttribute_gtk0Hash 

Low order 64 bits of SHA256 hash of GTK

ApiMac_FHAttribute_gtk1Hash 

Next low order 64 bits of SHA256 hash of GTK

ApiMac_FHAttribute_gtk2Hash 

Next low order 64 bits of SHA256 hash of GTK

ApiMac_FHAttribute_gtk3Hash 

Next low order 64 bits of SHA256 hash of GTK

§ ApiMac_fhFrameType_t

FH Frame Types

Enumerator
ApiMac_fhFrameType_panAdvert 

WiSUN PAN advertisement

ApiMac_fhFrameType_panAdvertSolicit 

WiSUN PAN advertisement solicit

ApiMac_fhFrameType_config 

WiSUN PAN config

ApiMac_fhFrameType_configSolicit 

WiSUN PAN config solicit

ApiMac_fhFrameType_data 

WiSUN Data frame

ApiMac_fhFrameType_ack 

WiSUN Ack frame

ApiMac_fhFrameType_eapol 

WiSUN Ack frame

ApiMac_fhFrameType_invalid 

Internal: WiSUN Invalid frame

§ ApiMac_payloadIEGroup_t

Payload IE Group IDs

Enumerator
ApiMac_payloadIEGroup_ESDU 

Payload ESDU IE Group ID

ApiMac_payloadIEGroup_MLME 

Payload MLME IE Group ID

ApiMac_payloadIEGroup_WiSUN 

Payload WiSUN IE Group ID

ApiMac_payloadIEGroup_term 

Payload Termination IE Group ID

§ ApiMac_MLMESubIE_t

MLME Sub IEs

Enumerator
ApiMac_MLMESubIE_coexist 

MLME Sub IEs - short format - Coexistence IE

ApiMac_MLMESubIE_sunDevCap 

MLME Sub IEs - short format - SUN Device capabilities IE

ApiMac_MLMESubIE_sunFSKGenPhy 

MLME Sub IEs - short format - SUN FSK Generic PHY IE

§ ApiMac_wisunSubIE_t

WiSUN Sub IEs

Enumerator
ApiMac_wisunSubIE_USIE 

WiSUN Sub IE - Long format - Unicast Schedule IE

ApiMac_wisunSubIE_BSIE 

WiSUN Sub IE - Long format - Broadcast Schedule IE

ApiMac_wisunSubIE_PANIE 

WiSUN Sub IE - Short format - PAN IE

ApiMac_wisunSubIE_netNameIE 

WiSUN Sub IE - Short format - Network Name IE

ApiMac_wisunSubIE_PANVersionIE 

WiSUN Sub IE - Short format - PAN Version IE

ApiMac_wisunSubIE_GTKHashIE 

WiSUN Sub IE - Short format - GTK Hash IE

§ ApiMac_scantype_t

Scan Types

Enumerator
ApiMac_scantype_energyDetect 

Energy detect scan. The device will tune to each channel and perform and energy measurement. The list of channels and their associated measurements will be returned at the end of the scan

ApiMac_scantype_active 

Active scan. The device tunes to each channel, sends a beacon request and listens for beacons. The PAN descriptors are returned at the end of the scan

ApiMac_scantype_passive 

Passive scan. The device tunes to each channel and listens for beacons. The PAN descriptors are returned at the end of the scan

ApiMac_scantype_orphan 

Orphan scan. The device tunes to each channel and sends an orphan notification to try and find its coordinator. The status is returned at the end of the scan

ApiMac_scantype_activeEnhanced 

Enhanced Active scan. In addition to Active scan, this command is also used by a device to locate a subset of all coordinators within its POS during an active scan

§ ApiMac_wisunAsycnOperation_t

WiSUN Async Operations

Enumerator
ApiMac_wisunAsycnOperation_start 

Start Async

ApiMac_wisunAsycnOperation_stop 

Stop Async

§ ApiMac_wisunAsyncFrame_t

WiSUN Async Frame Types

Enumerator
ApiMac_wisunAsyncFrame_advertisement 

WiSUN Async PAN Advertisement Frame type

ApiMac_wisunAsyncFrame_advertisementSolicit 

WiSUN Async PAN Advertisement Solicitation Frame type

ApiMac_wisunAsyncFrame_config 

WiSUN Async PAN Configuration Frame type

ApiMac_wisunAsyncFrame_configSolicit 

WiSUN Async PAN Configuration Solicitation Frame type

§ ApiMac_fhDispatchType_t

Freqency Hopping Dispatch Values

Enumerator
ApiMac_fhDispatchType_none 

No protocol dispatch

ApiMac_fhDispatchType_MHD_PDU 

MHD-PDU protocol dispatch

ApiMac_fhDispatchType_6LowPAN 

6LowPAN protocol dispatch

Function Documentation

§ ApiMac_init()

void* ApiMac_init ( bool  enableFH)

Initialize this module.

Parameters
enableFH- true to enable frequency hopping, false to not.
Returns
pointer to a wakeup variable (semaphore in some systems)

§ ApiMac_registerCallbacks()

void ApiMac_registerCallbacks ( ApiMac_callbacks_t pCallbacks)

Register for MAC callbacks.

Parameters
pCallbacks- pointer to callback structure

§ ApiMac_processIncoming()

void ApiMac_processIncoming ( void  )

Process incoming messages from the MAC stack.

§ ApiMac_mcpsDataReq()

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.

Parameters
pData- pointer to parameter structure
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mcpsPurgeReq()

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).

Parameters
msduHandle- The application-defined handle value
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeAssociateReq()

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.

Parameters
pData- Pointer to parameters structure.
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeAssociateRsp()

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.

Parameters
pData- Pointer to parameters structure.
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeDisassociateReq()

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.

Parameters
pData- Pointer to parameters structure.
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeGetReqBool()

ApiMac_status_t ApiMac_mlmeGetReqBool ( ApiMac_attribute_bool_t  pibAttribute,
bool *  pValue 
)

This direct execute function retrieves an attribute value from the MAC PIB.

Parameters
pibAttribute- The attribute identifier
pValue- pointer to the attribute value
Returns
The status of the request

§ ApiMac_mlmeGetReqUint8()

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.

Parameters
pibAttribute- The attribute identifier
pValue- pointer to the attribute value
Returns
The status of the request

§ ApiMac_mlmeGetReqUint16()

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.

Parameters
pibAttribute- The attribute identifier
pValue- pointer to the attribute value
Returns
The status of the request

§ ApiMac_mlmeGetReqUint32()

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.

Parameters
pibAttribute- The attribute identifier
pValue- pointer to the attribute value
Returns
The status of the request

§ ApiMac_mlmeGetReqArray()

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.

Parameters
pibAttribute- The attribute identifier
pValue- pointer to the attribute value
Returns
The status of the request

§ ApiMac_mlmeGetFhReqUint8()

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.

Parameters
pibAttribute- The attribute identifier
pValue- pointer to the attribute value
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeGetFhReqUint16()

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.

Parameters
pibAttribute- The attribute identifier
pValue- pointer to the attribute value
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeGetFhReqUint32()

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.

Parameters
pibAttribute- The attribute identifier
pValue- pointer to the attribute value
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeGetFhReqArray()

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.

Parameters
pibAttribute- The attribute identifier
pValue- pointer to the attribute value
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeGetSecurityReqUint8()

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.

Parameters
pibAttribute- The attribute identifier
pValue- pointer to the attribute value
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeGetSecurityReqUint16()

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.

Parameters
pibAttribute- The attribute identifier
pValue- pointer to the attribute value
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeGetSecurityReqArray()

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.

Parameters
pibAttribute- The attribute identifier
pValue- pointer to the attribute value
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeGetSecurityReqStruct()

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.

Parameters
pibAttribute- The attribute identifier
pValue- pointer to the attribute value
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeOrphanRsp()

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.

Parameters
pData- Pointer to parameters structure.
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmePollReq()

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.

Parameters
pData- Pointer to parameters structure.
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeResetReq()

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.

Parameters
setDefaultPib- Set to TRUE to reset the MAC PIB to its default values.
Returns
always ApiMac_status_success

§ ApiMac_mlmeScanReq()

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.

Parameters
pData- Pointer to parameters structure.
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeSetReqBool()

ApiMac_status_t ApiMac_mlmeSetReqBool ( ApiMac_attribute_bool_t  pibAttribute,
bool  value 
)

This direct execute function sets an attribute value in the MAC PIB.

Parameters
pibAttribute- The attribute identifier
value- the attribute value
Returns
The status of the request

§ ApiMac_mlmeSetReqUint8()

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.

Parameters
pibAttribute- The attribute identifier
value- the attribute value
Returns
The status of the request

§ ApiMac_mlmeSetReqUint16()

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.

Parameters
pibAttribute- The attribute identifier
value- the attribute value
Returns
The status of the request

§ ApiMac_mlmeSetReqUint32()

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.

Parameters
pibAttribute- The attribute identifier
value- the attribute value
Returns
The status of the request

§ ApiMac_mlmeSetReqArray()

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.

Parameters
pibAttribute- The attribute identifier
pValue- the attribute value
Returns
The status of the request

§ ApiMac_mlmeSetFhReqUint8()

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.

Parameters
pibAttribute- The attribute identifier
value- the attribute value
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeSetFhReqUint16()

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.

Parameters
pibAttribute- The attribute identifier
value- the attribute value
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeSetFhReqUint32()

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.

Parameters
pibAttribute- The attribute identifier
value- the attribute value
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeSetFhReqArray()

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.

Parameters
pibAttribute- The attribute identifier
pValue- pointer to the attribute value
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeSetSecurityReqUint8()

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.

Parameters
pibAttribute- The attribute identifier
value- the attribute value
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeSetSecurityReqUint16()

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.

Parameters
pibAttribute- The attribute identifier
value- the attribute value
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeSetSecurityReqArray()

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.

Parameters
pibAttribute- The attribute identifier
pValue- pointer to the attribute value
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeSetSecurityReqStruct()

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.

Parameters
pibAttribute- The attribute identifier
pValue- pointer to the attribute value
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeStartReq()

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.

Parameters
pData- Pointer to parameters structure.
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeSyncReq()

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.

Parameters
pData- Pointer to parameters structure.
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_randomByte()

uint8_t ApiMac_randomByte ( void  )

This function returns a random byte from the MAC random number generator.

Returns
A random byte.

§ ApiMac_updatePanId()

ApiMac_status_t ApiMac_updatePanId ( uint16_t  panId)

Update Device Table entry and PIB with new Pan Id.

Parameters
panId- the new Pan ID
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_mlmeWSAsyncReq()

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.

Parameters
pDatapointer to the asynchronous parameters structure
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_startFH()

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.

Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_parsePayloadGroupIEs()

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.

Parameters
pPayload- pointer to the buffer with the payload IEs.
payloadLen- length of the buffer with the payload IEs.
pList- pointer to link list pointer.
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_parsePayloadSubIEs()

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().

Parameters
pContent- pointer to the buffer with the sub IEs.
contentLen- length of the buffer with the payload IEs.
pList- pointer to link list pointer.
Returns
The status of the request, as follows:
ApiMac_status_success

§ ApiMac_freeIEList()

void ApiMac_freeIEList ( ApiMac_payloadIeRec_t pList)

Free the linked list allocated by ApiMac_parsePayloadGroupIEs() or ApiMac_parsePayloadSubIEs().

Parameters
pList- pointer to linked list

§ ApiMac_enableFH()

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.

Returns
The status of the request, as follows:
ApiMac_status_success
  • feature not available.

§ ApiMac_convertCapabilityInfo()

uint8_t ApiMac_convertCapabilityInfo ( ApiMac_capabilityInfo_t pMsgcapInfo)

Convert ApiMac_capabilityInfo_t data type to uint8 capInfo.

Parameters
pMsgcapInfo- CapabilityInfo pointer
Returns
capInfo bit mask byte

§ ApiMac_buildMsgCapInfo()

void ApiMac_buildMsgCapInfo ( uint8_t  cInfo,
ApiMac_capabilityInfo_t pPBcapInfo 
)

Convert from bitmask byte to API MAC capInfo.

Parameters
cInfo- source
pPBcapInfo- destination

§ ApiMac_secAddDevice()

ApiMac_status_t ApiMac_secAddDevice ( ApiMac_secAddDevice_t pAddDevice)

Adds a new MAC device table entry.

Parameters
pAddDevice- Add device information
Returns
ApiMac_status_success if successful, other status value if not.

§ ApiMac_secDeleteDevice()

ApiMac_status_t ApiMac_secDeleteDevice ( ApiMac_sAddrExt_t pExtAddr)

Removes MAC device table entries.

Parameters
pExtAddr- extended address of the device table entries that shall be removed
Returns
ApiMac_status_success if successful, other status value if not.

§ ApiMac_secDeleteKeyAndAssocDevices()

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.

Parameters
keyIndex- mac secuirty key table index of the key to be removed.
Returns
ApiMac_status_success if successful, other status value if not.

§ ApiMac_secDeleteAllDevices()

ApiMac_status_t ApiMac_secDeleteAllDevices ( void  )

Removes all MAC device table entries.

Returns
ApiMac_status_success if successful, other status value if not.

§ ApiMac_secGetDefaultSourceKey()

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.

Parameters
keyId- Key ID.
pFrameCounter- pointer to a buffer to store the outgoing frame counter of the key.
Returns
ApiMac_status_success if successful, other status value if not.

§ ApiMac_secAddKeyInitFrameCounter()

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.

Parameters
pInfo- structure need to perform this function.
Returns
ApiMac_status_success if successful, other status value if not.
© Copyright 1995-2021, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale