digi.xbee.models.zdo package¶
-
class
digi.xbee.models.zdo.NodeDescriptorReader(xbee, configure_ao=True, timeout=20)[source]¶ Bases:
digi.xbee.models.zdo._ZDOCommandThis class performs a node descriptor read of the given XBee using a ZDO command.
The node descriptor read works only with Zigbee devices in API mode.
Class constructor. Instantiates a new
NodeDescriptorReaderobject with the provided parameters.Parameters: - (class (xbee) – .XBeeDevice or class:.RemoteXBeeDevice): XBee to send the command.
- configure_ao (Boolean, optional, default=`True`) – True to set AO value before and after executing, False otherwise.
- timeout (Float, optional, default=`.__DEFAULT_TIMEOUT`) – The ZDO command timeout in seconds.
Raises: ValueError– If xbee is None.ValueError– If cluster_id, receive_cluster_id, or timeout are less than 0.TypeError– If the xbee is not a .XBeeDevice or a RemoteXBeeDevice.
-
get_node_descriptor()[source]¶ Returns the descriptor of the node.
Returns: The node descriptor. Return type: NodeDescriptor
-
error¶ Returns the error string if any.
Returns: The error string. Return type: String
-
running¶ Returns if this ZDO command is running.
Returns: True if it is running, False otherwise. Return type: Boolean
-
stop()¶ Stops the ZDO command process if it is running.
-
class
digi.xbee.models.zdo.NodeDescriptor(role, complex_desc_supported, user_desc_supported, freq_band, mac_capabilities, manufacturer_code, max_buffer_size, max_in_transfer_size, max_out_transfer_size, desc_capabilities)[source]¶ Bases:
objectThis class represents a node descriptor of an XBee.
Class constructor. Instantiates a new
NodeDescriptorobject with the provided parameters.Parameters: - role (
Role) – The device role. - complex_desc_supported (Boolean) – True if the complex descriptor is supported.
- user_desc_supported (Boolean) – True if the user descriptor is supported.
- freq_band (List) – Byte array with the frequency bands.
- mac_capabilities (List) – Byte array with MAC capabilities.
- manufacturer_code (Integer) – The manufacturer’s code assigned by the Zigbee Alliance.
- max_buffer_size (Integer) – Maximum size in bytes of a data transmission.
- max_in_transfer_size (Integer) – Maximum number of bytes that can be received by the node.
- max_out_transfer_size (Integer) – Maximum number of bytes that can be transmitted by the node.
- desc_capabilities (List) – Byte array with descriptor capabilities.
-
role¶ Gets the role in this node descriptor.
Returns: The role of the node descriptor. Return type: RoleSee also
-
complex_desc_supported¶ Gets if the complex descriptor is supported.
Returns: True if supported, False otherwise. Return type: Boolean
-
user_desc_supported¶ Gets if the user descriptor is supported.
Returns: True if supported, False otherwise. Return type: Boolean
-
freq_band¶ 868 MHz * Bit1: Reserved * Bit2: 900 MHz * Bit3: 2.4 GHz * Bit4: Reserved
Returns: List of integers with the frequency bands bits.
Return type: List
Type: Gets the frequency bands (LSB - bit0- index 0, MSB - bit4 - index 4)
Type: - Bit0
-
mac_capabilities¶ Alternate PAN coordinator * Bit1: Device Type * Bit2: Power source * Bit3: Receiver on when idle * Bit4-5: Reserved * Bit6: Security capability * Bit7: Allocate address
Returns: List of integers with MAC capabilities bits.
Return type: List
Type: Gets the MAC capabilities (LSB - bit0- index 0, MSB - bit7 - index 7)
Type: - Bit0
-
manufacturer_code¶ Gets the manufacturer’s code assigned by the Zigbee Alliance.
Returns: The manufacturer’s code. Return type: Integer
-
max_buffer_size¶ Gets the maximum size in bytes of a data transmission (including APS bytes).
Returns: Maximum size in bytes. Return type: Integer
-
max_in_transfer_size¶ Gets the maximum number of bytes that can be received by the node.
Returns: Maximum number of bytes that can be received by the node. Return type: Integer
-
max_out_transfer_size¶ Gets the maximum number of bytes that can be transmitted by the node, including fragmentation.
Returns: Maximum number of bytes that can be transmitted by the node. Return type: Integer
-
desc_capabilities¶ Extended active endpoint list available * Bit1: Extended simple descriptor list available
Returns: List of integers with descriptor capabilities bits.
Return type: List
Type: Gets the descriptor capabilities (LSB - bit0- index 0, MSB - bit1 - index 1)
Type: - Bit0
- role (
-
class
digi.xbee.models.zdo.RouteTableReader(xbee, configure_ao=True, timeout=20)[source]¶ Bases:
digi.xbee.models.zdo._ZDOCommandThis class performs a route table read of the given XBee using a ZDO command.
The node descriptor read works only with Zigbee devices in API mode.
Class constructor. Instantiates a new
RouteTableReaderobject with the provided parameters.Parameters: - (class (xbee) – .XBeeDevice or class:.RemoteXBeeDevice): XBee to send the command.
- configure_ao (Boolean, optional, default=`True`) – True to set AO value before and after executing, False otherwise.
- timeout (Float, optional, default=`.DEFAULT_TIMEOUT`) – The ZDO command timeout in seconds.
Raises: ValueError– If xbee is None.ValueError– If cluster_id, receive_cluster_id, or timeout are less than 0.TypeError– If the xbee is not a .XBeeDevice or a .RemoteXBeeDevice.
-
get_route_table(route_cb=None, finished_cb=None)[source]¶ Returns the routes of the XBee. If route_cb is not defined, the process blocks until the complete routing table is read.
Parameters: - route_cb (Function, optional, default=`None`) –
Method called when a new route is received. Receives two arguments:
- The XBee that owns this new route.
- The new route.
- finished_cb (Function, optional, default=`None`) –
Method to execute when the process finishes. Receives three arguments:
- The XBee that executed the ZDO command.
- A list with the discovered routes.
- An error message if something went wrong.
Returns: - List of
Routewhen route_cb is not defined, None otherwise (in this case routes are received in the callback).
Return type: List
See also
- route_cb (Function, optional, default=`None`) –
-
error¶ Returns the error string if any.
Returns: The error string. Return type: String
-
running¶ Returns if this ZDO command is running.
Returns: True if it is running, False otherwise. Return type: Boolean
-
stop()¶ Stops the ZDO command process if it is running.
-
class
digi.xbee.models.zdo.RouteStatus(identifier, name)[source]¶ Bases:
enum.EnumEnumerates the available route status.
-
id¶ Returns the identifier of the RouteStatus.
Returns: RouteStatus identifier. Return type: Integer
-
-
class
digi.xbee.models.zdo.Route(destination, next_hop, status, is_low_memory, is_many_to_one, is_route_record_required)[source]¶ Bases:
objectThis class represents a Zigbee route read from the route table of an XBee.
Class constructor. Instantiates a new
Routeobject with the provided parameters.Parameters: - destination (
XBee16BitAddress) – 16-bit destination address of the route. - next_hop (
XBee16BitAddress) – 16-bit address of the next hop. - status (
RouteStatus) – Status of the route. - is_low_memory (Boolean) – True to indicate if the device is a low-memory concentrator.
- is_many_to_one (Boolean) – True to indicate the destination is a concentrator.
- is_route_record_required (Boolean) – True to indicate a route record message should be sent prior to the next data transmission.
See also
-
destination¶ Gets the 16-bit address of this route destination.
Returns: 16-bit address of the destination. Return type: XBee16BitAddressSee also
-
next_hop¶ Gets the 16-bit address of this route next hop.
Returns: 16-bit address of the next hop. Return type: XBee16BitAddressSee also
-
status¶ Gets this route status.
Returns: The route status. Return type: RouteStatusSee also
-
is_low_memory¶ Gets whether the device is a low-memory concentrator.
Returns: True if the device is a low-memory concentrator, False otherwise. Return type: Boolean
-
is_many_to_one¶ Gets whether the destination is a concentrator.
Returns: True if destination is a concentrator, False otherwise. Return type: Boolean
-
is_route_record_required¶ Gets whether a route record message should be sent prior the next data transmission.
Returns: True if a route record message should be sent, False otherwise. Return type: Boolean
- destination (
-
class
digi.xbee.models.zdo.NeighborTableReader(xbee, configure_ao=True, timeout=20)[source]¶ Bases:
digi.xbee.models.zdo._ZDOCommandThis class performs a neighbor table read of the given XBee using a ZDO command.
The node descriptor read works only with Zigbee devices in API mode.
Class constructor. Instantiates a new
NeighborTableReaderobject with the provided parameters.Parameters: - (class (xbee) – .XBeeDevice or class:.RemoteXBeeDevice): XBee to send the command.
- configure_ao (Boolean, optional, default=`True`) – True to set AO value before and after executing, False otherwise.
- timeout (Float, optional, default=`.DEFAULT_TIMEOUT`) – The ZDO command timeout in seconds.
Raises: ValueError– If xbee is None.ValueError– If cluster_id, receive_cluster_id, or timeout are less than 0.TypeError– If the xbee is not a .XBeeDevice or a .RemoteXBeeDevice.
-
get_neighbor_table(neighbor_cb=None, finished_cb=None)[source]¶ Returns the neighbors of the XBee. If neighbor_cb is not defined, the process blocks until the complete neighbor table is read.
Parameters: - neighbor_cb (Function, optional, default=`None`) –
Method called when a new neighbor is received. Receives two arguments:
- The XBee that owns this new neighbor.
- The new neighbor.
- finished_cb (Function, optional, default=`None`) –
Method to execute when the process finishes. Receives three arguments:
- The XBee that executed the ZDO command.
- A list with the discovered neighbors.
- An error message if something went wrong.
Returns: - List of
Neighborwhen neighbor_cb is not defined, None otherwise (in this case neighbors are received in the callback)
Return type: List
See also
- neighbor_cb (Function, optional, default=`None`) –
-
error¶ Returns the error string if any.
Returns: The error string. Return type: String
-
running¶ Returns if this ZDO command is running.
Returns: True if it is running, False otherwise. Return type: Boolean
-
stop()¶ Stops the ZDO command process if it is running.
-
class
digi.xbee.models.zdo.NeighborRelationship(identifier, name)[source]¶ Bases:
enum.EnumEnumerates the available relationships between two nodes of the same network.
-
id¶ Returns the identifier of the NeighborRelationship.
Returns: NeighborRelationship identifier. Return type: Integer
-
-
class
digi.xbee.models.zdo.Neighbor(node, relationship, depth, lq)[source]¶ Bases:
objectThis class represents a Zigbee or DigiMesh neighbor.
This information is read from the neighbor table of a Zigbee XBee, or provided by the ‘FN’ command in a Digimesh XBee.
Class constructor. Instantiates a new
Neighborobject with the provided parameters.Parameters: - node (
RemoteXBeeDevice) – The neighbor node. - relationship (
NeighborRelationship) – The relationship of this neighbor with the node. - depth (Integer) – The tree depth of the neighbor. A value of 0 indicates the device is a Zigbee coordinator for the network. -1 means this is unknown.
- lq (Integer) – The estimated link quality (LQI or RSSI) of data transmission from this neighbor.
See also
-
node¶ Gets the neighbor node.
Returns: The node itself. Return type: RemoteXBeeDeviceSee also
-
relationship¶ Gets the neighbor node.
Returns: The neighbor relationship. Return type: NeighborRelationshipSee also
-
depth¶ Gets the tree depth of the neighbor.
Returns: The tree depth of the neighbor. Return type: Integer
-
lq¶ Gets the estimated link quality (LQI or RSSI) of data transmission from this neighbor.
Returns: The estimated link quality of data transmission from this neighbor. Return type: Integer
- node (
-
class
digi.xbee.models.zdo.NeighborFinder(xbee, timeout=20)[source]¶ Bases:
objectThis class performs a find neighbors (FN) of an XBee. This action requires an XBee and optionally a find timeout.
The process works only in DigiMesh.
Class constructor. Instantiates a new
NeighborFinderobject with the provided parameters.Parameters: - (class (xbee) – .XBeeDevice or class:.RemoteXBeeDevice): The XBee to get neighbors from.
- timeout (Float) – The timeout for the process in seconds.
Raises: OperationNotSupportedException– If the process is not supported in the XBee.TypeError– If the xbee is not a .AbstractXBeeDevice.ValueError– If xbee is None.ValueError– If timeout is less than 0.
-
running¶ Returns whether this find neighbors process is running.
Returns: True if it is running, False otherwise. Return type: Boolean
-
error¶ Returns the error string if any.
Returns: The error string. Return type: String
-
get_neighbors(neighbor_cb=None, finished_cb=None)[source]¶ Returns the neighbors of the XBee. If neighbor_cb is not defined, the process blocks until the complete neighbor table is read.
Parameters: - neighbor_cb (Function, optional, default=`None`) –
Method called when a new neighbor is received. Receives two arguments:
- The XBee that owns this new neighbor.
- The new neighbor.
- finished_cb (Function, optional, default=`None`) –
Method to execute when the process finishes. Receives three arguments:
- The XBee that executed the FN command.
- A list with the discovered neighbors.
- An error message if something went wrong.
Returns: - List of
Neighborwhen neighbor_cb is not defined, None otherwise (in this case neighbors are received in the callback)
Return type: List
See also
- neighbor_cb (Function, optional, default=`None`) –