digi.xbee.profile module¶
-
class
digi.xbee.profile.
FirmwareBaudrate
(index, baudrate)[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)-
index
¶ Returns the index of the FirmwareBaudrate element.
Returns: the index of the FirmwareBaudrate element. Return type: Integer
-
baudrate
¶ Returns the baudrate of the FirmwareBaudrate element.
Returns: the baudrate of the FirmwareBaudrate element. Return type: Integer
-
-
class
digi.xbee.profile.
FirmwareParity
(index, parity)[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, <sphinx.ext.autodoc.importer._MockObject object at 0x7f693ab19850>)FirmwareParity.EVEN = (1, <sphinx.ext.autodoc.importer._MockObject object at 0x7f693ab196d0>)FirmwareParity.ODD = (2, <sphinx.ext.autodoc.importer._MockObject object at 0x7f693ab19dd0>)FirmwareParity.MARK = (3, <sphinx.ext.autodoc.importer._MockObject object at 0x7f6939090410>)FirmwareParity.SPACE = (4, <sphinx.ext.autodoc.importer._MockObject object at 0x7f6939090310>)-
index
¶ Returns the index of the FirmwareParity element.
Returns: the index of the FirmwareParity element. Return type: Integer
-
parity
¶ Returns the parity of the FirmwareParity element.
Returns: the parity of the FirmwareParity element. Return type: String
-
-
class
digi.xbee.profile.
FirmwareStopbits
(index, stop_bits)[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, <sphinx.ext.autodoc.importer._MockObject object at 0x7f69390908d0>)FirmwareStopbits.SB_2 = (1, <sphinx.ext.autodoc.importer._MockObject object at 0x7f6938e8efd0>)FirmwareStopbits.SB_1_5 = (2, <sphinx.ext.autodoc.importer._MockObject object at 0x7f693960fb10>)-
index
¶ Returns the index of the FirmwareStopbits element.
Returns: the index of the FirmwareStopbits element. Return type: Integer
-
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
(code, description)[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’)-
code
¶ Returns the code of the FlashFirmwareOption element.
Returns: the code of the FlashFirmwareOption element. Return type: Integer
-
description
¶ Returns the description of the FlashFirmwareOption element.
Returns: the description of the FlashFirmwareOption element. Return type: String
-
-
class
digi.xbee.profile.
XBeeSettingType
(tag, description)[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’)-
tag
¶ Returns the tag of the XBeeSettingType element.
Returns: the tag of the XBeeSettingType element. Return type: String
-
description
¶ Returns the description of the XBeeSettingType element.
Returns: the description of the XBeeSettingType element. Return type: String
-
-
class
digi.xbee.profile.
XBeeSettingFormat
(tag, description)[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’)-
tag
¶ Returns the tag of the XBeeSettingFormat element.
Returns: the tag of the XBeeSettingFormat element. Return type: String
-
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
-
name
¶ Returns the XBee setting name.
Returns: the XBee setting name. Return type: String
-
type
¶ Returns the XBee setting type.
Returns: the XBee setting type. Return type: XBeeSettingType
-
format
¶ Returns the XBee setting format.
Returns: the XBee setting format. Return type: XBeeSettingFormat
-
value
¶ Returns the XBee setting value as string.
Returns: the XBee setting value as string. Return type: String
-
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
-
profile_file
¶ Returns the profile file.
Returns: the profile file. Return type: String
-
version
¶ Returns the profile version.
Returns: the profile version. Return type: String
-
flash_firmware_option
¶ Returns the profile flash firmware option.
Returns: the profile flash firmware option. Return type: FlashFirmwareOption
See also
-
description
¶ Returns the profile description.
Returns: the profile description. Return type: String
-
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
-
has_filesystem
¶ Returns whether the profile has filesystem information or not.
Returns: True
if the profile has filesystem information,False
otherwise.Return type: Boolean
-
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
-
firmware_version
¶ Returns the compatible firmware version of the profile.
Returns: the compatible firmware version of the profile. Return type: Integer
-
hardware_version
¶ Returns the compatible hardware version of the profile.
Returns: the compatible hardware version of the profile. Return type: Integer
-
firmware_description_file
¶ Returns the path of the profile firmware description file.
Returns: the path of the profile firmware description file. Return type: String
-
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
orRemoteXBeeDevice
) – 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.
- xbee_device (