digi.xbee.packets.raw module

class digi.xbee.packets.raw.TX64Packet(frame_id, x64bit_addr, transmit_options, rf_data=None)[source]

Bases: digi.xbee.packets.base.XBeeAPIPacket

This class represents a TX (Transmit) 64 Request packet. Packet is built using the parameters of the constructor or providing a valid byte array.

A TX Request message will cause the module to transmit data as an RF Packet.

See also

Class constructor. Instantiates a new TX64Packet object with the provided parameters.

Parameters
  • frame_id (Integer) – the frame ID of the packet.

  • x64bit_addr (XBee64BitAddress) – the 64-bit destination address.

  • transmit_options (Integer) – bitfield of supported transmission options.

  • rf_data (Bytearray, optional) – RF data that is sent to the destination device. Optional.

Raises

ValueError – if frame_id is less than 0 or greater than 255.

static create_packet(raw, operating_mode)[source]

Override method.

Returns

TX64Packet.

Raises

See also

XBeeAPIPacket._check_api_packet()
needs_id()[source]

Override method.

property x64bit_dest_addr

XBee64BitAddress. 64-bit destination address.

property transmit_options

Integer. Transmit options bitfield.

property rf_data

Bytearray. RF data to send.

property frame_id

Returns the frame ID of the packet.

Returns

the frame ID of the packet.

Return type

Integer

get_checksum()

Returns the checksum value of this XBeePacket.

The checksum is the last 8 bits of the sum of the bytes between the length field and the checksum field.

Returns

checksum value of this XBeePacket.

Return type

Integer

See also

get_frame_spec_data()

Override method.

get_frame_type()

Returns the frame type of this packet.

Returns

the frame type of this packet.

Return type

ApiFrameType

See also

get_frame_type_value()

Returns the frame type integer value of this packet.

Returns

the frame type integer value of this packet.

Return type

Integer

See also

is_broadcast()

Returns whether this packet is broadcast or not.

Returns

True if this packet is broadcast, False otherwise.

Return type

Boolean

output(escaped=False)

Returns the raw bytearray of this XBeePacket, ready to be send by the serial port.

Parameters

escaped (Boolean) – indicates if the raw bytearray will be escaped or not.

Returns

raw bytearray of the XBeePacket.

Return type

Bytearray

to_dict()

Returns a dictionary with all information of the XBeePacket fields.

Returns

dictionary with all information of the XBeePacket fields.

Return type

Dictionary

static unescape_data(data)

Un-escapes the provided bytearray data.

Parameters

data (Bytearray) – the bytearray to unescape.

Returns

data unescaped.

Return type

Bytearray

class digi.xbee.packets.raw.TX16Packet(frame_id, x16bit_addr, transmit_options, rf_data=None)[source]

Bases: digi.xbee.packets.base.XBeeAPIPacket

This class represents a TX (Transmit) 16 Request packet. Packet is built using the parameters of the constructor or providing a valid byte array.

A TX request message will cause the module to transmit data as an RF packet.

See also

Class constructor. Instantiates a new TX16Packet object with the provided parameters.

Parameters
  • frame_id (Integer) – the frame ID of the packet.

  • x16bit_addr (XBee16BitAddress) – the 16-bit destination address.

  • transmit_options (Integer) – bitfield of supported transmission options.

  • rf_data (Bytearray, optional) – RF data that is sent to the destination device. Optional.

Raises

ValueError – if frame_id is less than 0 or greater than 255.

static create_packet(raw, operating_mode)[source]

Override method.

Returns

TX16Packet.

Raises

See also

XBeeAPIPacket._check_api_packet()
needs_id()[source]

Override method.

property x16bit_dest_addr

XBee64BitAddress. 16-bit destination address.

property transmit_options

Integer. Transmit options bitfield.

property rf_data

Bytearray. RF data to send.

property frame_id

Returns the frame ID of the packet.

Returns

the frame ID of the packet.

Return type

Integer

get_checksum()

Returns the checksum value of this XBeePacket.

The checksum is the last 8 bits of the sum of the bytes between the length field and the checksum field.

Returns

checksum value of this XBeePacket.

Return type

Integer

See also

get_frame_spec_data()

Override method.

get_frame_type()

Returns the frame type of this packet.

Returns

the frame type of this packet.

Return type

ApiFrameType

See also

get_frame_type_value()

Returns the frame type integer value of this packet.

Returns

the frame type integer value of this packet.

