hi TI大侠们
当有新节点加入到网络时会发送device announce包,请问我在哪个方法里可以获得这个包,并解析它的地址信息?
是应用层的uint16 SampleApp_ProcessEvent( uint8 task_id, uint16 events ) 方法的 AF_INCOMING_MSG_CMD事件中吗?
谢谢
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.
你好,
首先需要在你的应用层初始化的时候注册,对device announce的处理函数
// register for end device annce and simple descriptor responses
ZDO_RegisterForZDOMsg( ******, Device_annce );
然后在应用层的 uint16 XXXXX_ProcessEvent( uint8 task_id, uint16 events )函数中case ZDO_CB_MSG:下的XXXXX_ProcessZDOMsgs( (zdoIncomingMsg_t *)MSGpkt );函数中去处理就可以了,只要在里面加上case Device_annce就可以了。
具体你可以参考下Z-stack-2.5.1a下的Esp.c应用程序,这个工程下有相关device anounce的使用方法。