If an XBEE module receives 3 incoming messages at the same time,
is there a way to separate the messages, and tell which incoming byte belongs to which message?
Thank you for your help.
If an XBEE module receives 3 incoming messages at the same time,
is there a way to separate the messages, and tell which incoming byte belongs to which message?
Thank you for your help.
You mean three transmitting XBees? Using 802.15.4 mode (not ZigBee)?
Using serial port emulation firmware in the XBee?
If yes, the easiest scheme is to insert some bytes in every message that identify the sending node. Alternatively, you can implement the API and keep track of addresses, etc. That’s somewhat complex.
I was thinking of cutting up each byte you send into 2 bytes with 2 4-bit nibbles, like this:
1st byte, 1st nibble: sender’s address
1st byte, 2nd nibble: 1st nibble of message byte
2nd byte, 1st nibble: sender’s address
2nd byte, 2nd nibble: 2nd nibble of message byte
What do you think?
what I’ve implemented is a simple layer 3 packet protocol so that I get end to end packet error detection and correction, independent of 802.15.4.
Each packet’s payload has
8 bit sequence number, increments each packet except for re-transmitted packets.
source node ID number, say 8 or 16 bits
packet type code, 8 bits, e.g., data versus ACK or NAK or other
Protocol says
Sending node uses sequence number. and sends data-type packet.
Receiving node validates sequence number. If out-of-sequence, receiving node sends NAK or nothing.
Sending device waits for ACK message with matching sequence number. If timed-out, retransmit up to n times before giving up.
Increment sequence number upon receipt of ACK with correct sequence number.
and so on.