Return type

Integer

See also

is_broadcast()

Returns whether this packet is broadcast or not.

Returns

True if this packet is broadcast, False otherwise.

Return type

Boolean

output(escaped=False)

Returns the raw bytearray of this XBeePacket, ready to be send by the serial port.

Parameters

escaped (Boolean) – indicates if the raw bytearray will be escaped or not.

Returns

raw bytearray of the XBeePacket.

Return type

Bytearray

to_dict()

Returns a dictionary with all information of the XBeePacket fields.

Returns

dictionary with all information of the XBeePacket fields.

Return type

Dictionary

static unescape_data(data)

Un-escapes the provided bytearray data.

Parameters

data (Bytearray) – the bytearray to unescape.

Returns

data unescaped.

Return type

Bytearray

class digi.xbee.packets.raw.TXStatusPacket(frame_id, transmit_status)[source]

Bases: digi.xbee.packets.base.XBeeAPIPacket

This class represents a TX (Transmit) status packet. Packet is built using the parameters of the constructor or providing a valid API payload.

When a TX request is completed, the module sends a TX status message. This message will indicate if the packet was transmitted successfully or if there was a failure.

Class constructor. Instantiates a new TXStatusPacket object with the provided parameters.

Parameters
  • frame_id (Integer) – the frame ID of the packet.

  • transmit_status (TransmitStatus) – transmit status. Default: SUCCESS.

Raises

ValueError – if frame_id is less than 0 or greater than 255.

static create_packet(raw, operating_mode)[source]

Override method.

Returns

TXStatusPacket.

Raises

See also

XBeeAPIPacket._check_api_packet()
needs_id()[source]

Override method.

property transmit_status

TransmitStatus. Transmit status.

property frame_id

Returns the frame ID of the packet.

Returns

the frame ID of the packet.

Return type

Integer

get_checksum()

Returns the checksum value of this XBeePacket.

The checksum is the last 8 bits of the sum of the bytes between the length field and the checksum field.

Returns

checksum value of this XBeePacket.

Return type

Integer

See also

get_frame_spec_data()

Override method.

get_frame_type()

Returns the frame type of this packet.

Returns

the frame type of this packet.

Return type

ApiFrameType

See also

get_frame_type_value()

Returns the frame type integer value of this packet.

Returns

the frame type integer value of this packet.

Return type

Integer

See also

is_broadcast()

Returns whether this packet is broadcast or not.

Returns

True if this packet is broadcast, False otherwise.

Return type

Boolean

output(escaped=False)

Returns the raw bytearray of this XBeePacket, ready to be send by the serial port.

Parameters

escaped (Boolean) – indicates if the raw bytearray will be escaped or not.

Returns

raw bytearray of the XBeePacket.

Return type

Bytearray

to_dict()

Returns a dictionary with all information of the XBeePacket fields.

Returns

dictionary with all information of the XBeePacket fields.

Return type

Dictionary

static unescape_data(data)

Un-escapes the provided bytearray data.

Parameters

data (Bytearray) – the bytearray to unescape.

Returns

data unescaped.

Return type

Bytearray

class digi.xbee.packets.raw.RX64Packet(x64bit_addr, rssi, receive_options, rf_data=None)[source]

Bases: digi.xbee.packets.base.XBeeAPIPacket

This class represents an RX (Receive) 64 request packet. Packet is built using the parameters of the constructor or providing a valid API byte array.

When the module receives an RF packet, it is sent out the UART using this message type.

This packet is the response to TX (transmit) 64 request packets.

Class constructor. Instantiates a RX64Packet object with the provided parameters.

Parameters
  • x64bit_addr (XBee64BitAddress) – the 64-bit source address.

  • rssi (Integer) – received signal strength indicator.

  • receive_options (Integer) – bitfield indicating the receive options.

  • rf_data (Bytearray, optional) – received RF data. Optional.

static create_packet(raw, operating_mode)[source]

Override method.

Returns

RX64Packet

Raises

See also

XBeeAPIPacket._check_api_packet()
needs_id()[source]

Override method.

is_broadcast()[source]

Override method.

See also

XBeeAPIPacket.is_broadcast()
property x64bit_source_addr

XBee64BitAddress. 64-bit source address.

property rssi

Integer. Received Signal Strength Indicator (RSSI) value.

property receive_options

Integer. Receive options bitfield.

property rf_data

Bytearray. Received RF data.

property frame_id

