Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | List of all members
xbee.frame.APIFrame Class Reference

Public Member Functions

def __init__ (self, data='', escaped=False)
 
def checksum (self)
 
def fill (self, byte)
 
def len_bytes (self)
 
def output (self)
 
def parse (self)
 
def remaining_bytes (self)
 
def verify (self, chksum)
 

Static Public Member Functions

def escape (data)
 

Public Attributes

 data
 
 escaped
 
 raw_data
 

Static Public Attributes

string ESCAPE_BYTE = '\x7D'
 
tuple ESCAPE_BYTES = (START_BYTE, ESCAPE_BYTE, XON_BYTE, XOFF_BYTE)
 
string START_BYTE = '\x7E'
 
string XOFF_BYTE = '\x13'
 
string XON_BYTE = '\x11'
 

Private Attributes

 _unescape_next_byte
 

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.

Constructor & Destructor Documentation

def xbee.frame.APIFrame.__init__ (   self,
  data = '',
  escaped = False 
)

Definition at line 23 of file frame.py.

Member Function Documentation

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)
static
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)

Definition at line 141 of file frame.py.

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

xbee.frame.APIFrame._unescape_next_byte
private

Definition at line 27 of file frame.py.

xbee.frame.APIFrame.data

Definition at line 24 of file frame.py.

string xbee.frame.APIFrame.ESCAPE_BYTE = '\x7D'
static

Definition at line 18 of file frame.py.

tuple xbee.frame.APIFrame.ESCAPE_BYTES = (START_BYTE, ESCAPE_BYTE, XON_BYTE, XOFF_BYTE)
static

Definition at line 21 of file frame.py.

xbee.frame.APIFrame.escaped

Definition at line 26 of file frame.py.

xbee.frame.APIFrame.raw_data

Definition at line 25 of file frame.py.

string xbee.frame.APIFrame.START_BYTE = '\x7E'
static

Definition at line 17 of file frame.py.

string xbee.frame.APIFrame.XOFF_BYTE = '\x13'
static

Definition at line 20 of file frame.py.

string xbee.frame.APIFrame.XON_BYTE = '\x11'
static

Definition at line 19 of file frame.py.


The documentation for this class was generated from the following file:


rosserial_xbee
Author(s): Adam Stambler
autogenerated on Fri Jun 7 2019 22:03:11