digi.xbee.models.protocol module

class digi.xbee.models.protocol.XBeeProtocol(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: 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.BLE = (17, ‘BLE’)
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:

class: .XBeeProtocol: XBeeProtocol for the given code.

static is_ip_protocol(protocol)[source]

Checks if the provided protocol is an IP protocol.

Parameters:

( (protocol) – class: .XBeeProtocol): The protocol to check.

Returns:

True if it is an IP protocol, False otherwise.

Return type:

Boolean

static determine_protocol(hw_version, fw_version, br_value=None)[source]

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

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

  • fw_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:

class: .XBeeProtocol: The XBee protocol corresponding to the

given hardware and firmware versions.

class digi.xbee.models.protocol.IPProtocol(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: 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, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: 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

class digi.xbee.models.protocol.Region(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Enumerates the available regions for an XBee.

Inherited properties:
name (String): the name (id) of this Region.
value (String): the value of this Region.
Values:
Any (0) = (0, ‘Any’)
USA (1) = (1, ‘USA’)
Australia (2) = (2, ‘Australia’)
Brazil (3) = (3, ‘Brazil’)
Mexico (4) = (4, ‘Mexico’)
Peru (5) = (5, ‘Peru’)
New Zealand (6) = (6, ‘New Zealand’)
Singapore (7) = (7, ‘Singapore’)
Chile (8) = (8, ‘Chile’)
France (9) = (9, ‘France’)
Europe (10) = (10, ‘Europe’)
Skip (99) = (99, ‘Skip’)
Unknown (999) = (999, ‘Unknown’)
Any (65535) = (65535, ‘Any’)

property id

Gets the identifier of the region.

Returns:

the region identifier.

Return type:

Integer

property description

Gets the description of the region.

Returns:

the region description.

Return type:

String

classmethod get(identifier)[source]

Returns the Region for the given identifier.

Parameters:

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

Returns:

the Region with the given identifier. None if it

does not exist.

Return type:

Region

allows_any()[source]

Returns whether this region accepts any region specified in the firmware.

Returns:

True if this region accepts any region False otherwise.

Return type:

Boolean

class digi.xbee.models.protocol.OTAMethod(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Enumerates the over-the-air firmware update mechanisms of XBee modules.