digi.xbee.models.atcomm module¶
-
class
digi.xbee.models.atcomm.ATStringCommand(value)[source]¶ Bases:
enum.EnumThis class represents basic AT commands.
Inherited properties:name (String): name (ID) of this ATStringCommand.value (String): value of this ATStringCommand.Values:ATStringCommand.AC = (‘AC’, ‘Apply changes’)ATStringCommand.AI = (‘AI’, ‘Association indication’)ATStringCommand.AO = (‘AO’, ‘API options’)ATStringCommand.AP = (‘AP’, ‘API enable’)ATStringCommand.AS = (‘AS’, ‘Active scan’)ATStringCommand.BD = (‘BD’, ‘UART baudrate’)ATStringCommand.BL = (‘BL’, ‘Bluetooth address’)ATStringCommand.BT = (‘BT’, ‘Bluetooth enable’)ATStringCommand.C0 = (‘C0’, ‘Source port’)ATStringCommand.C8 = (‘C8’, ‘Compatibility mode’)ATStringCommand.CC = (‘CC’, ‘Command sequence character’)ATStringCommand.CE = (‘CE’, ‘Device role’)ATStringCommand.CN = (‘CN’, ‘Exit command mode’)ATStringCommand.DA = (‘DA’, ‘Force Disassociation’)ATStringCommand.DH = (‘DH’, ‘Destination address high’)ATStringCommand.DL = (‘DL’, ‘Destination address low’)ATStringCommand.D7 = (‘D7’, ‘CTS configuration’)ATStringCommand.EE = (‘EE’, ‘Encryption enable’)ATStringCommand.FR = (‘FR’, ‘Software reset’)ATStringCommand.FS = (‘FS’, ‘File system’)ATStringCommand.GW = (‘GW’, ‘Gateway address’)ATStringCommand.GT = (‘GT’, ‘Guard times’)ATStringCommand.HV = (‘HV’, ‘Hardware version’)ATStringCommand.IC = (‘IC’, ‘Digital change detection’)ATStringCommand.ID = (‘ID’, ‘Network PAN ID/Network ID/SSID’)ATStringCommand.IR = (‘IR’, ‘I/O sample rate’)ATStringCommand.IS = (‘IS’, ‘Force sample’)ATStringCommand.KY = (‘KY’, ‘Link/Encryption key’)ATStringCommand.MA = (‘MA’, ‘IP addressing mode’)ATStringCommand.MK = (‘MK’, ‘IP address mask’)ATStringCommand.MY = (‘MY’, ‘16-bit address/IP address’)ATStringCommand.NB = (‘NB’, ‘Parity’)ATStringCommand.NI = (‘NI’, ‘Node identifier’)ATStringCommand.ND = (‘ND’, ‘Node discover’)ATStringCommand.NK = (‘NK’, ‘Trust Center network key’)ATStringCommand.NO = (‘NO’, ‘Node discover options’)ATStringCommand.NR = (‘NR’, ‘Network reset’)ATStringCommand.NS = (‘NS’, ‘DNS address’)ATStringCommand.NT = (‘NT’, ‘Node discover back-off’)ATStringCommand.N_QUESTION = (‘N?’, ‘Network discovery timeout’)ATStringCommand.OP = (‘OP’, ‘Operating extended PAN ID’)ATStringCommand.PK = (‘PK’, ‘Passphrase’)ATStringCommand.PL = (‘PL’, ‘TX power level’)ATStringCommand.RE = (‘RE’, ‘Restore defaults’)ATStringCommand.RR = (‘RR’, ‘XBee retries’)ATStringCommand.R_QUESTION = (‘R?’, ‘Region lock’)ATStringCommand.SB = (‘SB’, ‘Stop bits’)ATStringCommand.SH = (‘SH’, ‘Serial number high’)ATStringCommand.SI = (‘SI’, ‘Socket info’)ATStringCommand.SL = (‘SL’, ‘Serial number low’)ATStringCommand.SM = (‘SM’, ‘Sleep mode’)ATStringCommand.SS = (‘SS’, ‘Sleep status’)ATStringCommand.VH = (‘VH’, ‘Bootloader version’)ATStringCommand.VR = (‘VR’, ‘Firmware version’)ATStringCommand.WR = (‘WR’, ‘Write’)ATStringCommand.DOLLAR_S = (‘$S’, ‘SRP salt’)ATStringCommand.DOLLAR_V = (‘$V’, ‘SRP salt verifier’)ATStringCommand.DOLLAR_W = (‘$W’, ‘SRP salt verifier’)ATStringCommand.DOLLAR_X = (‘$X’, ‘SRP salt verifier’)ATStringCommand.DOLLAR_Y = (‘$Y’, ‘SRP salt verifier’)ATStringCommand.PERCENT_C = (‘%C’, ‘Hardware/software compatibility’)ATStringCommand.PERCENT_P = (‘%P’, ‘Invoke bootloader’)-
property
command¶ String. AT Command alias.
-
property
description¶ String. AT Command description
-
property
-
class
digi.xbee.models.atcomm.SpecialByte(value)[source]¶ Bases:
enum.EnumEnumerates all the special bytes of the XBee protocol that must be escaped when working on API 2 mode.
Inherited properties:name (String): name (ID) of this SpecialByte.value (String): the value of this SpecialByte.Values:SpecialByte.ESCAPE_BYTE = 125SpecialByte.HEADER_BYTE = 126SpecialByte.XON_BYTE = 17SpecialByte.XOFF_BYTE = 19-
classmethod
get(value)[source]¶ Returns the special byte for the given value.
- Parameters
value (Integer) – value associated to the special byte.
- Returns
SpecialByte with the given value.
- Return type
-
static
escape(value)[source]¶ Escapes the byte by performing a XOR operation with 0x20 value.
- Parameters
value (Integer) – value to escape.
- Returns
value ^ 0x20 (escaped).
- Return type
Integer
-
static
is_special_byte(value)[source]¶ Checks whether the given byte is special or not.
- Parameters
value (Integer) – byte to check.
- Returns
Trueif value is a special byte,Falsein other case.- Return type
Boolean
-
property
code¶ Integer. The special byte code.
-
classmethod
-
class
digi.xbee.models.atcomm.ATCommand(command, parameter=None)[source]¶ Bases:
objectThis class represents an AT command used to read or set different properties of the XBee device.
AT commands can be sent directly to the connected device or to remote devices and may have parameters.
After executing an AT Command, an AT Response is received from the device.
Class constructor. Instantiates a new
ATCommandobject with the provided parameters.- Parameters
command (String) – AT Command, must have length 2.
parameter (String or Bytearray, optional) – The AT parameter value. Defaults to
None. Optional.
- Raises
ValueError – if command length is not 2.
-
get_parameter_string()[source]¶ Returns this ATCommand parameter as a String.
- Returns
this ATCommand parameter.
Noneif there is no parameter.- Return type
String
-
property
command¶ String. The AT command
-
property
parameter¶ Bytearray. The AT command parameter
-
class
digi.xbee.models.atcomm.ATCommandResponse(command, response=None, status=<ATCommandStatus.OK: (0, 'Status OK')>)[source]¶ Bases:
objectThis class represents the response of an AT Command sent by the connected XBee device or by a remote device after executing an AT Command.
Class constructor.
- Parameters
command (ATCommand) – The AT command that generated the response.
response (bytearray, optional) – The command response. Default to
None.status (ATCommandStatus, optional) – The AT command status. Default to ATCommandStatus.OK
-
property
command¶ String. The AT command.
-
property
response¶ Bytearray. The AT command response data.
-
property
status¶ ATCommandStatus. The AT command response status.