digi.xbee.models.filesystem module
- class digi.xbee.models.filesystem.FSCmdType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
EnumThis 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’)- property code
Returns the code of the file system command element.
- Returns:
Code of the file system command element.
- Return type:
Integer
- property 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:
objectThis class represents a file system command.
Class constructor. Instantiates a new
FSCmdobject with the provided parameters.- Parameters:
cmd_type (
FSCmdTypeor Integer) – The command type.direction (Integer, optional, default=0) – If this command is a request (0) or a response (1).
status (
FSCommandStatusor Integer) – Status of the file system command execution. Only for response commands.
- Raises:
ValueError – If cmd_type is not an integer or a
FSCmdType.ValueError – If cmd_type is invalid.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
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
- 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.
- class digi.xbee.models.filesystem.UnknownFSCmd(raw, direction=0)[source]
Bases:
FSCmdThis class represents an unknown file system command.
Class constructor. Instantiates a new
UnknownFSCmdobject 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
- property 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
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- class digi.xbee.models.filesystem.FileIdCmd(cmd_type, fid, direction=0, status=None)[source]
Bases:
FSCmdThis class represents a file system command request or response that includes a file or path id.
Class constructor. Instantiates a new
FileIdCmdobject with the provided parameters.- Parameters:
cmd_type (
FSCmdTypeor 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 (
FSCommandStatusor Integer) – Status of the file system command execution. Only for response commands.
- Raises:
ValueError – If fid is invalid.
See also
- property 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:
- Raises:
InvalidPacketException – If the bytearray length is less than the minimum required.
See also
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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.FileIdNameCmd(cmd_type, fid, name, direction=0, status=None)[source]
Bases:
FileIdCmdThis 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
FileIdNameCmdobject with the provided parameters.- Parameters:
cmd_type (
FSCmdTypeor 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 (
FSCommandStatusor Integer) – Status of the file system command execution. Only for response commands.
- Raises:
ValueError – If fid or name are invalid.
See also
- property 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:
- Raises:
InvalidPacketException – If the bytearray length is less than the minimum required.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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.OpenFileCmdRequest(path_id, name, flags)[source]
Bases:
FileIdNameCmdThis 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
OpenFileCmdRequestobject 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. UseFileOpenRequestOptionto compose its value.
- Raises:
ValueError – If any of the parameters is invalid.
See also
- property options
Returns the options to open the file.
- Returns:
The options to open the file.
- Return type:
- 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 not
FSCmdTypeor direction is not 0.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property fs_id
Returns the file/path identifier.
- Returns:
The file/path id value.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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:
FileIdCmdThis class represents a file open/create file system command response.
This is received in response of an
OpenFileCmdRequest.Class constructor. Instantiates a new
OpenFileCmdResponseobject with the provided parameters.- Parameters:
status (
FSCommandStatusor 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
- property 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 not
FSCmdTypeor direction is not 1.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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.CloseFileCmdRequest(fid)[source]
Bases:
FileIdCmdThis 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
CloseFileCmdRequestobject 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 not
FSCmdTypeor direction is not 0.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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.CloseFileCmdResponse(status)[source]
Bases:
FSCmdThis class represents a file close file system command response.
Command response is received as a
CloseFileCmdRequest.Class constructor. Instantiates a new
CloseFileCmdResponseobject with the provided parameters.- Parameters:
status (
FSCommandStatusor 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 not
FSCmdTypeor direction is not 1.
See also
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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.ReadFileCmdRequest(fid, offset, size)[source]
Bases:
FileIdCmdThis class represents a read file system command request.
Command response is received as a
ReadFileCmdResponse.Class constructor. Instantiates a new
ReadFileCmdRequestobject 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)
- property offset
Returns the file offset to start reading. 0xFFFFFFFF to use current position (ReadFileCmdRequest.0xFFFFFFFF)
- Returns:
The file offset.
- Return type:
Integer
- property 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 not
FSCmdTypeor direction is not 0.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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:
FileIdCmdThis class represents a read file system command response.
Command response is received as a
ReadFileCmdRequest.Class constructor. Instantiates a new
ReadFileCmdResponseobject with the provided parameters.- Parameters:
status (
FSCommandStatusor 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
- property offset
Returns the offset of the read data.
- Returns:
The data offset.
- Return type:
Integer
- property 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 not
FSCmdTypeor direction is not 1.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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.WriteFileCmdRequest(fid, offset, data=None)[source]
Bases:
FileIdCmdThis class represents a write file system command request.
Command response is received as a
WriteFileCmdResponse.Class constructor. Instantiates a new
WriteFileCmdRequestobject 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.
- property offset
Returns the file offset to start writing.
- Returns:
The file offset.
- Return type:
Integer
- property 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 not
FSCmdTypeor direction is not 0.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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:
FileIdCmdThis class represents a write file system command response.
Command response is received as a
WriteFileCmdRequest.Class constructor. Instantiates a new
WriteFileCmdResponseobject with the provided parameters.- Parameters:
status (
FSCommandStatusor 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
- property 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 not
FSCmdTypeor direction is not 1.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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.HashFileCmdRequest(path_id, name)[source]
Bases:
FileIdNameCmdThis 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
HashFileCmdRequestobject 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 not
FSCmdTypeor direction is not 0.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property fs_id
Returns the file/path identifier.
- Returns:
The file/path id value.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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:
FSCmdThis class represents a file hash command response.
This is received in response of an
HashFileCmdRequest.Class constructor. Instantiates a new
HashFileCmdResponseobject with the provided parameters.- Parameters:
status (
FSCommandStatusor 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
- property 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 not
FSCmdTypeor direction is not 1.
See also
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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.CreateDirCmdRequest(path_id, name)[source]
Bases:
FileIdNameCmdThis 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
CreateDirCmdRequestobject 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 not
FSCmdTypeor direction is not 0.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property fs_id
Returns the file/path identifier.
- Returns:
The file/path id value.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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:
FSCmdThis class represents a create directory file system command response.
Command response is received as a
CreateDirCmdRequest.Class constructor. Instantiates a new
CreateDirCmdResponseobject with the provided parameters.- Parameters:
status (
FSCommandStatusor 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 not
FSCmdTypeor direction is not 1.
See also
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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.OpenDirCmdRequest(path_id, name)[source]
Bases:
FileIdNameCmdThis class represents an open directory file system command request.
Command response is received as a
OpenDirCmdResponse.Class constructor. Instantiates a new
OpenDirCmdRequestobject 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 not
FSCmdTypeor direction is not 0.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property fs_id
Returns the file/path identifier.
- Returns:
The file/path id value.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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:
FileIdCmdThis 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
OpenFileCmdResponseobject with the provided parameters.- Parameters:
status (
FSCommandStatusor 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
- property 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
- property 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 not
FSCmdTypeor direction is not 1.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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.CloseDirCmdRequest(did)[source]
Bases:
FileIdCmdThis class represents a directory close file system command request.
Command response is received as a
CloseDirCmdResponse.Class constructor. Instantiates a new
CloseDirCmdRequestobject 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 not
FSCmdTypeor direction is not 0.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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.CloseDirCmdResponse(status)[source]
Bases:
FSCmdThis 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
CloseDirCmdResponseobject with the provided parameters.- Parameters:
status (
FSCommandStatusor 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 not
FSCmdTypeor direction is not 1.
See also
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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.ReadDirCmdRequest(did)[source]
Bases:
FileIdCmdThis class represents a directory read file system command request.
Command response is received as a
ReadDirCmdResponse.Class constructor. Instantiates a new
ReadDirCmdRequestobject 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 not
FSCmdTypeor direction is not 0.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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.ReadDirCmdResponse(status, did=None, fs_entries=None)[source]
Bases:
OpenDirCmdResponseThis 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
ReadDirCmdResponseobject with the provided parameters.- Parameters:
status (
FSCommandStatusor 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 not
FSCmdTypeor direction is not 1.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property fs_entries
Returns the list of entries inside the opened directory.
- Returns:
List of :class: .`FileSystemElement` inside the directory.
- Return type:
List
- property fs_id
Returns the file/path identifier.
- Returns:
The file/path id value.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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.GetPathIdCmdRequest(path_id, name)[source]
Bases:
FileIdNameCmdThis 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
GetPathIdCmdRequestobject 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 not
FSCmdTypeor direction is not 0.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property fs_id
Returns the file/path identifier.
- Returns:
The file/path id value.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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:
FileIdCmdThis 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
GetPathIdCmdResponseobject with the provided parameters.- Parameters:
status (
FSCommandStatusor 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
- property 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 not
FSCmdTypeor direction is not 1.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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.RenameCmdRequest(path_id, name, new_name)[source]
Bases:
FileIdNameCmdThis 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
RenameCmdRequestobject 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
- property 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 not
FSCmdTypeor direction is not 0.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property fs_id
Returns the file/path identifier.
- Returns:
The file/path id value.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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:
FSCmdThis class represents a rename file system command response.
Command response is received as a
RenameCmdRequest.Class constructor. Instantiates a new
RenameCmdResponseobject with the provided parameters.- Parameters:
status (
FSCommandStatusor 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 not
FSCmdTypeor direction is not 1.
See also
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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.DeleteCmdRequest(path_id, name)[source]
Bases:
FileIdNameCmdThis 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
DeleteCmdRequestobject 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 not
FSCmdTypeor direction is not 0.
See also
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property fs_id
Returns the file/path identifier.
- Returns:
The file/path id value.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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:
FSCmdThis class represents a delete file system command response.
Command response is received as a
DeleteCmdRequest.Class constructor. Instantiates a new
DeleteCmdResponseobject with the provided parameters.- Parameters:
status (
FSCommandStatusor 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 not
FSCmdTypeor direction is not 1.
See also
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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.VolStatCmdRequest(name)[source]
Bases:
FSCmdThis 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
VolStatCmdRequestobject 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
- property 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 not
FSCmdTypeor direction is not 0.
See also
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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:
FSCmdThis class represents a stat file system command response.
Command response is received as a
VolStatCmdRequest.Class constructor. Instantiates a new
VolStatCmdResponseobject with the provided parameters.- Parameters:
status (
FSCommandStatusor 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
- property bytes_used
Returns the used space on volume.
- Returns:
Number of used bytes.
- Return type:
Integer
- property bytes_free
Returns the available space on volume.
- Returns:
Number of free bytes.
- Return type:
Integer
- property 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 not
FSCmdTypeor direction is not 1.
See also
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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.VolFormatCmdRequest(name)[source]
Bases:
VolStatCmdRequestThis class represents a volume format file system command request.
Command response is received as a
VolFormatCmdResponse.Class constructor. Instantiates a new
VolFormatCmdRequestobject 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
- property direction
Returns the command direction.
- Returns:
0 for request, 1 for response.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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 not
FSCmdTypeor direction is not 0.
See also
- class digi.xbee.models.filesystem.VolFormatCmdResponse(status, bytes_used=None, bytes_free=None, bytes_bad=None)[source]
Bases:
VolStatCmdResponseThis class represents a format file system command response.
Command response is received as a
VolStatCmdRequest.Class constructor. Instantiates a new
VolFormatCmdResponseobject with the provided parameters.- Parameters:
status (
FSCommandStatusor 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
- property 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
- property bytes_free
Returns the available space on volume.
- Returns:
Number of free bytes.
- Return type:
Integer
- property bytes_used
Returns the used space on volume.
- Returns:
Number of used bytes.
- Return type:
Integer
- property 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
- property status
Returns the file system command response status.
- Returns:
File system command response status.
- Return type:
See also
- property status_value
Returns the file system command response status of the packet.
- Returns:
File system command response status.
- Return type:
Integer
See also
- 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 not
FSCmdTypeor direction is not 1.
See also