digi.xbee.models.options module

class digi.xbee.models.options.ReceiveOptions(value)[source]

Bases: enum.Enum

This class lists all the possible options that have been set while receiving an XBee packet.

The receive options are usually set as a bitfield meaning that the options can be combined using the ‘|’ operand.

Values:
ReceiveOptions.NONE = 0
ReceiveOptions.PACKET_ACKNOWLEDGED = 1
ReceiveOptions.BROADCAST_PACKET = 2
ReceiveOptions.BROADCAST_PANS_PACKET = 4
ReceiveOptions.SECURE_SESSION_ENC = 16
ReceiveOptions.APS_ENCRYPTED = 32
ReceiveOptions.SENT_FROM_END_DEVICE = 64
ReceiveOptions.REPEATER_MODE = 128
ReceiveOptions.DIGIMESH_MODE = 192

NONE = 0

No special receive options.

PACKET_ACKNOWLEDGED = 1

Packet was acknowledged.

Not valid for WiFi protocol.

BROADCAST_PACKET = 2

Packet was sent as a broadcast.

Not valid for WiFi protocol.

BROADCAST_PANS_PACKET = 4

Packet was broadcast accros all PANs.

Only for 802.15.4 protocol.

SECURE_SESSION_ENC = 16

Packet sent across a Secure Session.

Only for XBee 3.

APS_ENCRYPTED = 32

Packet encrypted with APS encryption.

Only valid for Zigbee protocol.

SENT_FROM_END_DEVICE = 64

Packet was sent from an end device (if known).

Only valid for Zigbee protocol.

POINT_MULTIPOINT_MODE = 64

Transmission is performed using point-to-Multipoint mode.

Only valid for DigiMesh 868/900 and Point-to-Multipoint 868/900 protocols.

REPEATER_MODE = 128

Transmission is performed using repeater mode.

Only valid for DigiMesh 868/900 and Point-to-Multipoint 868/900 protocols.

DIGIMESH_MODE = 192

Transmission is performed using DigiMesh mode.

Only valid for DigiMesh 868/900 and Point-to-Multipoint 868/900 protocols.

class digi.xbee.models.options.TransmitOptions(value)[source]

Bases: enum.Enum

This class lists all the possible options that can be set while transmitting an XBee packet.

The transmit options are usually set as a bitfield meaning that the options can be combined using the ‘|’ operand.

Not all options are available for all cases, that’s why there are different names with same values. In each moment, you must be sure that the option your are going to use, is a valid option in your context.

Values:
TransmitOptions.NONE = 0
TransmitOptions.DISABLE_ACK = 1
TransmitOptions.DONT_ATTEMPT_RD = 2
TransmitOptions.USE_BROADCAST_PAN_ID = 4
TransmitOptions.ENABLE_MULTICAST = 8
TransmitOptions.SECURE_SESSION_ENC = 16
TransmitOptions.ENABLE_APS_ENCRYPTION = 32
TransmitOptions.USE_EXTENDED_TIMEOUT = 64
TransmitOptions.REPEATER_MODE = 128
TransmitOptions.DIGIMESH_MODE = 192

NONE = 0

No special transmit options.

DISABLE_ACK = 1

Disables acknowledgments on all unicasts.

Only valid for Zigbee, DigiMesh, 802.15.4, and Point-to-multipoint protocols.

DISABLE_RETRIES_AND_REPAIR = 1

Disables the retries and router repair in the frame.

Only valid for Zigbee protocol.

DONT_ATTEMPT_RD = 2

Doesn’t attempt Route Discovery.

Disables Route Discovery on all DigiMesh unicasts.

Only valid for DigiMesh protocol.

BROADCAST_PAN = 2

Sends packet with broadcast {@code PAN ID}. Packet will be sent to all PANs.

Only valid for 802.15.4 XBee 3 protocol.

USE_BROADCAST_PAN_ID = 4

Sends packet with broadcast {@code PAN ID}. Packet will be sent to all devices in the same channel ignoring the {@code PAN ID}.

It cannot be combined with other options.

Only valid for 802.15.4 XBee protocol.

ENABLE_UNICAST_NACK = 4

Enables unicast NACK messages.

NACK message is enabled on the packet.

Only valid for DigiMesh 868/900 protocol, and XBee 3 DigiMesh.

ENABLE_UNICAST_TRACE_ROUTE = 4

Enables unicast trace route messages.

Trace route is enabled on the packets.

Only valid for DigiMesh 868/900 protocol.

INDIRECT_TRANSMISSION = 4

Used for binding transmissions.

Only valid for Zigbee protocol.

ENABLE_MULTICAST = 8

Enables multicast transmission request.

Only valid for Zigbee XBee protocol.

ENABLE_TRACE_ROUTE = 8

Enable a unicast Trace Route on DigiMesh transmissions When set, the transmission will generate a Route Information - 0x8D frame.

Only valid for DigiMesh XBee protocol.

SECURE_SESSION_ENC = 16

