XBee-Pro 900 (API): Little need for escape mode API (AP=2)

XBEE-PRO XB09-DP Firmware version 1002 Hardware version 1B42

I have found that in non-escape API mode (AP=1), the Xbee radio does not care whether there are 0x7E or 0x7D or 0x11 or 0x13 bytes present in the payload. So, if you are not using software flow control and parse the serial output of the modem using the length information that follows the starting 0x7E, you don’t need to use AP=2 (escaped API) at all.

The advantage mode mode=2 is still that you can reset your rx state machine on every 0x7e. very nice in the limited uc space.

so, api mode=2 is recommended when transmitting sensor data but not necessary? how does a frame change when you use the escape character?

ie. you keep the same length, same checksum, insert 7d before the characted that need escaping, and you xor it with 0x20. do i need to also escape the checksum?? if my checksum is ie. 0x7e do i need to escape it too?? what about the dest addresses in a remote AT command,the length bytes and the frame id??

Message was edited by: osegou

Message was edited by: osegou


All bytes after the start delimeter (0x7E) need to be escaped, including the length and checksum bytes, if necessary.