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.

ZLLRC遥控加网成功后没有发送EndPoint与DeviceId到网关

我现在测试遥控器ZLLRC传统方式加入Beabone网关,调用zllInitiator_ClassicalCommissioningStart()函数加网成功后,按道理应该把自己的终端EndPoint(0x0b)和DeviceId(0x0105)提交到Beabone网关,但我们测试发现遥控器只在入网之后提交了一次短地址networkAddr,便没有再提交EndPoint和DeviceId。而原来的灯则会提交Endpoint和DeviceId。

请问TI的大师们,应该怎么做才能提交EndPoint和DeviceId到Beabone网关?

  • 怎样才能在遥控器入网成功时将Endpoint、DeviceId发送到网关呢?

  • 这个不是遥控器主动提交的,而是有一个Service Discovery的过程的。

    好好看下http://www.deyisupport.com/question_answer/wireless_connectivity/zigbee/f/104/t/81385.aspx 

  • VV,您好!

    我用CC Debugger设置Breakpoints跟踪调试,发现ZLLRC遥控在节点入网成功(Device Announce)之后没有执行 ZDO_ProcessActiveEPReq函数,也就是说ZHA Coordinator并没有发起Service Discovery过程,而ZLight则在入网成功后执行了ZDO_ProcessActiveEPRsp函数,说明问题出在了ZHA Coordinator协调器,也就是我们的SampleBridge程序,请问:

    SampleBridge修改哪部分代码可以解决这个问题?

    非常期待大师指点,多谢了!


  • 今天我又跟踪测试了SampleBridge程序,发现ZHA Coordinator 确实在ZLLRC遥控器加网成功之后调用了ZDP_ActiveEPReq() API,发送Active_EP_req命令给ZLLRC,这说明问题还是出在了ZLLRC,要么是ZLLRC遥控器没有收到Active_EP_req 命令,要么是收到了命令没有调用call back函数 ZDO_ProcessActiveEPReq。

    ZLLRC入网与ZLight不同的是:ZLight在入网成功后调用了三次ZDP_ActiveEPReq,而ZLLRC入网成功之后只调用了一次。

  • 今天继续跟踪测试,对比ZLight与ZLLRC的程序,发现ZDApp_ProcessOSALMsg函数执行过程中有如下区别:

    ZLLRC当msgPtr->event=0xFD时,本来应该执行到case AF_DATA_CONFIRM_CMD:下面的语句,却直接执行case ZDO_NWK_DISC_CNF:后面的语句,导致跳出循环;而ZLight则是正常执行case AF_DATA_CONFIRM_CMD:下面的语句。

    void ZDApp_ProcessOSALMsg( osal_event_hdr_t *msgPtr )
    {
    // Data Confirmation message fields
    uint8 sentEP; // This should always be 0
    uint8 sentStatus;
    afDataConfirm_t *afDataConfirm;
    uint8 tmp;

    switch ( msgPtr->event )
    {
    // Incoming ZDO Message
    case AF_INCOMING_MSG_CMD:
    ZDP_IncomingData( (afIncomingMSGPacket_t *)msgPtr );
    break;

    case ZDO_CB_MSG:
    ZDApp_ProcessMsgCBs( (zdoIncomingMsg_t *)msgPtr );
    break;

    case AF_DATA_CONFIRM_CMD:
    // This message is received as a confirmation of a data packet sent.
    // The status is of ZStatus_t type [defined in NLMEDE.h]
    // The message fields are defined in AF.h
    afDataConfirm = (afDataConfirm_t *)msgPtr;
    sentEP = afDataConfirm->endpoint;
    sentStatus = afDataConfirm->hdr.status;

    // Action taken when confirmation is received.
    #if defined ( ZIGBEE_FREQ_AGILITY )
    if ( pZDNwkMgr_ProcessDataConfirm )
    pZDNwkMgr_ProcessDataConfirm( afDataConfirm );
    #endif
    (void)sentEP;
    (void)sentStatus;
    break;

    case ZDO_NWK_DISC_CNF:
    if (devState != DEV_NWK_DISC)
    break;

    请问TI的大师们,程序跟踪到这里,能否给出修改意见?

  • 上面你这个调试的问题,应该是编译优化的问题的。这种跳转也正常。

    你现在ZLLRC在入网的时候,是什么方式入网的?

    在入网以后抓包已经看到Endpoint request发出来了对吧?

    那么你去ZLLRC的程序里面,void ZDO_ProcessActiveEPReq( zdoIncomingMsg_t *inMsg )

    是否有整个过程的抓包文件。

  • VV,您好!

    1. 编译优化的问题,我还是无法理解,我感觉还是存在问题;

    2. ZLLRC是以EndDevice方式入网的,入网之后没有看到Endpoint request 发出来;

    3. 我在ZDO_ProcessActiveEPReq( zdoIncomingMsg_t *inMsg )函数中看到调用ZDP_ActiveEPRsp( inMsg->TransSeq, &(inMsg->srcAddr), stat, aoi, cnt, (uint8 *)ZDOBuildBuf, inMsg->SecurityUse ); 也就是ZDP_EPRsp 这个函数,如下:

    afStatus_t ZDP_EPRsp( uint16 MsgType, byte TransSeq, zAddrType_t *dstAddr,
    byte Status, uint16 nwkAddr, byte Count,
    uint8 *pEPList,
    byte SecurityEnable )
    {
    uint8 *pBuf = ZDP_TmpBuf;
    byte len = 1 + 2 + 1; // Status + nwkAddr + endpoint/interface count.
    byte txOptions;

    (void)SecurityEnable; // Intentionally unreferenced parameter

    if ( MsgType == Match_Desc_rsp )
    txOptions = AF_MSG_ACK_REQUEST;
    else
    txOptions = 0;

    *pBuf++ = Status;
    *pBuf++ = LO_UINT16( nwkAddr );
    *pBuf++ = HI_UINT16( nwkAddr );

    *pBuf++ = Count; // Endpoint/Interface count

    if ( Count )
    {
    len += Count;
    osal_memcpy( pBuf, pEPList, Count );
    }

    FillAndSendTxOptions( &TransSeq, dstAddr, MsgType, len, txOptions );
    }

    我发现这个函数根本就没有使用 pEPList 这个参数,也就是说没有将Endpoint 发送出来。

    附件111111.psd是ZLLRC 入网的抓包文件,请帮忙分析,多谢!

    111111.psd