This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CC1352P:是否可以在 TI-15.4 Stack 中将某种消息标签从应用程序传递到 Mac 层代码?

Guru**** 2393725 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1329652/cc1352p-possible-to-pass-some-sort-of-message-tag-from-application-to-mac-layer-code-in-ti-15-4-stack

器件型号: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

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Zhiyong、

    听起来这个值是在 TI 15.4-Stack 库中定义的、这可能就是为什么当你在 sensor.c 中更改这个值时会看到一个构建错误的原因。

    谢谢、

    M·H

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Marie:

     将来是否可以在 TI 15.4堆栈库中将其从 uint8_t 更改为 uint16_t? 我们目前可以使用5位计数器、但这样做非常有限。

    谢谢。

    ZL