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

Returns the 64-bit destination address.

Returns

the 64-bit destination address.

Return type

XBee64BitAddress

See also

property transmit_options

Returns the transmit options bitfield.

Returns

the transmit options bitfield.

Return type

Integer

See also

property rf_data

Returns the RF data to send.

Returns

the RF data to send.

Return type

Bytearray

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 must be escaped.

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 info 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

Returns the 16-bit destination address.

Returns

the 16-bit destination address.

Return type

XBee16BitAddress

See also

property transmit_options

Returns the transmit options bitfield.

Returns

the transmit options bitfield.

Return type

Integer

See also

property rf_data

Returns the RF data to send.

Returns

the RF data to send.

Return type

Bytearray

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 must be escaped.

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 info 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

Returns the transmit status.

Returns

the transmit status.

Return type

TransmitStatus

See also

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 must be escaped.

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 info 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

Returns the 64-bit source address.

Returns

the 64-bit source address.

Return type

XBee64BitAddress

See also

property rssi

Returns the received Signal Strength Indicator (RSSI).

Returns

the received Signal Strength Indicator (RSSI).

Return type

Integer

property receive_options

Returns the receive options bitfield.

Returns

the receive options bitfield.

Return type

Integer

See also

property rf_data

Returns the received RF data.

Returns

the received RF data.

Return type

Bytearray

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 must be escaped.

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 info 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

Returns the 16-bit source address.

Returns

the 16-bit source address.

Return type

XBee16BitAddress

See also

property rssi

Returns the received Signal Strength Indicator (RSSI).

Returns

the received Signal Strength Indicator (RSSI).

Return type

Integer

property receive_options

Returns the receive options bitfield.

Returns

the receive options bitfield.

Return type

Integer

See also

property rf_data

Returns the received RF data.

Returns

the received RF data.

Return type

Bytearray

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 must be escaped.

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 info 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

Returns the 64-bit source address.

Returns

the 64-bit source address.

Return type

XBee64BitAddress

See also

property rssi

Returns the received Signal Strength Indicator (RSSI).

Returns

the received Signal Strength Indicator (RSSI).

Return type

Integer

property receive_options

Returns the receive options bitfield.

Returns

the receive options bitfield.

Return type

Integer

See also

property rf_data

Returns the received RF data.

Returns

the received RF data.

Return type

Bytearray

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 must be escaped.

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 info 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

property io_sample

Returns the IO sample corresponding to the data contained in the packet.

Returns

the IO sample of the packet, None if the

packet has not any data or if the sample could not be generated correctly.

Return type

IOSample

See also

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.

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 must be escaped.

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 info 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

static create_packet(raw, operating_mode)[source]

Override method.

Returns

RX16IOPacket.

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

Returns the 16-bit source address.

Returns

the 16-bit source address.

Return type

XBee16BitAddress

See also

property rssi

Returns the received Signal Strength Indicator (RSSI).

Returns

the received Signal Strength Indicator (RSSI).

Return type

Integer

property receive_options

Returns the receive options bitfield.

Returns

the receive options bitfield.

Return type

Integer

See also

property rf_data

Returns the received RF data.

Returns

the received RF data.

Return type

Bytearray

property io_sample

Returns the IO sample corresponding to the data contained in the packet.

Returns

the IO sample of the packet, None if the

packet has not any data or if the sample could not be generated correctly.

Return type

IOSample

See also