digi.xbee.profile module

class digi.xbee.profile.FirmwareBaudrate(value)[source]

Bases: enum.Enum

This class lists the available firmware baudrate options for XBee Profiles.

Inherited properties:
name (String): The name of this FirmwareBaudrate.
value (Integer): The ID of this FirmwareBaudrate.
Values:
FirmwareBaudrate.BD_1200 = (0, 1200)
FirmwareBaudrate.BD_2400 = (1, 2400)
FirmwareBaudrate.BD_4800 = (2, 4800)
FirmwareBaudrate.BD_9600 = (3, 9600)
FirmwareBaudrate.BD_19200 = (4, 19200)
FirmwareBaudrate.BD_38400 = (5, 38400)
FirmwareBaudrate.BD_57600 = (6, 57600)
FirmwareBaudrate.BD_115200 = (7, 115200)
FirmwareBaudrate.BD_230400 = (8, 230400)
FirmwareBaudrate.BD_460800 = (9, 460800)
FirmwareBaudrate.BD_921600 = (10, 921600)

classmethod get(index)[source]

Returns the FirmwareBaudrate for the given index.

Parameters

index (Integer) – the index of the FirmwareBaudrate to get.

Returns

the FirmwareBaudrate with the given index, None if

there is not a FirmwareBaudrate with that index.

Return type

FirmwareBaudrate

property index

Returns the index of the FirmwareBaudrate element.

Returns

the index of the FirmwareBaudrate element.

Return type

Integer

property baudrate

Returns the baudrate of the FirmwareBaudrate element.

Returns

the baudrate of the FirmwareBaudrate element.

Return type

Integer

class digi.xbee.profile.FirmwareParity(value)[source]

Bases: enum.Enum

This class lists the available firmware parity options for XBee Profiles.

Inherited properties:
name (String): The name of this FirmwareParity.
value (Integer): The ID of this FirmwareParity.
Values:
FirmwareParity.NONE = (0, serial.PARITY_NONE)
FirmwareParity.EVEN = (1, serial.PARITY_EVEN)
FirmwareParity.ODD = (2, serial.PARITY_ODD)
FirmwareParity.MARK = (3, serial.PARITY_MARK)
FirmwareParity.SPACE = (4, serial.PARITY_SPACE)

classmethod get(index)[source]

Returns the FirmwareParity for the given index.

Parameters

index (Integer) – the index of the FirmwareParity to get.

Returns

the FirmwareParity with the given index, None if

there is not a FirmwareParity with that index.

Return type

FirmwareParity

property index

Returns the index of the FirmwareParity element.

Returns

the index of the FirmwareParity element.

Return type

Integer

property parity

Returns the parity of the FirmwareParity element.

Returns

the parity of the FirmwareParity element.

Return type

String

class digi.xbee.profile.FirmwareStopbits(value)[source]

Bases: enum.Enum

This class lists the available firmware stop bits options for XBee Profiles.

Inherited properties:
name (String): The name of this FirmwareStopbits.
value (Integer): The ID of this FirmwareStopbits.
Values:
FirmwareStopbits.SB_1 = (0, serial.STOPBITS_ONE)
FirmwareStopbits.SB_2 = (1, serial.STOPBITS_TWO)
FirmwareStopbits.SB_1_5 = (2, serial.STOPBITS_ONE_POINT_FIVE)

classmethod get(index)[source]

Returns the FirmwareStopbits for the given index.

Parameters

index (Integer) – the index of the FirmwareStopbits to get.

Returns

the FirmwareStopbits with the given index, None if

there is not a FirmwareStopbits with that index.

Return type

FirmwareStopbits

property index

Returns the index of the FirmwareStopbits element.

Returns

the index of the FirmwareStopbits element.

Return type

Integer

property stop_bits

Returns the stop bits of the FirmwareStopbits element.

Returns

the stop bits of the FirmwareStopbits element.

Return type

Float

class digi.xbee.profile.FlashFirmwareOption(value)[source]

Bases: enum.Enum

This class lists the available flash firmware options for XBee Profiles.

Inherited properties:
name (String): The name of this FlashFirmwareOption.
value (Integer): The ID of this FlashFirmwareOption.
Values:
FlashFirmwareOption.FLASH_ALWAYS = (0, ‘Flash always’)
FlashFirmwareOption.FLASH_DIFFERENT = (1, ‘Flash firmware if it is different’)
FlashFirmwareOption.DONT_FLASH = (2, ‘Do not flash firmware’)

classmethod get(code)[source]

Returns the FlashFirmwareOption for the given code.

Parameters

code (Integer) – the code of the flash firmware option to get.

Returns

the FlashFirmwareOption with the given code, None if

there is not a FlashFirmwareOption with that code.

Return type

FlashFirmwareOption

property code

Returns the code of the FlashFirmwareOption element.

Returns

the code of the FlashFirmwareOption element.

Return type

Integer

property description

Returns the description of the FlashFirmwareOption element.

Returns

the description of the FlashFirmwareOption element.

Return type

String

class digi.xbee.profile.XBeeSettingType(value)[source]

Bases: enum.Enum

This class lists the available firmware setting types.

Inherited properties:
name (String): The name of this XBeeSettingType.
value (Integer): The ID of this XBeeSettingType.
Values:
XBeeSettingType.NUMBER = (‘number’, ‘Number’)
XBeeSettingType.COMBO = (‘combo’, ‘Combo’)
XBeeSettingType.TEXT = (‘text’, ‘Text’)
XBeeSettingType.BUTTON = (‘button’, ‘Button’)
XBeeSettingType.NO_TYPE = (‘none’, ‘No type’)

classmethod get(tag)[source]

Returns the XBeeSettingType for the given tag.

Parameters

tag (String) – the tag of the XBeeSettingType to get.

Returns

the XBeeSettingType with the given tag, None if

there is not a XBeeSettingType with that tag.

Return type

XBeeSettingType

property tag

Returns the tag of the XBeeSettingType element.

Returns

the tag of the XBeeSettingType element.

Return type

String

property description

Returns the description of the XBeeSettingType element.

Returns

the description of the XBeeSettingType element.

Return type

String

class digi.xbee.profile.XBeeSettingFormat(value)[source]

Bases: enum.Enum

This class lists the available text firmware setting formats.

Inherited properties:
name (String): The name of this XBeeSettingFormat.
value (Integer): The ID of this XBeeSettingFormat.
Values:
XBeeSettingFormat.HEX = (‘HEX’, ‘Hexadecimal’)
XBeeSettingFormat.ASCII = (‘ASCII’, ‘ASCII’)
XBeeSettingFormat.IPV4 = (‘IPV4’, ‘IPv4’)
XBeeSettingFormat.IPV6 = (‘IPV6’, ‘IPv6’)
XBeeSettingFormat.PHONE = (‘PHONE’, ‘phone’)
XBeeSettingFormat.NO_FORMAT = (‘none’, ‘No format’)

classmethod get(tag)[source]

Returns the XBeeSettingFormat for the given tag.

Parameters

tag (String) – the tag of the XBeeSettingFormat to get.

Returns

the XBeeSettingFormat with the given tag, None if

there is not a XBeeSettingFormat with that tag.

Return type

XBeeSettingFormat

property tag

Returns the tag of the XBeeSettingFormat element.

Returns

the tag of the XBeeSettingFormat element.

Return type

String

property description

Returns the description of the XBeeSettingFormat element.

Returns

the description of the XBeeSettingFormat element.

Return type

String

class digi.xbee.profile.XBeeProfileSetting(name, setting_type, setting_format, value)[source]

Bases: object

This class represents an XBee profile setting and provides information like the setting name, type, format and value.

