digi.xbee.models.filesystem module¶
-
class
digi.xbee.models.filesystem.
FSCmdType
(code, description)[source]¶ Bases:
enum.Enum
This enumeration lists all the available file system commands.
Inherited properties:name (String): Name (id) of this FSCmdType.value (String): Value of this FSCmdType.Values:Open/create file (1) = (1, ‘Open/create file’)Close file (2) = (2, ‘Close file’)Read file (3) = (3, ‘Read file’)Write file (4) = (4, ‘Write file’)File hash (8) = (8, ‘File hash’)Create directory (16) = (16, ‘Create directory’)Open directory (17) = (17, ‘Open directory’)Close directory (18) = (18, ‘Close directory’)Read directory (19) = (19, ‘Read directory’)Get directory path ID (28) = (28, ‘Get directory path ID’)Rename (33) = (33, ‘Rename’)Delete (47) = (47, ‘Delete’)Stat filesystem (64) = (64, ‘Stat filesystem’)Format filesystem (79) = (79, ‘Format filesystem’)-
code
¶ Returns the code of the file system command element.
Returns: Code of the file system command element. Return type: Integer
-
description
¶ Returns the description of the file system command element.
Returns: Description of the file system command element. Return type: Integer
-
-
class
digi.xbee.models.filesystem.
FSCmd
(cmd_type, direction=0, status=None)[source]¶ Bases:
object
This class represents a file system command.
Class constructor. Instantiates a new
FSCmd
object with the provided parameters.Parameters: - cmd_type (
FSCmdType
or Integer) – The command type. - direction (Integer, optional, default=0) – If this command is a request (0) or a response (1).
- status (
FSCommandStatus
or Integer) – Status of the file system command execution. Only for response commands.
Raises: ValueError
– If cmd_type is not an integer or aFSCmdType
.ValueError
– If cmd_type is invalid.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
output
()[source]¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
to_dict
()[source]¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
classmethod
create_cmd
(raw, direction=0)[source]¶ Creates a file system command with the given parameters. This method ensures that the FSCmd returned is valid and is well built (if not exceptions are raised).
Parameters: - raw (Bytearray) – Bytearray to create the command.
- direction (Integer, optional, default=0) – If this command is a request (0) or a response (1).
Returns: The file system command created.
Return type: Raises: InvalidPacketException
– If something is wrong with raw and the command cannot be built.
- cmd_type (
-
class
digi.xbee.models.filesystem.
UnknownFSCmd
(raw, direction=0)[source]¶ Bases:
digi.xbee.models.filesystem.FSCmd
This class represents an unknown file system command.
Class constructor. Instantiates a new
UnknownFSCmd
object with the provided parameters.Parameters: - raw (Bytearray) – Data of the unknown command.
- direction (Integer, optional, default=0) – If this command is a request (0) or a response (1).
Raises: ValueError
– If data is not a bytearray, its length is less than 3, or the command type is a known one.See also
-
type
¶ Returns the command type.
Returns: The command type. Return type: Integer
-
classmethod
create_cmd
(raw, direction=0)[source]¶ Override method.
Returns: Raises: InvalidPacketException
– If raw is not a bytearray.InvalidPacketException
– If raw length is less than 3, or the command type is a known one.
See also
-
output
()[source]¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
to_dict
()[source]¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
class
digi.xbee.models.filesystem.
FileIdCmd
(cmd_type, fid, direction=0, status=None)[source]¶ Bases:
digi.xbee.models.filesystem.FSCmd
This class represents a file system command request or response that includes a file or path id.
Class constructor. Instantiates a new
FileIdCmd
object with the provided parameters.Parameters: - cmd_type (
FSCmdType
or Integer) – The command type. - fid (Integer) – Id of the file/path to operate with. A file id expires and becomes invalid if not referenced for over 2 minutes. Set to 0x0000 for the root directory (/).
- direction (Integer, optional, default=0) – If this command is a request (0) or a response (1).
- status (
FSCommandStatus
or Integer) – Status of the file system command execution. Only for response commands.
Raises: ValueError
– If fid is invalid.See also
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
classmethod
create_cmd
(raw, direction=0)[source]¶ Override method.
Returns: FileIdCmd
.Raises: InvalidPacketException
– If the bytearray length is less than the minimum required.See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
- cmd_type (
-
class
digi.xbee.models.filesystem.
FileIdNameCmd
(cmd_type, fid, name, direction=0, status=None)[source]¶ Bases:
digi.xbee.models.filesystem.FileIdCmd
This class represents a file system command request or response that includes a file or path id and a name.
The file/path id is the next byte after the command type in the frame, and name are the following bytes until the end of the frame.
Class constructor. Instantiates a new
FileIdNameCmd
object with the provided parameters.Parameters: - cmd_type (
FSCmdType
or Integer) – The command type. - fid (Integer) – Id of the file/path to operate with. Set to 0x0000 for the root directory (/).
- name (String or bytearray) – The path name of the file to operate with. Its maximum length is 252 characters.
- direction (Integer, optional, default=0) – If this command is a request (0) or a response (1).
- status (
FSCommandStatus
or Integer) – Status of the file system command execution. Only for response commands.
Raises: ValueError
– If fid or name are invalid.See also
-
name
¶ Returns the path name of the file.
Returns: The file path name. Return type: String
-
classmethod
create_cmd
(raw, direction=0)[source]¶ Override method. Direction must be 0.
Returns: FileIdNameCmd
.Raises: InvalidPacketException
– If the bytearray length is less than the minimum required.See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
- cmd_type (
-
class
digi.xbee.models.filesystem.
OpenFileCmdRequest
(path_id, name, flags)[source]¶ Bases:
digi.xbee.models.filesystem.FileIdNameCmd
This class represents a file open/create file system command request. Open a file for reading and/or writing. Use FileOpenRequestOption.SECURE bitmask to upload a write-only file (one that cannot be downloaded or viewed), useful for protecting MicroPython source code on the device.
Command response is received as a
OpenFileCmdResponse
.Class constructor. Instantiates a new
OpenFileCmdRequest
object with the provided parameters.Parameters: - path_id (Integer) – Directory path id. Set to 0x0000 for the root directory (/).
- name (String or bytearray) – The path name of the file to open/create, relative to path_id. Its maximum length is 251 chars.
- flags (
FileOpenRequestOption
) – Bitfield of supported flags. UseFileOpenRequestOption
to compose its value.
Raises: ValueError
– If any of the parameters is invalid.See also
-
options
¶ Returns the options to open the file.
Returns: The options to open the file. Return type: FileOpenRequestOption
-
classmethod
create_cmd
(raw, direction=0)[source]¶ Override method. Direction must be 0.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 5. (cmd id + path id (2 bytes) + flags (1 byte) + name (at least 1 byte) = 5 bytes).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 0.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
name
¶ Returns the path name of the file.
Returns: The file path name. Return type: String
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
class
digi.xbee.models.filesystem.
OpenFileCmdResponse
(status, fid=None, size=None)[source]¶ Bases:
digi.xbee.models.filesystem.FileIdCmd
This class represents a file open/create file system command response.
This is received in response of an
OpenFileCmdRequest
.Class constructor. Instantiates a new
OpenFileCmdResponse
object with the provided parameters.Parameters: - status (
FSCommandStatus
or Integer) – Status of the file system command execution. - fid (Integer, optional, default=`None`) – Id of the file that has been opened. It expires and becomes invalid if not referenced for over 2 minutes.
- size (Integer, optional, default=`None`) – Size in bytes of the file. 0xFFFFFFFF if unknown.
Raises: ValueError
– If any of the parameters is invalid.See also
-
size
¶ Returns the size of the opened file. 0xFFFFFFFF if unknown.
Returns: Size in bytes of the opened file. Return type: Integer
-
classmethod
create_cmd
(raw, direction=1)[source]¶ Override method. Direction must be 1.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 8. (cmd id + status + file id (2 bytes) + size (4 bytes) = 8).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 1.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
- status (
-
class
digi.xbee.models.filesystem.
CloseFileCmdRequest
(fid)[source]¶ Bases:
digi.xbee.models.filesystem.FileIdCmd
This class represents a file close file system command request. Close an open file and release its File Handle.
Command response is received as a
CloseFileCmdResponse
.Class constructor. Instantiates a new
CloseFileCmdRequest
object with the provided parameters.Parameters: fid (Integer) – Id of the file to close returned in Open File Response. It expires and becomes invalid if not referenced for over 2 minutes. Raises: ValueError
– If any of the parameters is invalid.See also
-
classmethod
create_cmd
(raw, direction=0)[source]¶ Override method. Direction must be 0.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 3. (cmd id + file_id (2 bytes) = 3 bytes).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 0.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
classmethod
-
class
digi.xbee.models.filesystem.
CloseFileCmdResponse
(status)[source]¶ Bases:
digi.xbee.models.filesystem.FSCmd
This class represents a file close file system command response.
Command response is received as a
CloseFileCmdRequest
.Class constructor. Instantiates a new
CloseFileCmdResponse
object with the provided parameters.Parameters: status ( FSCommandStatus
or Integer) – Status of the file system command execution.See also
-
classmethod
create_cmd
(raw, direction=1)[source]¶ Override method. Direction must be 1.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 1. (cmd id = 1 byte).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 1.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
classmethod
-
class
digi.xbee.models.filesystem.
ReadFileCmdRequest
(fid, offset, size)[source]¶ Bases:
digi.xbee.models.filesystem.FileIdCmd
This class represents a read file system command request.
Command response is received as a
ReadFileCmdResponse
.Class constructor. Instantiates a new
ReadFileCmdRequest
object with the provided parameters.Parameters: - fid (Integer) – Id of the file to read returned in Open File Response. It expires and becomes invalid if not referenced for over 2 minutes.
- offset (Integer) – The file offset to start reading. 0xFFFFFFFF to use current position (ReadFileCmdRequest.USE_CURRENT_OFFSET)
- size (Integer) – The number of bytes to read. 0xFFFF (ReadFileCmdRequest.READ_AS_MANY) to read as many as possible (limited by file size or maximum response frame size)
Raises: ValueError
– If any of the parameters is invalid.See also
-
USE_CURRENT_OFFSET
= 4294967295¶ Use current file position to start reading.
-
READ_AS_MANY
= 65535¶ Read as many bytes as possible (limited by file size or maximum response frame size)
-
offset
¶ Returns the file offset to start reading. 0xFFFFFFFF to use current position (ReadFileCmdRequest.0xFFFFFFFF)
Returns: The file offset. Return type: Integer
-
size
¶ Returns the number of bytes to read. 0xFFFF (ReadFileCmdRequest.READ_AS_MANY) to read as many as possible (limited by file size or maximum response frame size)
Returns: The number of bytes to read. Return type: Integer
-
classmethod
create_cmd
(raw, direction=0)[source]¶ Override method. Direction must be 0.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 9. (cmd id + file_id (2 bytes) + offset (4 bytes) + size (2 bytes) = 9 bytes).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 0.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
class
digi.xbee.models.filesystem.
ReadFileCmdResponse
(status, fid=None, offset=None, data=None)[source]¶ Bases:
digi.xbee.models.filesystem.FileIdCmd
This class represents a read file system command response.
Command response is received as a
ReadFileCmdRequest
.Class constructor. Instantiates a new
ReadFileCmdResponse
object with the provided parameters.Parameters: - status (
FSCommandStatus
or Integer) – Status of the file system command execution. - fid (Integer, optional, default=`None`) – Id of the read file.
- offset (Integer, optional, default=`None`) – The offset of the read data.
- data (Bytearray, optional, default=`None`) – The file read data.
Raises: ValueError
– If any of the parameters is invalid.See also
-
offset
¶ Returns the offset of the read data.
Returns: The data offset. Return type: Integer
-
data
¶ Returns the read data from the file.
Returns: Read data. Return type: Bytearray
-
classmethod
create_cmd
(raw, direction=1)[source]¶ Override method. Direction must be 1.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 8. (cmd id + status + file_id (2 bytes) + offset (4 bytes) + data = 8)InvalidPacketException
– If the command type is notFSCmdType
or direction is not 1.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
- status (
-
class
digi.xbee.models.filesystem.
WriteFileCmdRequest
(fid, offset, data=None)[source]¶ Bases:
digi.xbee.models.filesystem.FileIdCmd
This class represents a write file system command request.
Command response is received as a
WriteFileCmdResponse
.Class constructor. Instantiates a new
WriteFileCmdRequest
object with the provided parameters.Parameters: - fid (Integer) – Id of the file to write returned in Open File Response. It expires and becomes invalid if not referenced for over 2 minutes.
- offset (Integer) – The file offset to start writing. 0xFFFFFFFF to use current position (ReadFileCmdRequest.USE_CURRENT_OFFSET)
- data (Bytearray, optional, default=`None`) – The data to write. If empty, frame just refreshes the File Handle timeout to keep the file open.
Raises: ValueError
– If any of the parameters is invalid.See also
-
USE_CURRENT_OFFSET
= 4294967295¶ Use current file position to start writing.
-
offset
¶ Returns the file offset to start writing.
Returns: The file offset. Return type: Integer
-
data
¶ Returns the data to write. If empty, frame just refreshes the File Handle timeout to keep the file open.
Returns: The data to write. Return type: Bytearray
-
classmethod
create_cmd
(raw, direction=0)[source]¶ Override method. Direction must be 0.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 7. (cmd id + file_id (2 bytes) + offset (4 bytes) = 7 bytes).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 0.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
class
digi.xbee.models.filesystem.
WriteFileCmdResponse
(status, fid=None, actual_offset=None)[source]¶ Bases:
digi.xbee.models.filesystem.FileIdCmd
This class represents a write file system command response.
Command response is received as a
WriteFileCmdRequest
.Class constructor. Instantiates a new
WriteFileCmdResponse
object with the provided parameters.Parameters: - status (
FSCommandStatus
or Integer) – Status of the file system command execution. - fid (Integer, optional, default=`None`) – Id of the written file.
- actual_offset (Integer, optional, default=`None`) – The current file offset after writing.
Raises: ValueError
– If any of the parameters is invalid.See also
-
actual_offset
¶ Returns the file offset after writing.
Returns: The file offset. Return type: Integer
-
classmethod
create_cmd
(raw, direction=1)[source]¶ Override method. Direction must be 1.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 8. (cmd id + status + file_id (2 bytes) + offset (4 bytes) = 8)InvalidPacketException
– If the command type is notFSCmdType
or direction is not 1.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
- status (
-
class
digi.xbee.models.filesystem.
HashFileCmdRequest
(path_id, name)[source]¶ Bases:
digi.xbee.models.filesystem.FileIdNameCmd
This class represents a file hash command request. Use this command to get a sha256 hash to verify a file’s contents without downloading the entire file (something not even possible for secure files). On XBee Cellular modules, there is a response delay in order to calculate the hash of a non-secure file. Secure files on XBee Cellular and all files on XBee 3 802.15.4, DigiMesh, and Zigbee have a cached hash.
Command response is received as a
HashFileCmdResponse
.Class constructor. Instantiates a new
HashFileCmdRequest
object with the provided parameters.Parameters: - path_id (Integer) – Directory path id. Set to 0x0000 for the root directory (/).
- name (String or bytearray) – The path name of the file to hash, relative to path_id. Its maximum length is 252 chars.
Raises: ValueError
– If any of the parameters is invalid.See also
-
classmethod
create_cmd
(raw, direction=0)[source]¶ Override method. Direction must be 0.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 4. (cmd id + path id (2 bytes) + name (at least 1 byte) = 4 bytes).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 0.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
name
¶ Returns the path name of the file.
Returns: The file path name. Return type: String
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
class
digi.xbee.models.filesystem.
HashFileCmdResponse
(status, file_hash=None)[source]¶ Bases:
digi.xbee.models.filesystem.FSCmd
This class represents a file hash command response.
This is received in response of an
HashFileCmdRequest
.Class constructor. Instantiates a new
HashFileCmdResponse
object with the provided parameters.Parameters: - status (
FSCommandStatus
or Integer) – Status of the file system command execution. - file_hash (Bytearray, optional, default=`None`) – The hash value.
Raises: ValueError
– If any of the parameters is invalid.See also
-
file_hash
¶ Returns the hash of the file.
Returns: The hash of the file. Return type: Bytearray
-
classmethod
create_cmd
(raw, direction=1)[source]¶ Override method. Direction must be 1.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 34. (cmd id + status + hash (32 bytes) = 34).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 1.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
- status (
-
class
digi.xbee.models.filesystem.
CreateDirCmdRequest
(path_id, name)[source]¶ Bases:
digi.xbee.models.filesystem.FileIdNameCmd
This class represents a create directory file system command request. Parent directories of the one to be created must exist. Separate request must be dane to make intermediate directories.
Command response is received as a
CreateDirCmdResponse
.Class constructor. Instantiates a new
CreateDirCmdRequest
object with the provided parameters.Parameters: - path_id (Integer) – Directory path id. Set to 0x0000 for the root directory (/).
- name (String or bytearray) – The path name of the directory to create, relative to path_id. Its maximum length is 252 chars.
Raises: ValueError
– If any of the parameters is invalid.See also
-
classmethod
create_cmd
(raw, direction=0)[source]¶ Override method. Direction must be 0.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 4. (cmd id + path id (2 bytes) + name (at least 1 byte) = 4 bytes).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 0.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
name
¶ Returns the path name of the file.
Returns: The file path name. Return type: String
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
class
digi.xbee.models.filesystem.
CreateDirCmdResponse
(status)[source]¶ Bases:
digi.xbee.models.filesystem.FSCmd
This class represents a create directory file system command response.
Command response is received as a
CreateDirCmdRequest
.Class constructor. Instantiates a new
CreateDirCmdResponse
object with the provided parameters.Parameters: status ( FSCommandStatus
or Integer) – Status of the file system command execution.See also
-
classmethod
create_cmd
(raw, direction=1)[source]¶ Override method. Direction must be 1.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 2. (cmd id + status = 2).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 1.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
classmethod
-
class
digi.xbee.models.filesystem.
OpenDirCmdRequest
(path_id, name)[source]¶ Bases:
digi.xbee.models.filesystem.FileIdNameCmd
This class represents an open directory file system command request.
Command response is received as a
OpenDirCmdResponse
.Class constructor. Instantiates a new
OpenDirCmdRequest
object with the provided parameters.Parameters: - path_id (Integer) – Directory path id. Set to 0x0000 for the root directory (/).
- name (String or bytearray) – Path name of the directory to open, relative to path_id. An empty name is equivalent to ‘.’, both refer to the current directory path id. Its maximum length is 252 chars.
Raises: ValueError
– If any of the parameters is invalid.See also
-
classmethod
create_cmd
(raw, direction=0)[source]¶ Override method. Direction must be 0.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 4. (cmd id + path id (2 bytes) + name (at least 1 byte) = 4 bytes).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 0.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
name
¶ Returns the path name of the file.
Returns: The file path name. Return type: String
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
class
digi.xbee.models.filesystem.
OpenDirCmdResponse
(status, did=None, fs_entries=None)[source]¶ Bases:
digi.xbee.models.filesystem.FileIdCmd
This class represents an open directory file system command response. If the final file system element does not have DirResponseFlag.ENTRY_IS_LAST set, send a Directory Read Request to get additional entries. A response ending with an DirResponseFlag.ENTRY_IS_LAST flag automatically closes the Directory Handle. An empty directory returns a single entry with just the DirResponseFlag.ENTRY_IS_LAST flag set, and a 0-byte name.
This is received in response of an
OpenDirCmdRequest
.Class constructor. Instantiates a new
OpenFileCmdResponse
object with the provided parameters.Parameters: - status (
FSCommandStatus
or Integer) – Status of the file system command execution. - did (Integer, optional, default=`None`) – Id of the directory that has been opened. It expires and becomes invalid if not referenced for over 2 minutes.
- fs_entries (List, optional, default=`None`) – List of bytearrays with the info and name of the entries inside the opened directory.
Raises: ValueError
– If any of the parameters is invalid.See also
-
is_last
¶ Returns whether there are more elements not included in this response.
Returns: - True if there are no more elements to list, False
- otherwise.
Return type: Boolean
-
fs_entries
¶ Returns the list of entries inside the opened directory.
Returns: List of :class: .`FileSystemElement` inside the directory. Return type: List
-
classmethod
create_cmd
(raw, direction=1)[source]¶ Override method. Direction must be 1.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 8. (cmd id + status + dir id (2 bytes) + filesize_and_flags (4 bytes) = 8).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 1.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
- status (
-
class
digi.xbee.models.filesystem.
CloseDirCmdRequest
(did)[source]¶ Bases:
digi.xbee.models.filesystem.FileIdCmd
This class represents a directory close file system command request.
Command response is received as a
CloseDirCmdResponse
.Class constructor. Instantiates a new
CloseDirCmdRequest
object with the provided parameters.Parameters: did (Integer) – Id of the directory to close. It expires and becomes invalid if not referenced for over 2 minutes. Raises: ValueError
– If any of the parameters is invalid.See also
-
classmethod
create_cmd
(raw, direction=0)[source]¶ Override method. Direction must be 0.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 3. (cmd id + dir_id (2 bytes) = 3 bytes).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 0.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
classmethod
-
class
digi.xbee.models.filesystem.
CloseDirCmdResponse
(status)[source]¶ Bases:
digi.xbee.models.filesystem.FSCmd
This class represents a directory close file system command response. Send this command to indicate that it is done reading the directory and no longer needs the Directory Handle. Typical usage scenario is to use a Directory Open Request and additional Directory Read Requests until the Response includes an entry with the DirResponseFlag.ENTRY_IS_LAST flag set.
Command response is received as a
CloseDirCmdRequest
.Class constructor. Instantiates a new
CloseDirCmdResponse
object with the provided parameters.Parameters: status ( FSCommandStatus
or Integer) – Status of the file system command execution.See also
-
classmethod
create_cmd
(raw, direction=1)[source]¶ Override method. Direction must be 1.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 2. (cmd id + status = 2).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 1.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
classmethod
-
class
digi.xbee.models.filesystem.
ReadDirCmdRequest
(did)[source]¶ Bases:
digi.xbee.models.filesystem.FileIdCmd
This class represents a directory read file system command request.
Command response is received as a
ReadDirCmdResponse
.Class constructor. Instantiates a new
ReadDirCmdRequest
object with the provided parameters.Parameters: did (Integer) – Id of the directory to close. It expires and becomes invalid if not referenced for over 2 minutes. Raises: ValueError
– If any of the parameters is invalid.See also
-
classmethod
create_cmd
(raw, direction=0)[source]¶ Override method. Direction must be 0.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 3. (cmd id + dir_id (2 bytes) = 3 bytes).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 0.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
classmethod
-
class
digi.xbee.models.filesystem.
ReadDirCmdResponse
(status, did=None, fs_entries=None)[source]¶ Bases:
digi.xbee.models.filesystem.OpenDirCmdResponse
This class represents a read directory file system command response. If the final file system element does not have DirResponseFlag.ENTRY_IS_LAST set, send another Directory Read Request to get additional entries. A response ending with an DirResponseFlag.ENTRY_IS_LAST flag automatically closes the Directory Handle.
This is received in response of an
ReadDirCmdRequest
.Class constructor. Instantiates a new
ReadDirCmdResponse
object with the provided parameters.Parameters: - status (
FSCommandStatus
or Integer) – Status of the file system command execution. - did (Integer, optional, default=`None`) – Id of the directory that has been read.
- fs_entries (List, optional, default=`None`) – List of bytearrays with the info and name of the entries inside the directory.
Raises: ValueError
– If any of the parameters is invalid.See also
-
classmethod
create_cmd
(raw, direction=1)[source]¶ Override method. Direction must be 1.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 4. (cmd id + status + dir id (2 bytes) = 4).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 1.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_entries
¶ Returns the list of entries inside the opened directory.
Returns: List of :class: .`FileSystemElement` inside the directory. Return type: List
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
is_last
¶ Returns whether there are more elements not included in this response.
Returns: - True if there are no more elements to list, False
- otherwise.
Return type: Boolean
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
- status (
-
class
digi.xbee.models.filesystem.
GetPathIdCmdRequest
(path_id, name)[source]¶ Bases:
digi.xbee.models.filesystem.FileIdNameCmd
This class represents a get path id file system command request. A directory path id (path_id) of 0x0000 in any command, means path names are relative to the root directory of the filesystem (/).
- ‘/’ as path separator
- ‘..’ to refer to the parent directory
- ‘.’ to refer to the current path directory
Use this command to get a shortcut to a subdirectory of the file system to allow the use of shorter path names in the frame:
- If the PATH ID field of this command is 0x0000, the XBee allocates a new PATH ID for use in later requests.
- If the PATH ID field of this command is non-zero, the XBee updates the directory path of that ID.
- To release a PATH ID when no longer needed:
- Send a request with that ID and a single slash (“/”) as the pathname. Any Change Directory Request that resolves to the root directory releases the PATH ID and return a 0x0000 ID.
- Wait for a timeout (2 minutes)
Any file system id expires after 2 minutes if not referenced. Refresh this timeout by sending a Change Directory request with an empty or a single period (‘.’) as the pathname.
Command response is received as a
GetPathIdCmdResponse
.Class constructor. Instantiates a new
GetPathIdCmdRequest
object with the provided parameters.Parameters: - path_id (Integer) – Directory path id. Set to 0x0000 for the root directory (/).
- name (String or bytearray) – The path name of the directory to change, relative to path_id. An empty name is equivalent to ‘.’, both refer to the current directory path id. Its maximum length is 252 chars.
Raises: ValueError
– If any of the parameters is invalid.See also
-
classmethod
create_cmd
(raw, direction=0)[source]¶ Override method. Direction must be 0.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 4. (cmd id + path id (2 bytes) + name (at least 1 byte) = 4 bytes).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 0.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
name
¶ Returns the path name of the file.
Returns: The file path name. Return type: String
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
class
digi.xbee.models.filesystem.
GetPathIdCmdResponse
(status, path_id=None, full_path=None)[source]¶ Bases:
digi.xbee.models.filesystem.FileIdCmd
This class represents a get path id file system command response. The full path of the new current directory is included if can fit.
This is received in response of an
GetPathIdCmdRequest
.Class constructor. Instantiates a new
GetPathIdCmdResponse
object with the provided parameters.Parameters: - status (
FSCommandStatus
or Integer) – Status of the file system command execution. - path_id (Integer, optional, default=`None`) – New directory path id.
- full_path (String or bytearray, optional, default=`None`) – If short enough, the full path of the current directory , relative to path_id. Deep subdirectories may return an empty field instead of their full path name. The maximum full path length is 255 characters.
Raises: ValueError
– If any of the parameters is invalid.See also
-
full_path
¶ Returns the full path of the current directory.
Returns: The directory full path. Return type: String
-
classmethod
create_cmd
(raw, direction=1)[source]¶ Override method. Direction must be 1.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 4. (cmd id + status + path id (2 bytes) = 4).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 1.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
- status (
-
class
digi.xbee.models.filesystem.
RenameCmdRequest
(path_id, name, new_name)[source]¶ Bases:
digi.xbee.models.filesystem.FileIdNameCmd
This class represents a file/directory rename file system command request. Current firmware for XBee 3 802.15.4, DigiMesh, and Zigbee do not support renaming files. Contact Digi International to request it as a feature in a future release.
Command response is received as a
RenameCmdResponse
.Class constructor. Instantiates a new
RenameCmdRequest
object with the provided parameters.Parameters: - path_id (Integer) – Directory path id. Set to 0x0000 for the root directory (/).
- name (String or bytearray) – The current path name of the file/directory to rename relative to path_id. Its maximum length is 255 chars.
- new_name (String or bytearray) – The new name of the file/directory relative to path_id. Its maximum length is 255 chars.
Raises: ValueError
– If any of the parameters is invalid.See also
-
new_name
¶ Returns the new name of the file or directory.
Returns: The new name. Return type: String
-
classmethod
create_cmd
(raw, direction=0)[source]¶ Override method. Direction must be 0.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 6. (cmd id + path id (2 bytes) + name (1 byte at least) + ‘,’ + new name (at least 1 byte) = 6 bytes).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 0.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
name
¶ Returns the path name of the file.
Returns: The file path name. Return type: String
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
class
digi.xbee.models.filesystem.
RenameCmdResponse
(status)[source]¶ Bases:
digi.xbee.models.filesystem.FSCmd
This class represents a rename file system command response.
Command response is received as a
RenameCmdRequest
.Class constructor. Instantiates a new
RenameCmdResponse
object with the provided parameters.Parameters: status ( FSCommandStatus
or Integer) – Status of the file system command execution.See also
-
classmethod
create_cmd
(raw, direction=1)[source]¶ Override method. Direction must be 1.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 2. (cmd id + status = 2).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 1.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
classmethod
-
class
digi.xbee.models.filesystem.
DeleteCmdRequest
(path_id, name)[source]¶ Bases:
digi.xbee.models.filesystem.FileIdNameCmd
This class represents a delete file system command request. All files in a directory must be deleted before removing the directory. On XBee 3 802.15.4, DigiMesh, and Zigbee, deleted files are marked as as unusable space unless they are at the “end” of the file system (most-recently created). On these products, deleting a file triggers recovery of any deleted file space at the end of the file system, and can lead to a delayed response.
Command response is received as a
DeleteCmdResponse
.Class constructor. Instantiates a new
DeleteCmdRequest
object with the provided parameters.Parameters: - path_id (Integer) – Directory path id. Set to 0x0000 for the root directory (/).
- name (String or bytearray) – The name of the file/directory to delete relative to path_id. Its maximum length is 252 chars.
Raises: ValueError
– If any of the parameters is invalid.See also
-
classmethod
create_cmd
(raw, direction=0)[source]¶ Override method. Direction must be 0.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 4. (cmd id + path id (2 bytes) + name (at least 1 byte) = 4 bytes).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 0.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
fs_id
¶ Returns the file/path identifier.
Returns: The file/path id value. Return type: Integer
-
name
¶ Returns the path name of the file.
Returns: The file path name. Return type: String
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
class
digi.xbee.models.filesystem.
DeleteCmdResponse
(status)[source]¶ Bases:
digi.xbee.models.filesystem.FSCmd
This class represents a delete file system command response.
Command response is received as a
DeleteCmdRequest
.Class constructor. Instantiates a new
DeleteCmdResponse
object with the provided parameters.Parameters: status ( FSCommandStatus
or Integer) – Status of the file system command execution.See also
-
classmethod
create_cmd
(raw, direction=1)[source]¶ Override method. Direction must be 1.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 2. (cmd id + status = 2).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 1.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
classmethod
-
class
digi.xbee.models.filesystem.
VolStatCmdRequest
(name)[source]¶ Bases:
digi.xbee.models.filesystem.FSCmd
This class represents a volume stat file system command request. Formatting the file system takes time, and any other requests fails until it completes and sends a response.
Command response is received as a
VolStatCmdResponse
.Class constructor. Instantiates a new
VolStatCmdRequest
object with the provided parameters.Parameters: name (String or bytearray) – The name of the volume. Its maximum length is 254 characters. Raises: ValueError
– If name is invalid.See also
-
name
¶ Returns the name of the volume.
Returns: The volume name. Return type: String
-
classmethod
create_cmd
(raw, direction=0)[source]¶ Override method. Direction must be 0.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 2. (cmd id + name (at least 1 byte) = 2 bytes).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 0.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
-
class
digi.xbee.models.filesystem.
VolStatCmdResponse
(status, bytes_used=None, bytes_free=None, bytes_bad=None)[source]¶ Bases:
digi.xbee.models.filesystem.FSCmd
This class represents a stat file system command response.
Command response is received as a
VolStatCmdRequest
.Class constructor. Instantiates a new
VolStatCmdResponse
object with the provided parameters.Parameters: - status (
FSCommandStatus
or Integer) – Status of the file system command execution. - bytes_used (Integer, optional, default=`None`) – Number of used bytes.
- bytes_free (Integer, optional, default=`None`) – Number of free bytes.
- bytes_bad (Integer, optional, default=`None`) – Number of bad bytes. For XBee 3 802.15.4, DigiMesh, and Zigbee, this represents space used by deleted files.
Raises: ValueError
– If any of the parameters is invalid.See also
-
bytes_used
¶ Returns the used space on volume.
Returns: Number of used bytes. Return type: Integer
-
bytes_free
¶ Returns the available space on volume.
Returns: Number of free bytes. Return type: Integer
-
bytes_bad
¶ Returns “bad” bytes on volume. For XBee 3 802.15.4, DigiMesh, and Zigbee, this represents space used by deleted files.
Returns: Number of bad bytes. Return type: Integer
-
classmethod
create_cmd
(raw, direction=1)[source]¶ Override method. Direction must be 1.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 14. (cmd id + status + used (4 bytes) + free (4 bytes) + bad (4 bytes) = 14)InvalidPacketException
– If the command type is notFSCmdType
or direction is not 1.
See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
- status (
-
class
digi.xbee.models.filesystem.
VolFormatCmdRequest
(name)[source]¶ Bases:
digi.xbee.models.filesystem.VolStatCmdRequest
This class represents a volume format file system command request.
Command response is received as a
VolFormatCmdResponse
.Class constructor. Instantiates a new
VolFormatCmdRequest
object with the provided parameters.Parameters: name (String or bytearray) – The name of the volume. Its maximum length is 254 chars. Raises: ValueError
– If name is invalid.See also
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
name
¶ Returns the name of the volume.
Returns: The volume name. Return type: String
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
classmethod
create_cmd
(raw, direction=0)[source]¶ Override method. Direction must be 0.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 2. (cmd id + name (at least 1 byte) = 2 bytes).InvalidPacketException
– If the command type is notFSCmdType
or direction is not 0.
See also
-
-
class
digi.xbee.models.filesystem.
VolFormatCmdResponse
(status, bytes_used=None, bytes_free=None, bytes_bad=None)[source]¶ Bases:
digi.xbee.models.filesystem.VolStatCmdResponse
This class represents a format file system command response.
Command response is received as a
VolStatCmdRequest
.Class constructor. Instantiates a new
VolFormatCmdResponse
object with the provided parameters.Parameters: - status (
FSCommandStatus
or Integer) – Status of the file system command execution. - bytes_used (Integer, optional, default=`None`) – Number of used bytes.
- bytes_free (Integer, optional, default=`None`) – Number of free bytes.
- bytes_bad (Integer, optional, default=`None`) – Number of bad bytes.
Raises: ValueError
– If any of the parameters is invalid.See also
-
bytes_bad
¶ Returns “bad” bytes on volume. For XBee 3 802.15.4, DigiMesh, and Zigbee, this represents space used by deleted files.
Returns: Number of bad bytes. Return type: Integer
-
bytes_free
¶ Returns the available space on volume.
Returns: Number of free bytes. Return type: Integer
-
bytes_used
¶ Returns the used space on volume.
Returns: Number of used bytes. Return type: Integer
-
direction
¶ Returns the command direction.
Returns: 0 for request, 1 for response. Return type: Integer
-
output
()¶ Returns the raw bytearray of this command.
Returns: Raw bytearray of the command. Return type: Bytearray
-
status
¶ Returns the file system command response status.
Returns: File system command response status. Return type: FSCommandStatus
See also
FSCmd.status_value()
-
status_value
¶ Returns the file system command response status of the packet.
Returns: File system command response status. Return type: Integer See also
FSCmd.status()
-
to_dict
()¶ Returns a dictionary with all information of the command fields.
Returns: Dictionary with all info of the command fields. Return type: Dictionary
-
classmethod
create_cmd
(raw, direction=1)[source]¶ Override method. Direction must be 1.
Returns: Raises: InvalidPacketException
– If the bytearray length is less than 14. (cmd id + status + used (4 bytes) + free (4 bytes) + bad (4 bytes) = 14)InvalidPacketException
– If the command type is notFSCmdType
or direction is not 1.
See also
- status (