Returns the frame ID of the packet.

Returns

the frame ID of the packet.

Return type

Integer

get_checksum()

Returns the checksum value of this XBeePacket.

The checksum is the last 8 bits of the sum of the bytes between the length field and the checksum field.

Returns

checksum value of this XBeePacket.

Return type

Integer

See also

get_frame_spec_data()

Override method.

get_frame_type()

Returns the frame type of this packet.

Returns

the frame type of this packet.

Return type

ApiFrameType

See also

get_frame_type_value()

Returns the frame type integer value of this packet.

Returns

the frame type integer value of this packet.

Return type

Integer

See also

output(escaped=False)

Returns the raw bytearray of this XBeePacket, ready to be send by the serial port.

Parameters

escaped (Boolean) – indicates if the raw bytearray will be escaped or not.

Returns

raw bytearray of the XBeePacket.

Return type

Bytearray

to_dict()

Returns a dictionary with all information of the XBeePacket fields.

Returns

dictionary with all information of the XBeePacket fields.

Return type

Dictionary

static unescape_data(data)

Un-escapes the provided bytearray data.

Parameters

data (Bytearray) – the bytearray to unescape.

Returns

data unescaped.

Return type

Bytearray

class digi.xbee.packets.raw.RX16Packet(x16bit_addr, rssi, receive_options, rf_data=None)[source]

Bases: digi.xbee.packets.base.XBeeAPIPacket

This class represents an RX (Receive) 16 Request packet. Packet is built using the parameters of the constructor or providing a valid API byte array.

When the module receives an RF packet, it is sent out the UART using this message type

This packet is the response to TX (Transmit) 16 Request packets.

Class constructor. Instantiates a RX16Packet object with the provided parameters.

Parameters
  • x16bit_addr (XBee16BitAddress) – the 16-bit source address.

  • rssi (Integer) – received signal strength indicator.

  • receive_options (Integer) – bitfield indicating the receive options.

  • rf_data (Bytearray, optional) – received RF data. Optional.

static create_packet(raw, operating_mode)[source]

Override method.

Returns

RX16Packet.

Raises

See also

XBeeAPIPacket._check_api_packet()
needs_id()[source]

Override method.

is_broadcast()[source]

Override method.

See also

XBeeAPIPacket.is_broadcast()
property x16bit_source_addr

XBee16BitAddress. 16-bit source address.

property rssi

Integer. Received Signal Strength Indicator (RSSI) value.

property receive_options

Integer. Receive options bitfield.

property rf_data

Bytearray. Received RF data.

property frame_id

Returns the frame ID of the packet.

Returns

the frame ID of the packet.

Return type

Integer

get_checksum()

Returns the checksum value of this XBeePacket.

The checksum is the last 8 bits of the sum of the bytes between the length field and the checksum field.

Returns

checksum value of this XBeePacket.

Return type

Integer

See also

get_frame_spec_data()

Override method.

get_frame_type()

Returns the frame type of this packet.

Returns

the frame type of this packet.

Return type

ApiFrameType

See also

get_frame_type_value()

Returns the frame type integer value of this packet.

Returns

the frame type integer value of this packet.

Return type

Integer

See also

output(escaped=False)

Returns the raw bytearray of this XBeePacket, ready to be send by the serial port.

Parameters

escaped (Boolean) – indicates if the raw bytearray will be escaped or not.

Returns

raw bytearray of the XBeePacket.

Return type

Bytearray

to_dict()

Returns a dictionary with all information of the XBeePacket fields.

Returns

dictionary with all information of the XBeePacket fields.

Return type

Dictionary

static unescape_data(data)

Un-escapes the provided bytearray data.

Parameters

data (Bytearray) – the bytearray to unescape.

Returns

data unescaped.

Return type

Bytearray

class digi.xbee.packets.raw.RX64IOPacket(x64bit_addr, rssi, receive_options, rf_data)[source]

Bases: digi.xbee.packets.base.XBeeAPIPacket

This class represents an RX64 address IO packet. Packet is built using the parameters of the constructor or providing a valid API payload.

I/O data is sent out the UART using an API frame.

See also

Class constructor. Instantiates an RX64IOPacket object with the provided parameters.

Parameters
  • x64bit_addr (XBee64BitAddress) – the 64-bit source address.

  • rssi (Integer) – received signal strength indicator.

  • receive_options (Integer) – bitfield indicating the receive options.

  • rf_data (Bytearray) – received RF data.

