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.

ZDP_NodeDescReq() 的疑问

afStatus_t ZDP_NodeDescReq( zAddrType_t *dstAddr, uint16 NWKAddrOfInterest, byte SecuritySuite ); 

第二个参数应该怎么设定,目的地址不是在dstAddr中已经设定了么

第三个参数怎么设定,是不是设置成true或者false就行了

我将NWKAddrOfInterest设置成目的地址、0x0000、0xffff;协调器调用这个函数都不会有任何反应,用sniffer能够看到终端有数据返回,但是协调器无法触发SYS_EVENT_MSG事件;

程序有调用zcl_registerForMsg();

  • 前一个变量是一个结构体,后一个变量是一个16位的短地址。

    另外有可能前一个变量是一个广播地址,目的是为了找到自己想要的那个节点,所以有两个地址。

    Secure 这个只无所谓,程序里面这个参数没用到。

    实例做法
    /* Destination address */
    destAddr.addrMode = Addr16Bit;
    destAddr.addr.shortAddr = BUILD_UINT16( pBuf[0], pBuf[1] );

    /* Network address of interest */
    shortAddr = BUILD_UINT16( pBuf[0], pBuf[1] );

    retValue = (uint8)ZDP_NodeDescReq( &destAddr, shortAddr, 0);

    接收的话需要注册你call back 函数

    // Register with the ZDO to receive Network Address Responses
    ZDO_RegisterForZDOMsg(task_id, Node_Desc_rsp);

    然后在

    ZDO_CB_MSG:里面去接收做处理

  • 前面的结构体地址使用广播地址有什么作用呢?

    如果指定的网络地址存在,那么不管用广播还是单播都应该可以发送到目标节点吧?使用广播应该合算吧?