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.
协议栈:Z-Stack 3.0.2
协调器:CC2538
终端设备:CC2530
问题描述:
1、将“Route Record”命令中的路由链路填充到“AF_DataRequestSrcRtg()”函数发送到目标设备。
2、发送失败后,中间设备返回“Network Status”为“Source Route Failure”的命令给协调器,协调器接收后无任何处理,所以协调器会一直按照这条链路发送数据给“0xa9a6”设备,导致协调器无法发送数据到“0xa9a6”设备。
3、在《Z-Stack 3.0 Developer's Guide》文档中的 5.4.4 章节有说明返回状态为“Many to one route failure”的“Network Status”命令时会重新发起“route request”过程。
4、但是为什么我这边发送失败后返回的是“Source Route Failure”状态而不是“Many to one route failure”状态?
5、什么时候返回的才是“Many to one route failure”状态?
6、当中间设备返回“Source Route Failure”状态的“Network Status”命令时开发者该怎么处理?有此命令的回调函数吗?例如像“void ZDO_ManytoOneFailureIndicationCB() ”这样的。
void ZDO_NetworkStatusCB( uint16 nwkDstAddr, uint8 statusCode, uint16 dstAddr )
{
(void)dstAddr; // Remove this line if this parameter is used.
if ( (nwkDstAddr == NLME_GetShortAddr())
&& (statusCode == NWKSTAT_NONTREE_LINK_FAILURE) )
{
// Routing error for dstAddr, this is informational and a Route
// Request should happen automatically.
}
}
上面写着要在这里发起“route request”?“NWKSTAT_NONTREE_LINK_FAILURE”是什么情况?
afStatus_t AF_DataRequestSrcRtg( afAddrType_t *dstAddr, endPointDesc_t *srcEP,
uint16 cID, uint16 len, uint8 *buf, uint8 *transID,
uint8 options, uint8 radius, uint8 relayCnt, uint16* pRelayList )
{
uint8 status;
/* Add the source route to the source routing table */
status = RTG_AddSrcRtgEntry_Guaranteed( dstAddr->addr.shortAddr, relayCnt,
pRelayList );
if( status == RTG_SUCCESS)
{
/* Call AF_DataRequest to send the data */
status = AF_DataRequest( dstAddr, srcEP, cID, len, buf, transID, options, radius );
}
else if( status == RTG_INVALID_PATH )
{
/* The source route relay count is exceeding the network limit */
status = afStatus_INVALID_PARAMETER;
}
else
{
/* The guaranteed adding entry fails due to memory failure */
status = afStatus_MEM_FAIL;
}
return status;
}
请问 “relayCnt”为0,“pRelayList”=NULL 的 “AF_DataRequestSrcRtg()” 函数跟直接调用 “AF_DataRequest()” 有什么差别?