Get Path ID - 0x1C
Description
Many commands include a 16-bit field for the Path ID. If set to 0x0000, pathnames in the frame are relative to the root directory of the filesystem (/). Use the Get Path ID request to generate a Path ID for any subdirectory of the file system to allow the use of shorter relative pathnames in later requests.
-
If the Path ID field of a Request is 0x0000, the Response contains a newly-allocated Path ID for use in later Requests.
-
If the Path ID field of a Request is non-zero (such as one returned in a previous Get Path ID Response), the XBee module updates the path for that ID.
-
To release a Path ID when no longer needed (instead of waiting for a timeout), send a Request with the Path ID and a single slash ("/") as the Pathname. Any Get Path ID Request that resolves to the root directory will release the Path ID and return a 0x0000 ID.
-
Allocated Path ID values expire after 2 minutes if not used. You can refresh that timeout by sending a Get Path ID request with the Path ID and an empty or single period (".") Pathname.
-
The full, absolute path of the Path ID is included in the Response only if can fit. Any code used to process the response needs to take that into account and handle an empty Full Pathname field.
Request
Offset | Size | Frame Field | Description |
---|---|---|---|
5 | 8-bit | File System Command
|
Get Path ID - 0x1C |
6 |
16-bit | Path ID
|
Either 0x0000 to create a new Path ID, or an existing Path ID to update its location. |
8-n | variable | Pathname |
Pathname relative to Path ID. |
Success Response
Offset | Size | Frame Field | Description |
---|---|---|---|
5 | 8-bit |
File System Command |
Get Path ID x 0x1C |
6 |
8-bit |
Status |
0x00 - Success |
7 | 16-bit |
Path ID |
Value to use in later File System Requests with relative pathnames. |
9-n | variable |
Full Pathname |
If short enough to fit in the frame, the full pathname (starting with "/flash"). Deep subdirectories may return an empty field instead of their Full Pathname. The Full Pathname will never exceed 255 characters. |