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.

[参考译文] CC1310:有关 TI-15.4堆栈的传感器示例中的数据确认回调的问题

Guru**** 2482225 points


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

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1218783/cc1310-questions-about-data-confirm-callback-in-sensor-example-of-ti-15-4-stack

器件型号:CC1310

您好!

根据传感器(SDK v4.20.1.03)示例代码测试项目时、我们发现在极少数情况下、传感器节点会在几小时内保持连接状态3 (已连接)或4 (已重新连接)、但无法将数据发送到收集器节点、同时从收集器节点接收数据没有问题。 调试日志表明、对于发送到收集器的每个数据包、dataCnfCB 返回的状态代码为0xE9 (ApiMac_STATUS_noAck)。

/*!
 * sensor.c
 * @brief      MAC Data Confirm callback.
 *
 * @param      pDataCnf - pointer to the data confirm information
 */
static void dataCnfCB(ApiMac_mcpsDataCnf_t *pDataCnf)
{
    uint16_t endToEndDelay = 0;
    /* Record statistics */
    if(pDataCnf->status == ApiMac_status_channelAccessFailure)
    {
        Sensor_msgStats.channelAccessFailures++;
    }
    else if(pDataCnf->status == ApiMac_status_noAck)
    {
        // returned status code 0xE9 here
        Sensor_msgStats.macAckFailures++;
#ifdef DISPLAY_PER_STATS
        Util_setEvent(&Sensor_events, SENSOR_UPDATE_STATS_EVT);
#endif
    }

我在这里的问题是:
1) 1)这怎么可能发生? 几小时后、传感器节点从收集器节点接收到多个数据包、其他传感器节点也可以顺利地向同一收集器节点发送数据。
2) 2)为什么 jdlc.c 中的以下代码不处理此类情况
static void dataCnfCb(ApiMac_mcpsDataCnf_t *pData)
{
    if(CONFIG_MAC_BEACON_ORDER == JDLLC_BEACON_ORDER_NON_BEACON)
    {
        if(pData->status == ApiMac_status_noAck)
        {
            /* track the number of failures  */
            /* Note: other errors such as ApiMac_status_channelAccessFailure not handled here */
            devInfoBlock.dataFailures++;
            if(devInfoBlock.dataFailures == CONFIG_MAX_DATA_FAILURES)
            {
                handleMaxDataFail();
            }
        }
        else if(pData->status == ApiMac_status_success)
        {
            devInfoBlock.dataFailures = 0;
            if(devInfoBlock.currentJdllcState == Jdllc_states_initRestoring)
            {
                ApiMac_deviceDescriptor_t devInfo;
                Llc_netInfo_t parentNetInfo;
                populateInfo(&devInfo, &parentNetInfo);
                ApiMac_mlmeSetReqBool(ApiMac_attribute_RxOnWhenIdle,
                CONFIG_RX_ON_IDLE);

                /* device joined */
                if(pJdllcCallbacksCopy && pJdllcCallbacksCopy->pJoinedCb)
                {
                    pJdllcCallbacksCopy->pJoinedCb(&devInfo, &parentNetInfo);
                }

                updateState(Jdllc_states_rejoined);
            }
        }
    }

    if(macCallbacksCopy.pDataCnfCb != NULL)
    {
        macCallbacksCopy.pDataCnfCb(pData);
    }
}

当   CONFIG_MAX_DATA_FAULTS = 3时,我假设 handleMaxDataFail ()已被触发,因此加入状态将被更新为孤立状态,但我们的调试日志并不表示发生了这种情况。
/*!
 * @brief       Handle maximum ack failures for non beacon and FH mode
 */
static void handleMaxDataFail(void)
{
    if(!CONFIG_RX_ON_IDLE)
    {
        /* stop polling */
        Ssf_setPollClock(0);
    }

    ApiMac_mlmeSetReqBool(ApiMac_attribute_RxOnWhenIdle, true);
    /* Initialize counter for re-join delay calculation */
    interimDelayTicks = Clock_getTicks();
    /* non beacon network or fh mode - update stats */
    Sensor_msgStats.syncLossIndications++;

    if(CONFIG_FH_ENABLE)
    {
        updateState(Jdllc_states_orphan);
        parentFound = false;
        /* start trickle timer for PCS */
        Ssf_setTrickleClock(fhPanConfigInterval,
                            ApiMac_wisunAsyncFrame_configSolicit);
    }
    else
    {
        /* start orphan scan */
        switchState(Jdllc_deviceStates_scanOrphan);
        updateState(Jdllc_states_orphan);
    }

    devInfoBlock.dataFailures = 0;
}
我们在这里错过了什么?
请告知、谢谢。
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Zhiyong、

    此错误是否也会出现在我们最新的 SDK(6.41.00.17)中?

    然而,这听起来像一个角落追逐问题,在我们的用户手册中描述。  

    如果收集器复位、传感器可能没有注意到网络已被删除。 因此、它开始轮询收集器并等待响应。  

    收集器应经过调整、以便在接收到来自未知器件的轮询时立即发送取消关联请求。 这可以通过调用  ApiMac_mlmeDiassociateReq ()来完成。

    此致、

    Alex