Encrypt payload for transmission across a Secure Session. Reduces maximum payload size by 4 bytes.

Only for XBee 3.

ENABLE_APS_ENCRYPTION = 32

Enables APS encryption, only if {@code EE=1}.

Enabling APS encryption decreases the maximum number of RF payload bytes by 4 (below the value reported by {@code NP}).

Only valid for Zigbee XBee protocol.

USE_EXTENDED_TIMEOUT = 64

Uses the extended transmission timeout.

Setting the extended timeout bit causes the stack to set the extended transmission timeout for the destination address.

Only valid for Zigbee XBee protocol.

POINT_MULTIPOINT_MODE = 64

Transmission is performed using point-to-Multipoint mode.

Only valid for DigiMesh 868/900 and Point-to-Multipoint 868/900 protocols.

REPEATER_MODE = 128

Transmission is performed using repeater mode.

Only valid for DigiMesh 868/900 and Point-to-Multipoint 868/900 protocols.

DIGIMESH_MODE = 192

Transmission is performed using DigiMesh mode.

Only valid for DigiMesh 868/900 and Point-to-Multipoint 868/900 protocols.

class digi.xbee.models.options.RemoteATCmdOptions(value)[source]

Bases: enum.Enum

This class lists all the possible options that can be set while transmitting a remote AT Command.

These options are usually set as a bitfield meaning that the options can be combined using the ‘|’ operand.

Values:
RemoteATCmdOptions.NONE = 0
RemoteATCmdOptions.DISABLE_ACK = 1
RemoteATCmdOptions.APPLY_CHANGES = 2
RemoteATCmdOptions.SECURE_SESSION_ENC = 16
RemoteATCmdOptions.EXTENDED_TIMEOUT = 64

NONE = 0

No special transmit options

DISABLE_ACK = 1

Disables ACK

APPLY_CHANGES = 2

Applies changes in the remote device.

If this option is not set, AC command must be sent before changes will take effect.

SECURE_SESSION_ENC = 16

Send the remote command securely. Requires a Secure Session be established with the destination.

Only for XBee 3.

EXTENDED_TIMEOUT = 64

Uses the extended transmission timeout.

Setting the extended timeout bit causes the stack to set the extended transmission timeout for the destination address.

Only valid for ZigBee XBee protocol.

class digi.xbee.models.options.SendDataRequestOptions(value)[source]

Bases: enum.Enum

Enumerates the different options for the SendDataRequestPacket.

Values:
SendDataRequestOptions.OVERWRITE = (0, ‘Overwrite’)
SendDataRequestOptions.ARCHIVE = (1, ‘Archive’)
SendDataRequestOptions.APPEND = (2, ‘Append’)
SendDataRequestOptions.TRANSIENT = (3, ‘Transient data (do not store)’)

property code

Returns the code of the SendDataRequestOptions element.

Returns

the code of the SendDataRequestOptions element.

Return type

Integer

property description

Returns the description of the SendDataRequestOptions element.

Returns

the description of the SendDataRequestOptions element.

Return type

String

classmethod get(code)[source]

Returns the send data request option for the given code.

Parameters

code (Integer) – the code of the send data request option to get.

Returns

the SendDataRequestOptions with the given

code, None if not found.

Return type

FrameError

class digi.xbee.models.options.DiscoveryOptions(value)[source]

Bases: enum.Enum

Enumerates the different options used in the discovery process.

Values:
DiscoveryOptions.APPEND_DD = (1, ‘Append device type identifier (DD)’)
DiscoveryOptions.DISCOVER_MYSELF = (2, ‘Local device sends response frame’)
DiscoveryOptions.APPEND_RSSI = (4, ‘Append RSSI (of the last hop)’)

APPEND_DD = (1, 'Append device type identifier (DD)')

Append device type identifier (DD) to the discovery response.

Valid for the following protocols:
  • DigiMesh

  • Point-to-multipoint (Digi Point)

  • Zigbee

DISCOVER_MYSELF = (2, 'Local device sends response frame')

Local device sends response frame when discovery is issued.

Valid for the following protocols:
  • DigiMesh

  • Point-to-multipoint (Digi Point)

  • Zigbee

  • 802.15.4

APPEND_RSSI = (4, 'Append RSSI (of the last hop)')

Append RSSI of the last hop to the discovery response.

Valid for the following protocols:
  • DigiMesh

  • Point-to-multipoint (Digi Point)

property code

Returns the code of the DiscoveryOptions element.

Returns

the code of the DiscoveryOptions element.

Return type

Integer

property description

Returns the description of the DiscoveryOptions element.

Returns

the description of the DiscoveryOptions element.

Return type

String

classmethod get(code)[source]

Returns the DiscoveryOptions for the given code.

Parameters

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

Returns

the DiscoveryOptions with the given code,

None if not found.

Return type

FrameError

static calculate_discovery_value(protocol, options)[source]

Calculates the total value of a combination of several options for the given protocol.

