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.