static create_packet(raw, operating_mode)[source]

Override method.

Returns

RX64IOPacket.

Raises

See also

XBeeAPIPacket._check_api_packet()
needs_id()[source]

Override method.

is_broadcast()[source]

Override method.

See also

XBeeAPIPacket.is_broadcast()
property x64bit_source_addr

XBee64BitAddress. 64-bit source address.

property rssi

Integer. Received Signal Strength Indicator (RSSI) value.

property receive_options

Integer. Receive options bitfield.

property rf_data

Bytearray. Received RF data.

property io_sample

IOSample: IO sample corresponding to the data contained in the packet.

property frame_id

Returns the frame ID of the packet.

Returns

the frame ID of the packet.

Return type

Integer

get_checksum()

Returns the checksum value of this XBeePacket.

The checksum is the last 8 bits of the sum of the bytes between the length field and the checksum field.

Returns

checksum value of this XBeePacket.

Return type

Integer

See also

get_frame_spec_data()

Override method.

get_frame_type()

Returns the frame type of this packet.

Returns

the frame type of this packet.

Return type

ApiFrameType

See also

get_frame_type_value()

Returns the frame type integer value of this packet.

Returns

the frame type integer value of this packet.

Return type

Integer

See also

output(escaped=False)

Returns the raw bytearray of this XBeePacket, ready to be send by the serial port.

Parameters

escaped (Boolean) – indicates if the raw bytearray will be escaped or not.

Returns

raw bytearray of the XBeePacket.

Return type

Bytearray

to_dict()

Returns a dictionary with all information of the XBeePacket fields.

Returns

dictionary with all information of the XBeePacket fields.

Return type

Dictionary

static unescape_data(data)

Un-escapes the provided bytearray data.

Parameters

data (Bytearray) – the bytearray to unescape.

Returns

data unescaped.

Return type

Bytearray

class digi.xbee.packets.raw.RX16IOPacket(x16bit_addr, rssi, receive_options, rf_data)[source]

Bases: digi.xbee.packets.base.XBeeAPIPacket

This class represents an RX16 address IO packet. Packet is built using the parameters of the constructor or providing a valid byte array.

I/O data is sent out the UART using an API frame.

See also

Class constructor. Instantiates an RX16IOPacket object with the provided parameters.

Parameters
  • x16bit_addr (XBee16BitAddress) – the 16-bit source address.

  • rssi (Integer) – received signal strength indicator.

  • receive_options (Integer) – bitfield indicating the receive options.

  • rf_data (Bytearray) – received RF data.

static create_packet(raw, operating_mode)[source]

Override method.

Returns

RX16IOPacket.

Raises

See also

XBeeAPIPacket._check_api_packet()
property frame_id

Returns the frame ID of the packet.

Returns

the frame ID of the packet.

Return type

Integer

get_checksum()

Returns the checksum value of this XBeePacket.

The checksum is the last 8 bits of the sum of the bytes between the length field and the checksum field.

Returns

checksum value of this XBeePacket.

Return type

Integer

See also

get_frame_spec_data()

Override method.

get_frame_type()

Returns the frame type of this packet.

Returns

the frame type of this packet.

Return type

ApiFrameType

See also

get_frame_type_value()

Returns the frame type integer value of this packet.

Returns

the frame type integer value of this packet.

Return type

Integer

See also

output(escaped=False)

Returns the raw bytearray of this XBeePacket, ready to be send by the serial port.

Parameters

escaped (Boolean) – indicates if the raw bytearray will be escaped or not.

Returns

raw bytearray of the XBeePacket.

Return type

Bytearray

to_dict()

Returns a dictionary with all information of the XBeePacket fields.

Returns

dictionary with all information of the XBeePacket fields.

Return type

Dictionary

static unescape_data(data)

Un-escapes the provided bytearray data.

Parameters

data (Bytearray) – the bytearray to unescape.

Returns

data unescaped.

Return type

Bytearray

needs_id()[source]

Override method.

is_broadcast()[source]

Override method.

See also

XBeeAPIPacket.is_broadcast()
property x16bit_source_addr

XBee16BitAddress. 16-bit source address.

property rssi

Integer. Received Signal Strength Indicator (RSSI) value.

property receive_options

Integer. Receive options bitfield.

property rf_data

Bytearray. Received RF data.

property io_sample

IOSample: IO sample corresponding to the data contained in the packet.