I have a quick question...
I am about to enable the end device polling of its parent for data. I currently only send periodic packets from the end device to whatever routers are one hop away and I would like to add the ability to send an occasional packet from the routers to the end devices.
My question is if it is possible instead of pre-arranging the packet in the router and waiting for the poll to arrive, if it is possible to create the packet immediately when the poll arrives.
The scenario is that I will have a long poll interval, 30 seconds or longer, and when the parent receives the poll, if it does not have a data packet, it might respond with a timestamp or other synchronization information that will have to be generated at the time of the poll being received.
I think this would require some kind of callback to the main processor. Does this exist for automatically enabled end-device polls? Or is the only way to do this with the end device's application generating its own polls using data request calls? If I have to use a data request to poll for data, is there a way to have the CC2480 remain awake to await a data packet from the parent following the ack of the data request? I know there is the RESPONSE_POLL_RATE parameter which sets the polling rate to a shorter value following a data request send. Does this work if the main polling is turned off?
Okay, not such a quick question after all, but I think what I am getting at is kind of straightforward.
Let me try to answer my own question, and you can just say that what I am thinking is correct...
The end device poll can only receive packets pre-requested in the parent that have not yet timed out as set by INDIRECT_MSG_TIMEOUT. There is no call back to the application processor when a poll is received, except for maybe a SEND_DATA_CONFIRM if a packet was previously queued and was fetched with the poll.
Therefore, the only way to do what I want to do is with the following steps:
1) set POLL_RATE to anything but 0, this will allow the end device to receive any queued messages, this will also keep the end device rejoining and finding a new parent when it moves
2) set RESPONSE_POLL_RATE to something reasonable, like 10ms
3) have my end-device application periodically send data request packets to its parent to ask for time sensitive data
4) have my router application on the parent receive the incoming msg indication callback (the CC2480 should have already acked the packet, so that the end-device will start the 10ms counter). and within 10ms execute a send data request with the timestamp for that child node.
5) the end device automatically polls in 10ms and sends the indication to the application processor and then goes to sleep.
Is that the only way and a good way to do this?
Thanks, and I can probably share my code whenever I get this working.
-mat