digi.xbee.models.atcomm module

class digi.xbee.models.atcomm.ATStringCommand(command, description)[source]

Bases: enum.Enum

This 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’)

command

String. AT Command alias.

description

String. AT Command description

class digi.xbee.models.atcomm.SpecialByte(code)[source]

Bases: enum.Enum

Enumerates 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 = 125
SpecialByte.HEADER_BYTE = 126
SpecialByte.XON_BYTE = 17
SpecialByte.XOFF_BYTE = 19

code

Integer. The special byte code.

class digi.xbee.models.atcomm.ATCommand(command, parameter=None)[source]

Bases: object

This 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 ATCommand object 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. None if there is no parameter.
Return type:String
command

String. The AT command

parameter

Bytearray. The AT command parameter

class digi.xbee.models.atcomm.ATCommandResponse(command, response=None, status=<ATCommandStatus.OK: (0, 'Status OK')>)[source]

Bases: object

This 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
command

String. The AT command.

response

Bytearray. The AT command response data.

status

ATCommandStatus. The AT command response status.