请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:CC1352P 您好!
我正在尝试将消息标签、如帧计数器、从应用层传递到 MAC 层。 这样、当 MAC 层代码无法发送消息时、我们就可以通过消息标签来知道它无法发送的消息。 在当前实现中、从 SDK v7.10开始、我可以找到的最接近的方法是通过 以下结构中的 msduHandle:
typedef struct _apimac_mcpsdatareq { /*! The address of the destination device */ ApiMac_sAddr_t dstAddr; /*! The PAN ID of the destination device */ uint16_t dstPanId; /*! The source address mode */ ApiMac_addrType_t srcAddrMode; /*! Application-defined handle value associated with this data request */ uint8_t msduHandle; /*! TX options bit mask */ ApiMac_txOptions_t txOptions; /*! Transmit the data frame on this channel */ uint8_t channel; /*! Transmit the data frame at this power level */ uint8_t power; /*! pointer to the payload IE list, excluding termination IEs */ uint8_t *pIEList; /*! length of the payload IE */ uint16_t payloadIELen; /*! Freq hopping Protocol Dispatch - RESERVED for future use, should be cleared. */ ApiMac_fhDispatchType_t fhProtoDispatch; /*! Bitmap indicates which FH IE's need to be included */ uint32_t includeFhIEs; /*! Data buffer */ ApiMac_sData_t msdu; /*! Security Parameters */ ApiMac_sec_t sec; /*! Transmit Delay for Green Power */ uint8_t gpOffset; /*! Transmit Window for Green Power */ uint8_t gpDuration; } ApiMac_mcpsDataReq_t;
msduHandle 似乎已传递到 Mac 层,并在以下代码中返回:
/*! * @brief MAC Data Confirm callback. * * @param pDataCnf - pointer to the data confirm information */ static void dataCnfCB(ApiMac_mcpsDataCnf_t *pDataCnf)
问题是、仅最后 5位被用于此处定义的帧计数器:
// sensor.c /* default MSDU Handle rollover */ #define MSDU_HANDLE_MAX 0x1F
是否还有其他方法可以使用更大的帧计数器? 我试图将 msduHandle 从 uint8_t 更改为 uint16_t、但这会导致编译错误。 我假设代码的关闭源部分不希望发生这种情况。
谢谢。
ZL