I am using CC2530 Zstack-2.3.1-1.4.0 on an application based on the SampleApp project. When I use "AF_DataRequest" with an option of AF_ACK_REQUEST to send message from a router to coordinator: When the coordinator is on, the router works perfectly. When I turn the coordinator off and let the router send the message by calling "AF_DataRequest" with an option of AF_ACK_REQUEST, what I expected is it will give a status information of failure in the incoming information under case “AF_DATA_CONFIRM_CMD” , but I get nothing. At the meantime by using the TI packet sniffer I see that the router keep transmitting the packets forever although I set the APSC_MAX_FRAME_RETRIES = 3. The destination information used in AF_DataRequest is as following:
DstAddr.addrMode = (afAddrMode_t)afAddr16Bit;
DstAddr.addr.shortAddr = 0x0000;
The reason I want to do this experiment is that the coordinator in the network works as a gateway to collect data from all routers, the routers need to know when the coordinator has problem or has been changed so that the routers will rejoin the network. I do not want to use the “many to one” function because it needs send the ManyToOne request every 15 seconds.
I believe there is something wrong in the configuration or some where, but I can not figure out.
I hope someone would help me with this, Thank you very much!
Hello Huilian,
I tried to reproduce your experiment with the Z-Stack-2.5.0. In the test setup I had the Coordinator and Router in my network. I modified the SampleApp Router configuration to send a unicast message to coordinator (with Application level acknowledgement enabled) on SW1 press as in your application. I set a breakpoint inside the AF_DATA_CONFIRM_CMD callback event when status recieved is not sucess.
case AF_DATA_CONFIRM_CMD: afDataConfirm = (afDataConfirm_t *)MSGpkt; if ( afDataConfirm->hdr.status != ZSuccess ) { #define SAMPLEAPP_SEND_MSG_EVT 0x0200 // The data wasn't delivered -- Do something osal_start_timerEx( SampleApp_TaskID,SAMPLEAPP_SEND_MSG_EVT,100 ); //just a test statement ( else section is optimized!) - set breakpoint here } break;
Then after turning OFF the coordinator, I see that breakpoint hits (so stack sends the AF_DATA_CONFIRM_CMD with status failure) after the Stack has tried to send the message NWK_MAX_DATA_RETRIES (defined in f8wConfig.cfg) multipled by 4 times. The status message or reason for confirmation is ZMacNoACK (0xE9), since there were only two devices in the network and the message was'nt acknowledged at MAC layer when coordinator was turned OFF.
Can you confirm if this is the procedure you follow or can you try to repeat the above test, as you should recieve the AF_DATA_CONFIRM_CMD callback, you should not have to do any settings for this.
Also, in your application how often are you sending the message to the coordinator.
Regards
Thank you very much, Suyash.
Yes, that was exactly what I did in Z-Stack-2.3.1-1.4.0.
I need sent the message to the coordinator every 60 seconds.
Would you please try it with Z-Stack-2.3.1-1.4.0?
Thanks a lot.
Huilian