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.

SampleLight程序中哪个变量保存绑定状态



我现在调试zll SamlpleLight程序,已经将程序改为自动绑定,但现在有一个问题:绑定成功后SampleLight仍然不断发送绑定请求包,我想问在程序中哪个变量保存了绑定成功状态,这样我就能判断该状态,如果已经绑定成功则不再发送绑定请求包。

  • 接收绑定请求的设备在收到bind req以后,会回复bind rsp,那么你的发起端如果注册了相应的call back函数的话,就可以处理了。

    /*
    * ZDP_BindRsp - Send a Bind Response
    */
    #define ZDP_BindRsp( TransSeq, dstAddr, Status, SecurityEnable ) \
    ZDP_SendData( &TransSeq, dstAddr, Bind_rsp, 1, &Status, SecurityEnable )

  • 我的灯的程序是zlight - router,我已经找到了入网成功的处理函数,是ZDApp_ProcessNetworkJoin,我是用debugger跟踪到的,入网成功后调用osal_set_event( ZDAppTaskID, ZDO_STATE_CHANGE_EVT )修改状态,但我始终不知道到底是哪个变量保存了状态,而且入网前与入网后的状态各是什么?

     

    后来我自己定义了一个全局变量保存入网状态,在ZDApp.c中外部声明,但这个变量下个轮询又被初始化了,始终保存不了,不知道怎么解决这个问题。