📄 mac_sap.h
字号:
*/typedef struct{ uint8 u8Status; /**< Status of data poll request @sa MAC_Enum_e */} MAC_MlmeCfmPoll_s;/* @} *//** * @defgroup g_mac_sap_mlme_cfm_VS MLME Confirm Vendor specific parameters * @ingroup g_mac_sap_mlme_cfm g_mac_sap_vs * * @{ *//* @} *//*************************//**** MLME Indication ****//*************************//** * @defgroup g_mac_sap_mlme_ind MLME Indication objects * @ingroup g_mac_sap_mlme * * These are sent asynchronously via the registered Deferred Confirm/Indication callback *//** * @defgroup g_mac_sap_mlme_ind_15_4 MLME Indication 802.15.4 specification parameters * @ingroup g_mac_sap_mlme_ind * * @{ *//** * @brief Structure for MLME-ASSOCIATE.indication * * Association indication. Uses type MAC_MLME_IND_ASSOCIATE */typedef struct{ MAC_ExtAddr_s sDeviceAddr; /**< Extended address of device wishing to associate */ uint8 u8Capability; /**< Device capabilities */ uint8 u8SecurityUse; /**< True if security was used on command frames */ uint8 u8AclEntry; /**< Security suite used */} MAC_MlmeIndAssociate_s;/** * @brief Structure for MLME-DISASSOCIATE.indication * * Disassociation indication. Uses type MAC_MLME_IND_DISASSOCIATE */typedef struct{ MAC_ExtAddr_s sDeviceAddr; /**< Extended address of device which has sent disassociation notification */ uint8 u8Reason; /**< Reason for disassociating */ uint8 u8SecurityUse; /**< True if security was used on command frames */ uint8 u8AclEntry; /**< Security suite used */} MAC_MlmeIndDisassociate_s;/** * @brief Structure for MLME-SYNC-LOSS.indication * * Synchronisation loss indication. Uses type MAC_MLME_SYNC_LOSS */typedef struct{ uint8 u8Reason; /**< Synchronisation loss reason @sa MAC_Enum_e */} MAC_MlmeIndSyncLoss_s;/** * @brief Structure for MLME-GTS.indication * * GTS information indication. Uses type MAC_MLME_GTS_INDICATION */typedef struct{ uint16 u16ShortAddr; /**< Short address of device to which GTS has been allocated or deallocated */ uint8 u8Characteristics; /**< Characteristics of the GTS */ uint8 u8Security; /**< True if security was used on command frames */ uint8 u8AclEntry; /**< Security suite used */} MAC_MlmeIndGts_s;/** * @brief Structure for MLME-BEACON-NOTIFY.indication * * Beacon notification indication. Uses type MAC_MLME_BEACON_NOTIFY */typedef struct{ MAC_PanDescr_s sPANdescriptor; /**< PAN descriptor */ uint8 u8BSN; /**< Beacon sequence number */ uint8 u8PendAddrSpec; /**< Pending address specification */ uint8 u8SDUlength; /**< Length of following payload */ MAC_Addr_u uAddrList[7]; /**< Pending addresses */ uint8 u8SDU[MAC_MAX_BEACON_PAYLOAD_LEN]; /**< Beacon payload */} MAC_MlmeIndBeacon_s;/** * @brief Structure for MLME-COMM-STATUS.indication * * Communication status indication. Uses type MAC_MLME_IND_COMM_STATUS * @note The PANId parameter for the primitive is contained within sSrcAddr. * The u16PanId element of sDstAddr is not used. */typedef struct{ MAC_Addr_s sSrcAddr; /**< Source address of frame */ MAC_Addr_s sDstAddr; /**< Destination address of frame */ uint8 u8Status; /**< Status of communication @sa MAC_Enum_e */} MAC_MlmeIndCommStatus_s;/** * @brief Structure for MLME-ORPHAN.indication * * Orphan indication. Uses type MAC_MLME_IND_ORPHAN */typedef struct{ MAC_ExtAddr_s sDeviceAddr; /**< Extended address of orphaned device */ uint8 u8SecurityUse; /**< True if security was used on command frames */ uint8 u8AclEntry; /**< Security suite used */} MAC_MlmeIndOrphan_s;/* @} *//** * @defgroup g_mac_sap_mlme_ind_VS MLME Indication Vendor specific parameters * @ingroup g_mac_sap_mlme_ind g_mac_sap_vs * * @{ *//***********************//**** MLME Response ****//***********************//** * @defgroup g_mac_sap_mlme_rsp MLME Response objects * @ingroup g_mac_sap_mlme * * These are passed in a call to MAC_vHandleMlmeReqRsp. * Responses have no effective confirmation of sending as they are in response to * an Indication; this will be indicated in the synchronous Confirm passed back. *//** * @defgroup g_mac_sap_mlme_rsp_15_4 MLME Response 802.15.4 specification parameters * @ingroup g_mac_sap_mlme_rsp * * @{ *//** * @brief Structure for MLME-ASSOCIATE.response * * Association response. Use type MAC_MLME_RSP_ASSOCIATE */typedef struct{ MAC_ExtAddr_s sDeviceAddr; /**< Device's extended address */ uint16 u16AssocShortAddr; /**< Short address allocated to Device */ uint8 u8Status; /**< Status of association */ uint8 u8SecurityEnable; /**< True if security is to be used on command frames */} MAC_MlmeRspAssociate_s;/** * @brief Structure for MLME-ORPHAN.response * * Orphan response. Use type MAC_MLME_RSP_ORPHAN */typedef struct{ MAC_ExtAddr_s sOrphanAddr; /**< Orphaned Device's extended address */ uint16 u16OrphanShortAddr; /**< Short address Orphaned Device should use */ uint8 u8Associated; /**< True if Device was previously associated */ uint8 u8SecurityEnable; /**< True if security is to be used on command frames */} MAC_MlmeRspOrphan_s;/* @} *//*****************************************//**** MLME Request/Response Interface ****//*****************************************//** * @defgroup g_mac_sap_mlme_req_rsp_if MLME Request/Response interface * @ingroup g_mac_sap_mlme g_mac_VS * * The interface for the client to issue an MLME Request or Response * is via a function call to MAC_vHandleMlmeReqRsp. * @li Request/Response parameters are passed in via psMlmeReqRsp * @li Synchronous Confirm parameters are passed out via psMlmeSyncCfm * @li Deferred Confirms are posted back asynchronously via the * Deferred Confirm/Indication callback. * @note Responses have no effective confirmation of sending as they are in response to * an Indication; this will be indicated in the synchronous Confirm passed back. * * @{ *//** * @brief MAC MLME Request/Response enumeration. * * Enumeration of MAC MLME Request/Response * @note Must not exceed 256 entries */typedef enum{ MAC_MLME_REQ_ASSOCIATE = 0, /**< Use with tagMAC_MlmeReqAssociate_s */ MAC_MLME_REQ_DISASSOCIATE, /**< Use with tagMAC_MlmeReqDisassociate_s */ MAC_MLME_REQ_GET_removed, /**< Use with tagMAC_MlmeReqGet_s */ MAC_MLME_REQ_GTS, /**< Use with tagMAC_MlmeReqGts_s */ MAC_MLME_REQ_RESET, /**< Use with tagMAC_MlmeReqReset_s */ MAC_MLME_REQ_RX_ENABLE, /**< Use with tagMAC_MlmeReqRxEnable_s */ MAC_MLME_REQ_SCAN, /**< Use with tagMAC_MlmeReqScan_s */ MAC_MLME_REQ_SET_removed, /**< Use with tagMAC_MlmeReqSet_s */ MAC_MLME_REQ_START, /**< Use with tagMAC_MlmeReqStart_s */ MAC_MLME_REQ_SYNC, /**< Use with tagMAC_MlmeReqSync_s */ MAC_MLME_REQ_POLL, /**< Use with tagMAC_MlmeReqPoll_s */ MAC_MLME_RSP_ASSOCIATE, /**< Use with tagMAC_MlmeRspAssociate_s */ MAC_MLME_RSP_ORPHAN, /**< Use with tagMAC_MlmeRspOrphan_s */ MAC_MLME_REQ_VS_EXTADDR_removed,/**< Use with tagMAC_MlmeReqVsExtAddr_s */ NUM_MAC_MLME_REQ /**< (endstop) */} MAC_MlmeReqRspType_e;/** * @brief MLME Request/Response Parameter union * * Union of all the possible MLME Requests and Responses, including * all the vendor-specific requests */typedef union{ /* MLME Requests */ MAC_MlmeReqAssociate_s sReqAssociate; /**< Association request */ MAC_MlmeReqDisassociate_s sReqDisassociate; /**< Disassociation request */ MAC_MlmeReqGet_s sReqGet; /**< PIB get request */ MAC_MlmeReqGts_s sReqGts; /**< GTS request */ MAC_MlmeReqReset_s sReqReset; /**< MAC reset request */ MAC_MlmeReqRxEnable_s sReqRxEnable; /**< Receiver enable request */ MAC_MlmeReqScan_s sReqScan; /**< Scan request */ MAC_MlmeReqSet_s sReqSet; /**< PIB set request */ MAC_MlmeReqStart_s sReqStart; /**< Superframe start request */ MAC_MlmeReqSync_s sReqSync; /**< Superframe sync request */ MAC_MlmeReqPoll_s sReqPoll; /**< Data poll request */ MAC_MlmeReqVsExtAddr_s sReqVsExtAddr; /**< VS set external address */ MAC_MlmeRspAssociate_s sRspAssociate; /**< Association response */ MAC_MlmeRspOrphan_s sRspOrphan; /**< Orphan response */} MAC_MlmeReqRspParam_u;/** * @brief MLME Request/Response * * The object passed to MAC_vHandleMlmeReqRsp containing the request */typedef struct{ uint8 u8Type; /**< Request type (@sa MAC_MlmeReqRspType_e) */ uint8 u8ParamLength; /**< Parameter length in following union */ uint16 u16Pad; /**< Padding to force alignment */ MAC_MlmeReqRspParam_u uParam; /**< Union of all possible Requests */} MAC_MlmeReqRsp_s;/** * @brief Synchronous confirm status * * Indicates in the synchronous confirm whether: * @li The Request was processed with or without error * @li The confirm will be deferred and posted via the Deferred Confirm/Indication callback * @li It is a dummy confirm to a Response. * @note NB Must not exceed 256 entries */typedef enum{ MAC_MLME_CFM_OK, /**< Synchronous confirm without error */ MAC_MLME_CFM_ERROR, /**< Synchronous confirm with error; see u8Status field */ MAC_MLME_CFM_DEFERRED, /**< Asynchronous deferred confirm will occur */ MAC_MLME_CFM_NOT_APPLICABLE, /**< Dummy synchronous confirm for MLME responses */ NUM_MAC_MLME_CFM /**< (endstop) */} MAC_MlmeSyncCfmStatus_e;/** * @brief MLME Synchronous Confirm Parameter union * * Union of all the possible MLME Synchronous Confirms, including * all the vendor-specific confirms */typedef union{ MAC_MlmeCfmAssociate_s sCfmAssociate; /**< Association confirm */ MAC_MlmeCfmDisassociate_s sCfmDisassociate; /**< Disassociation confirm */ MAC_MlmeCfmGet_s sCfmGet; /**< PIB get confirm */ MAC_MlmeCfmGts_s sCfmGts; /**< GTS confirm */ MAC_MlmeCfmScan_s sCfmScan; /**< Scan confirm */ MAC_MlmeCfmSet_s sCfmSet; /**< PIB set confirm */ MAC_MlmeCfmStart_s sCfmStart; /**< Superframe start confirm */ MAC_MlmeCfmPoll_s sCfmPoll; /**< Data poll confirm */ MAC_MlmeCfmReset_s sCfmReset; /**< Reset confirm */ MAC_MlmeCfmRxEnable_s sCfmRxEnable; /**< Receiver enable confirm */} MAC_MlmeSyncCfmParam_u;/** * @brief MLME Synchronous Confirm * * The object returned by MAC_vHandleMlmeReqRsp containing the synchronous confirm * @note All Confirms may also be sent asynchronously via the registered Deferred Confirm/Indication callback. * This is notified by returning MAC_MLME_CFM_DEFERRED. * The confirm type is implied as corresponding to the request */typedef struct{ uint8 u8Status; /**< Confirm status (@sa MAC_MlmeCfmStatus_e) */ uint8 u8ParamLength; /**< Parameter length in following union */ uint16 u16Pad; /**< Padding to force alignment */ MAC_MlmeSyncCfmParam_u uParam; /**< Union of all possible Confirms */} MAC_MlmeSyncCfm_s;/* @} *//****************************************************//**** MLME Deferred Confirm/Indication Interface ****//****************************************************//** * @defgroup g_mac_sap_mlme_dcfm_ind_if MLME Deferred Confirm/Indication Interface * @ingroup g_mac_sap_mlme g_mac_VS * * The interface for the client to receive an MLME Deferred Confirm or Indication * is via a function callback to the function registered using MAC_vMlmeDcfmIndRegister. * * @{ *//** * @brief Deferred Confirm/Indication type * * Indicates the type of deferred confirm or indication * @note NB Must not exceed 256 entries */typedef enum{ MAC_MLME_DCFM_SCAN, /**< Use with tagMAC_MlmeCfmScan_s */ MAC_MLME_DCFM_GTS, /**< Use with tagMAC_MlmeCfmGts_s */ MAC_MLME_DCFM_ASSOCIATE, /**< Use with tagMAC_MlmeCfmAssociate_s */ MAC_MLME_DCFM_DISASSOCIATE, /**< Use with tagMAC_MlmeCfmDisassociate_s */ MAC_MLME_DCFM_POLL, /**< Use with tagMAC_MlmeCfmPoll_s */ MAC_MLME_DCFM_RX_ENABLE, /**< Use with tagMAC_MlmeCfmRxEnable_s */ MAC_MLME_IND_ASSOCIATE, /**< Use with tagMAC_MlmeIndAssociate_s */ MAC_MLME_IND_DISASSOCIATE, /**< Use with tagMAC_MlmeIndDisassociate_s */ MAC_MLME_IND_SYNC_LOSS, /**< Use with tagMAC_MlmeIndSyncLoss_s */ MAC_MLME_IND_GTS, /**< Use with tagMAC_MlmeIndGts_s */ MAC_MLME_IND_BEACON_NOTIFY, /**< Use with tagMAC_MlmeIndBeacon_s */ MAC_MLME_IND_COMM_STATUS, /**< Use with tagMAC_MlmeIndCommStatus_s */ MAC_MLME_IND_ORPHAN, /**< Use with tagMAC_MlmeIndOrphan_s */ NUM_MAC_MLME_IND} MAC_MlmeDcfmIndType_e;/** * @brief MLME Indication and Deferred Confirm parameter union * * Union of all the possible MLME indications and deferred confirmations, * including all the vendor-specific indications */typedef union{ MAC_MlmeCfmScan_s sDcfmScan; MAC_MlmeCfmGts_s sDcfmGts; MAC_MlmeCfmAssociate_s sDcfmAssociate; MAC_MlmeCfmDisassociate_s sDcfmDisassociate; MAC_MlmeCfmPoll_s sDcfmPoll; MAC_MlmeCfmRxEnable_s sDcfmRxEnable; MAC_MlmeIndAssociate_s sIndAssociate; MAC_MlmeIndDisassociate_s sIndDisassociate; MAC_MlmeIndGts_s sIndGts; MAC_MlmeIndBeacon_s sIndBeacon; MAC_MlmeIndSyncLoss_s sIndSyncLoss; MAC_MlmeIndCommStatus_s sIndCommStatus; MAC_MlmeIndOrphan_s sIndOrphan;} MAC_MlmeDcfmIndParam_u;/** * @brief MLME Indication * * The object passed to the registered Deferred Confirm/Indication callback. */typedef struct{ uint8 u8Type; /**< Deferred Confirm/Indication type @sa MAC_MlmeDcfmIndType_e */ uint8 u8ParamLength; /**< Parameter length in following union */ uint16 u16Pad; /**< Padding to force alignment */ MAC_MlmeDcfmIndParam_u uParam; /**< Union of all possible Deferred Confirms/Indications */} MAC_MlmeDcfmInd_s;/* @} *//**********************//**** MCPS Request ****//**********************//** * @defgroup g_mac_sap_mcps_req MCPS Request objects * @ingroup g_mac_sap_mcps * * These are passed in a call to MAC_vHandleMcpsReqRsp. * Confirms to a Request will either be passed back synchronously on the function return, * or a special 'deferred' confirm will come back asynchronously via the * Deferred Confirm/Indication callback. * Responses have no effective confirmation of sending as they are in response to * an Indication; this will be indicated in the synchronous Confirm passed back. *//** * @defgroup g_mac_sap_mcps_req_15_4 MCPS Request 802.15.4 specification parameters * @ingroup g_mac_sap_mcps_req * * @{ *//** * @brief Transmit frame structure * * Used by Data request
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -