You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,14 +104,13 @@ Commands
104
104
105
105
Commands always start with a fixed header. The first entry is always the command number itself encoded in a single byte. The number of subsequent entries in the header will vary by command. The entire header must be sent as a unit so set the characteristic with the full header packet. You can combine multiple commands into a single write as long as the complete header is in the packet.
106
106
107
-
Paths use ``/`` as a separator and full paths must start with ``/``. Directory paths
108
-
must end with ``/`` when provided as a full path.
107
+
Paths use ``/`` as a separator and full paths must start with ``/``.
109
108
110
109
All numbers are unsigned.
111
110
112
111
All values are aligned with respect to the start of the packet.
113
112
114
-
Status bytes are ``0x01`` for OK and ``0x02`` for error. Other values for error may be used for specific commands.
113
+
Status bytes are ``0x01`` for OK and ``0x02`` for error. Values other than ``0x01`` are errors. ``0x00`` should not be used for a specific error but still considered an error. ``0x05`` is an error for trying to modify a read-only filesystem.
115
114
116
115
``0x10`` - Read a file
117
116
++++++++++++++++++++++
@@ -167,7 +166,7 @@ The header is four fixed entries and a variable length path:
167
166
The server will repeatedly respond until the total length has been transferred with:
168
167
169
168
* Command: Single byte. Always ``0x21``.
170
-
* Status: Single byte. ``0x01`` if OK. ``0x02`` if any parent directory is missing or a file.
169
+
* Status: Single byte. ``0x01`` if OK. ``0x05`` if the filesystem is read-only. ``0x02`` if any parent directory is missing or a file.
171
170
* 2 Bytes reserved for padding.
172
171
* Offset: 32-bit number encoding the starting offset to write. (Should match the offset from the previous 0x20 or 0x22 message)
173
172
* Truncated time: 64-bit number encoding nanoseconds since January 1st, 1970 as stored by the file system. The resolution may be less that the protocol. It is sent back for use in caching on the host side.
@@ -202,7 +201,7 @@ The header is two fixed entries and a variable length path:
202
201
The server will reply with:
203
202
204
203
* Command: Single byte. Always ``0x31``.
205
-
* Status: Single byte. ``0x01`` if the file or directory was deleted or ``0x02`` if the path is non-existent.
204
+
* Status: Single byte. ``0x01`` if the file or directory was deleted, ``0x05`` if the filesystem is read-only or ``0x02`` if the path is non-existent.
206
205
207
206
**NOTE**: In version 2, this command now deletes contents of a directory as well. It won't error.
208
207
@@ -223,7 +222,7 @@ The header is two fixed entries and a variable length path:
223
222
The server will reply with:
224
223
225
224
* Command: Single byte. Always ``0x41``.
226
-
* Status: Single byte. ``0x01`` if the directory(s) were created or ``0x02`` if any parent of the path is an existing file.
225
+
* Status: Single byte. ``0x01`` if the directory(s) were created, ``0x05`` if the filesystem is read-only or ``0x02`` if any parent of the path is an existing file.
227
226
* 6 Bytes reserved for padding.
228
227
* Truncated time: 64-bit number encoding nanoseconds since January 1st, 1970 as stored by the file system. The resolution may be less that the protocol. It is sent back for use in caching on the host side.
229
228
@@ -275,8 +274,9 @@ The header is two fixed entries and a variable length path:
275
274
* New Path: UTF-8 encoded string that is *not* null terminated. (We send the length instead.)
276
275
277
276
The server will reply with:
277
+
278
278
* Command: Single byte. Always ``0x61``.
279
-
* Status: Single byte. ``0x01`` on successor ``0x02`` on error.
279
+
* Status: Single byte. ``0x01`` on success, ``0x05`` if read-only, or ``0x02`` on other error.
280
280
281
281
**NOTE**: This is added in version 4.
282
282
@@ -297,6 +297,8 @@ Version 3
297
297
Version 4
298
298
---------
299
299
* Adds move command.
300
+
* Adds 0x05 error for read-only filesystems. This is commonly that USB is editing the same filesystem.
301
+
* Removes requirement that directory paths end with /.
0 commit comments