Parameters
  • protocol (XBeeProtocol) – the XBeeProtocol to calculate the value of all the given discovery options.

  • options – collection of options to get the final value.

Returns

The value to be configured in the module depending on the

given collection of options and the protocol.

Return type

Integer

class digi.xbee.models.options.XBeeLocalInterface(value)[source]

Bases: enum.Enum

Enumerates the different interfaces for the UserDataRelayPacket and UserDataRelayOutputPacket.

Inherited properties:
name (String): the name (id) of the XBee local interface.
value (String): the value of the XBee local interface.
Values:
XBeeLocalInterface.SERIAL = (0, ‘Serial port (UART when in API mode, or SPI interface)’)
XBeeLocalInterface.BLUETOOTH = (1, ‘BLE API interface (on XBee devices which support BLE)’)
XBeeLocalInterface.MICROPYTHON = (2, ‘MicroPython’)
XBeeLocalInterface.UNKNOWN = (255, ‘Unknown interface’)

property code

Returns the code of the XBeeLocalInterface element.

Returns

the code of the XBeeLocalInterface element.

Return type

Integer

property description

Returns the description of the XBeeLocalInterface element.

Returns

the description of the XBeeLocalInterface element.

Return type

String

classmethod get(code)[source]

Returns the XBee local interface option for the given code.

Parameters

code (Integer) – the code of the XBee local interface to get.

Returns

the XBeeLocalInterface with the

given code, UNKNOWN if not found.

Return type

XBeeLocalInterface

class digi.xbee.models.options.RegisterKeyOptions(value)[source]

Bases: enum.Enum

This class lists all the possible options that have been set while receiving an XBee packet.

The receive options are usually set as a bitfield meaning that the options can be combined using the ‘|’ operand.

Values:
RegisterKeyOptions.LINK_KEY = (0, ‘Key is a Link Key (KY on joining node)’)
RegisterKeyOptions.INSTALL_CODE = (1, ‘Key is an Install Code (I? on joining node,DC must be set to 1 on joiner)’)
RegisterKeyOptions.UNKNOWN = (255, ‘Unknown key option’)

property code

Returns the code of the RegisterKeyOptions element.

Returns

the code of the RegisterKeyOptions element.

Return type

Integer

property description

Returns the description of the RegisterKeyOptions element.

Returns

the description of the RegisterKeyOptions element.

Return type

String

classmethod get(code)[source]

Returns the register key option for the given code.

Parameters

code (Integer) – the code of the register key option to get.

Returns

the RegisterKeyOptions with the

given code, UNKNOWN if not found.

Return type

RegisterKeyOptions

class digi.xbee.models.options.SocketOption(value)[source]

Bases: enum.Enum

Enumerates the different Socket Options.

Values:
SocketOption.TLS_PROFILE = (0, ‘TLS Profile’)
SocketOption.UNKNOWN = (255, ‘Unknown’)

property code

Returns the code of the SocketOption element.

Returns

the code of the SocketOption element.

Return type

Integer

property description

Returns the description of the SocketOption element.

Returns

the description of the SocketOption element.

Return type

String

classmethod get(code)[source]

Returns the Socket Option for the given code.

Parameters

code (Integer) – the code of the Socket Option to get.

Returns

the SocketOption with the given code,

SocketOption.UNKNOWN if not found.

Return type

SocketOption

class digi.xbee.models.options.FileOpenRequestOption(value)[source]

Bases: enum.IntFlag

This enumeration lists all the available options for FSCmdType.FILE_OPEN command requests.

Inherited properties:
name (String): Name (id) of this FileOpenRequestOption.
value (String): Value of this FileOpenRequestOption.
Values:
FileOpenRequestOption.CREATE = 1
FileOpenRequestOption.EXCLUSIVE = 2
FileOpenRequestOption.READ = 4
FileOpenRequestOption.WRITE = 8
FileOpenRequestOption.TRUNCATE = 16
FileOpenRequestOption.APPEND = 32
FileOpenRequestOption.SECURE = 128

CREATE = 1

Create if file does not exist.

EXCLUSIVE = 2

Error out if file exists.

READ = 4

Open file for reading.

WRITE = 8

Open file for writing.

TRUNCATE = 16

Truncate file to 0 bytes.

APPEND = 32

Append to end of file.

SECURE = 128

Create a secure write-only file.

class digi.xbee.models.options.DirResponseFlag(value)[source]

Bases: enum.IntFlag

This enumeration lists all the available flags for FSCmdType.DIR_OPEN and FSCmdType.DIR_READ command responses.

Inherited properties:
name (String): Name (id) of this DirResponseFlag.
value (String): Value of this DirResponseFlag.
Values:
DirResponseFlag.IS_DIR = 128
DirResponseFlag.IS_SECURE = 64
DirResponseFlag.IS_LAST = 1

IS_DIR = 128

Entry is a directory.

IS_SECURE = 64

Entry is stored securely.

IS_LAST = 1

Entry is the last.