andrewrapp / xbee-arduino

Arduino library for communicating with XBee radios in API mode
GNU General Public License v2.0
334 stars 162 forks source link

Byte Escaping Hardcoded #71

Closed skyguy126 closed 5 years ago

skyguy126 commented 5 years ago

The XBee::send function is hard-coded to escape all bytes. Please add an option to disable this functionality as my current setup failed to work when bytes were escaped. I had to manually disable it in the XBee::sendByte function to achieve proper functionality.

void XBee::sendByte(uint8_t b, bool escape) {

    escape = false;
...
matthijskooijman commented 5 years ago

IIRC, if you disable byte escaping, then you cannot send some messages (since some bytes are special and then cannot be escaped). Byte escaping is enabled on the XBee side with AP=2, which is documented in the README as a required setting. You probably have AP=1 set instead, hence xbee-arduino is not expected to work.

I hope this solves your issue :-)