Skip to content
This repository has been archived by the owner on Dec 2, 2018. It is now read-only.

Commit

Permalink
Fixed bug in APIFrame.escape()
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalmsten committed Sep 11, 2011
1 parent ae0843a commit 8a13de6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions xbee/frame.py
Expand Up @@ -112,9 +112,8 @@ def escape(data):


escaped_data = b"" escaped_data = b""
for byte in data: for byte in data:
if byte in APIFrame.ESCAPE_BYTES: if intToByte(byteToInt(byte)) in APIFrame.ESCAPE_BYTES:
escaped_data += APIFrame.ESCAPE_BYTE escaped_data += APIFrame.ESCAPE_BYTE

escaped_data += intToByte(0x20 ^ byteToInt(byte)) escaped_data += intToByte(0x20 ^ byteToInt(byte))
else: else:
escaped_data += intToByte(byteToInt(byte)) escaped_data += intToByte(byteToInt(byte))
Expand Down

0 comments on commit 8a13de6

Please sign in to comment.