Pages: [1]   Go Down
Author Topic: Xbee frame ID best practices  (Read 847 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all!
I am currently working on a xbee sensor with multiple input buttons. Each time one of them is pressed, I send a packet to the coordinator and wait for the TxStatusResponse before acting on it.

Each packet is sent with a different frame ID to differentiate them. The problem is that the TxStatusResponse may not come in the same order as sent.

My problem is how to associate each TxStatusResponse with the appropriate packet sent? I thought about using an associative array to associate each frameID to the proper action code, but I'm not sure if it's the best practice.

And the only associative array I found is the HashMap library (http://www.arduino.cc/playground/Code/HashMap) wich I am not sure is proper for the job.

Any ideas?
Logged

São Paulo/SP/Brazil
Offline Offline
Sr. Member
****
Karma: 2
Posts: 305
Brazilian Arduino Team
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry for resurrect this thread.

I was just thinking the same thing. I want to have a reliable communications among my XBees.

I want to make a queue of packets and remove only when I receive txstatus packets acknowledging delivery.

Some timeout, let's say 2 seconds. It's TCP/IP for XBee smiley-grin
Logged

Pages: [1]   Go Up
Jump to: