Other Parts Discussed in Thread: Z-STACK
I use Z-stack mesh 1.0 to develop a small demo network (Actually I used the latest Z-stack Home, but as the problem occur, I thought it was the Z-stack problem, so I move back to Z-stack mesh. Unfortunately, the problem still exist). The coordinator must use the Device_annce message to obtain knowledge of new device joining. Therefore, I call function:
ZDO_RegisterForZDOMsg( HVACQueen_TaskID, Device_annce );
in
userApplication_Init();
to register the Device_annce event. Besides, I put
switch ( MSGpkt->hdr.event )
{
case ZDO_CB_MSG:
HVACQueen_ProcessZDOMsgs((zdoIncomingMsg_t *)MSGpkt);
break;
in the user application event processing function.
Coordinator can receive the Device_annce message properly. Moreover, in the end of the ZDO Msg processing function, I set an event to process the information.
HVACQueen_ProcessZDOMsgs((zdoIncomingMsg_t *)MSGpkt)
{
...
osal_set_event(HVACQueen_TaskID , HVACPTL0_EVENT_TIMEOUT_EVT);
return true;
}
Now, here is the funny thing begin. The coordinator will goes to an error status! The sniffer file is attacked as below:
Moreover, if I comment the osal_set_event(userApplication_TaskID , HVACPTL0_EVENT_TIMEOUT_EVT); in theHVACQueen_ProcessZDOMsgs() function. So the ZDO_CB_MSG handler function will be looks like:
HVACQueen_ProcessZDOMsgs((zdoIncomingMsg_t *)MSGpkt)
{
...
// osal_set_event(HVACQueen_TaskID , HVACPTL0_EVENT_TIMEOUT_EVT);
return true;
}
Then, the coordinator works smoothly as hell. Sniffer file as below. Note that I reset the end-device couple times to repeat join process.