请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号: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;
}我们在这里错过了什么?
请告知、谢谢。