digi.xbee.models.protocol module

class digi.xbee.models.protocol.XBeeProtocol(value)[source]

Bases: enum.Enum

Enumerates the available XBee protocols. The XBee protocol is determined by the combination of hardware and firmware of an XBee device.

Inherited properties:
name (String): the name (id) of this XBeeProtocol.
value (String): the value of this XBeeProtocol.
Values:
XBeeProtocol.ZIGBEE = (0, ‘Zigbee’)
XBeeProtocol.RAW_802_15_4 = (1, ‘802.15.4’)
XBeeProtocol.XBEE_WIFI = (2, ‘Wi-Fi’)
XBeeProtocol.DIGI_MESH = (3, ‘DigiMesh’)
XBeeProtocol.XCITE = (4, ‘XCite’)
XBeeProtocol.XTEND = (5, ‘XTend (Legacy)’)
XBeeProtocol.XTEND_DM = (6, ‘XTend (DigiMesh)’)
XBeeProtocol.SMART_ENERGY = (7, ‘Smart Energy’)
XBeeProtocol.DIGI_POINT = (8, ‘Point-to-multipoint’)
XBeeProtocol.ZNET = (9, ‘ZNet 2.5’)
XBeeProtocol.XC = (10, ‘XSC’)
XBeeProtocol.XLR = (11, ‘XLR’)
XBeeProtocol.XLR_DM = (12, ‘XLR’)
XBeeProtocol.SX = (13, ‘XBee SX’)
XBeeProtocol.XLR_MODULE = (14, ‘XLR Module’)
XBeeProtocol.CELLULAR = (15, ‘Cellular’)
XBeeProtocol.CELLULAR_NBIOT = (16, ‘Cellular NB-IoT’)
XBeeProtocol.UNKNOWN = (99, ‘Unknown’)

property code

Returns the code of the XBeeProtocol element.

Returns

the code of the XBeeProtocol element.

Return type

Integer

property description

Returns the description of the XBeeProtocol element.

Returns

the description of the XBeeProtocol element.

Return type

String

classmethod get(code)[source]

Returns the XBeeProtocol for the given code.

Parameters

code (Integer) – code of the XBeeProtocol to get.

Returns

XBeeProtocol for the given code.

Return type

XBeeProtocol

static determine_protocol(hardware_version, firmware_version, br_value=None)[source]

Determines the XBee protocol based on the given hardware and firmware versions.

Parameters
  • hardware_version (Integer) – hardware version of the protocol to determine.

  • firmware_version (Bytearray) – firmware version of the protocol to determine.

  • br_value (Integer, optional, default=`None`) – Value of BR setting for XBee SX 900/868.

Returns

The XBee protocol corresponding to the given hardware and firmware versions.

class digi.xbee.models.protocol.IPProtocol(value)[source]

Bases: enum.Enum

Enumerates the available network protocols.

Inherited properties:
name (String): the name (id) of this IPProtocol.
value (String): the value of this IPProtocol.
Values:
IPProtocol.UDP = (0, ‘UDP’)
IPProtocol.TCP = (1, ‘TCP’)
IPProtocol.TCP_SSL = (4, ‘TLS’)

property code

Returns the code of the IP protocol.

Returns

code of the IP protocol.

Return type

Integer

property description

Returns the description of the IP protocol.

Returns

description of the IP protocol.

Return type

String

classmethod get(code)[source]

Returns the IPProtocol for the given code.

Parameters

code (Integer) – code associated to the IP protocol.

Returns

IP protocol for the given code or None if

there is not any IPProtocol with the given code.

Return type

IPProtocol

classmethod get_by_description(description)[source]

Returns the IP Protocol for the given description.

Parameters

description (String) – the description of the IP Protocol to get.

Returns

IP protocol for the given description or

None if there is not any IPProtocol with the given description.

Return type

IPProtocol

class digi.xbee.models.protocol.Role(value)[source]

Bases: enum.Enum

Enumerates the available roles for an XBee.

Inherited properties:
name (String): the name (id) of this Role.
value (String): the value of this Role.
Values:
Role.COORDINATOR = (0, ‘Coordinator’)
Role.ROUTER = (1, ‘Router’)
Role.END_DEVICE = (2, ‘End device’)
Role.UNKNOWN = (3, ‘Unknown’)

property id

Gets the identifier of the role.

Returns

the role identifier.

Return type

Integer

property description

Gets the description of the role.

Returns

the role description.

Return type

String

classmethod get(identifier)[source]

Returns the Role for the given identifier.

Parameters

identifier (Integer) – the id value of the role to get.

Returns

the Role with the given identifier. None if it

does not exist.

Return type

Role