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.

关于使用“AF_DataRequestSrcRtg()”函数返回“Source Route Failure”后协调器无任何处理的问题。

Other Parts Discussed in Thread: Z-STACK, CC2538, CC2530

协议栈: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() ”这样的。

  • Hi
    两种错误有本质的区别
    • Source route failure: Source routing has failed, probably indicating a link failure in one of the source route’s links
    • Many-to-one route failure: A route established as a result of a many-to-one route request has failed.

    在我印象中这个没有错误回调开放给客户。你这个错误应该是你的路由表发送了变化,找不到该设备了。你有及时的去刷新你的table吗?
  • 没有,怎么刷新我的 table?
  • 每次收到ZDO_SrcRtgIndCB即route record 都去根据source address 去更新对应地址的table。
  • 这个我是有更新的,请问“route record”是子设备什么时候会上报给协调器的?
  • 客户无法管理和操作route record,这是底层自动的source route 维护。你可以看一下你的抓包source route 没有成功,0x0b代表的是链路错误。建议你在收到这个错误时,直接使用AF_datarequest,等到新的route record 到来再使用source route。
  • 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”是什么情况?

  • 尝试按照route link 也就是路由路径发送,发送失败,然先后需要更新source route ,所以发送Route Request。
    你们是联盟会员吗? 可以在R22中找到详细说明。
    此外关于route record使用请看下面的讨论串,我和我们同事认为下面的帖子具备一定的代表性。
    e2e.ti.com/.../2520281
  • 太久没登联盟网站了,全变样了,是这个《ZigBee PRO 2017 (R22) Network》吗?在哪个地方下载啊?
  • zigbee Specification Revision 22 1.0 仅会员可以下载。
  • OK 了,谢谢,我先看看先。
  • 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()” 有什么差别?