Class constructor. Instantiates a new XBeeProfileSetting with the given parameters.

Parameters
  • name (String) – the setting name

  • setting_type (XBeeSettingType) – the setting type

  • setting_format (XBeeSettingType) – the setting format

  • value (String) – the setting value

property name

Returns the XBee setting name.

Returns

the XBee setting name.

Return type

String

property type

Returns the XBee setting type.

Returns

the XBee setting type.

Return type

XBeeSettingType

property format

Returns the XBee setting format.

Returns

the XBee setting format.

Return type

XBeeSettingFormat

property value

Returns the XBee setting value as string.

Returns

the XBee setting value as string.

Return type

String

property bytearray_value

Returns the XBee setting value as bytearray to be set in the device.

Returns

the XBee setting value as bytearray to be set in the device.

Return type

Bytearray

exception digi.xbee.profile.ReadProfileException[source]

Bases: digi.xbee.exception.XBeeException

This exception will be thrown when any problem reading the XBee profile occurs.

All functionality of this class is the inherited from Exception.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception digi.xbee.profile.UpdateProfileException[source]

Bases: digi.xbee.exception.XBeeException

This exception will be thrown when any problem updating the XBee profile into a device occurs.

All functionality of this class is the inherited from Exception.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class digi.xbee.profile.XBeeProfile(profile_file)[source]

Bases: object

Helper class used to manage serial port break line in a parallel thread.

Class constructor. Instantiates a new XBeeProfile with the given parameters.

Parameters

profile_file (String) – path of the ‘.xpro’ profile file.

Raises
  • ProfileReadException – if there is any error reading the profile file.

  • ValueError – if the provided profile file is not valid

get_setting_default_value(setting_name)[source]

Returns the default value of the given firmware setting.

Parameters

setting_name (String) – the name of the setting to retrieve its default value.

Returns

the default value of the setting, None if the setting is not found or it has no default value.

Return type

String

property profile_file

Returns the profile file.

Returns

the profile file.

Return type

String

property version

Returns the profile version.

Returns

the profile version.

Return type

String

property flash_firmware_option

Returns the profile flash firmware option.

Returns

the profile flash firmware option.

Return type

FlashFirmwareOption

property description

Returns the profile description.

Returns

the profile description.

Return type

String

property reset_settings

Returns whether the settings of the XBee device will be reset before applying the profile ones or not.

Returns

True if the settings of the XBee device will be reset before applying the profile ones,

False otherwise.

Return type

Boolean

property has_filesystem

Returns whether the profile has filesystem information or not.

Returns

True if the profile has filesystem information, False otherwise.

Return type

Boolean

property profile_settings

Returns all the firmware settings that the profile configures.

Returns

a list with all the firmware settings that the profile configures (XBeeProfileSetting).

Return type

List

property firmware_version

Returns the compatible firmware version of the profile.

Returns

the compatible firmware version of the profile.

Return type

Integer

property hardware_version

Returns the compatible hardware version of the profile.

Returns

the compatible hardware version of the profile.

Return type

Integer

property firmware_description_file

Returns the path of the profile firmware description file.

Returns

the path of the profile firmware description file.

Return type

String

property file_system_path

Returns the profile file system path.

Returns

the path of the profile file system directory.

Return type

String

digi.xbee.profile.apply_xbee_profile(xbee_device, profile_path, progress_callback=None)[source]

Applies the given XBee profile into the given XBee device.

Parameters
  • xbee_device (XBeeDevice or RemoteXBeeDevice) – the XBee device to apply profile to.

  • profile_path (String) – path of the XBee profile file to apply.

  • progress_callback (Function, optional) –

    function to execute to receive progress information. Receives two

    arguments:

    • The current update task as a String

    • The current update task percentage as an Integer

Raises
  • ValueError – if the XBee profile or the XBee device is not valid.

  • UpdateProfileException – if there is any error during the update XBee profile operation.