xbee::frame::APIFrame Class Reference
List of all members.
Detailed Description
Represents a frame of data to be sent to or which was received
from an XBee device
Definition at line 11 of file frame.py.
Member Function Documentation
def xbee::frame::APIFrame::__init__ |
( |
|
self, |
|
|
|
data = '' , |
|
|
|
escaped = False | |
|
) |
| | |
def xbee::frame::APIFrame::checksum |
( |
|
self |
) |
|
checksum: None -> single checksum byte
checksum adds all bytes of the binary, unescaped data in the
frame, saves the last byte of the result, and subtracts it from
0xFF. The final result is the checksum
Definition at line 29 of file frame.py.
def xbee::frame::APIFrame::escape |
( |
|
data |
) |
|
escape: byte string -> byte string
When a 'special' byte is encountered in the given data string,
it is preceded by an escape byte and XORed with 0x20.
Definition at line 105 of file frame.py.
def xbee::frame::APIFrame::fill |
( |
|
self, |
|
|
|
byte | |
|
) |
| | |
fill: byte -> None
Adds the given raw byte to this APIFrame. If this APIFrame is marked
as escaped and this byte is an escape byte, the next byte in a call
to fill() will be unescaped.
Definition at line 123 of file frame.py.
def xbee::frame::APIFrame::len_bytes |
( |
|
self |
) |
|
len_data: None -> (MSB, LSB) 16-bit integer length, two bytes
len_bytes counts the number of bytes to be sent and encodes the
data length in two bytes, big-endian (most significant first).
Definition at line 72 of file frame.py.
def xbee::frame::APIFrame::output |
( |
|
self |
) |
|
output: None -> valid API frame (binary data)
output will produce a valid API frame for transmission to an
XBee module.
Definition at line 82 of file frame.py.
def xbee::frame::APIFrame::parse |
( |
|
self |
) |
|
parse: None -> None
Given a valid API frame, parse extracts the data contained
inside it and verifies it against its checksum
Definition at line 156 of file frame.py.
def xbee::frame::APIFrame::remaining_bytes |
( |
|
self |
) |
|
def xbee::frame::APIFrame::verify |
( |
|
self, |
|
|
|
chksum | |
|
) |
| | |
verify: 1 byte -> boolean
verify checksums the frame, adds the expected checksum, and
determines whether the result is correct. The result should
be 0xFF.
Definition at line 49 of file frame.py.
Member Data Documentation
The documentation for this class was generated from the following file: