From 17f18f7fc5c0f3911822a823661dab7cca1e2da6 Mon Sep 17 00:00:00 2001 From: Simon Hancock Date: Wed, 18 Sep 2024 10:39:52 +0800 Subject: [PATCH] AP_Filesystem: Add details of withdefaults query param to README --- libraries/AP_Filesystem/README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libraries/AP_Filesystem/README.md b/libraries/AP_Filesystem/README.md index cad4d76fc6..22d9c2654b 100644 --- a/libraries/AP_Filesystem/README.md +++ b/libraries/AP_Filesystem/README.md @@ -70,11 +70,12 @@ parameter. The format is: ``` uint8_t type:4; // AP_Param type NONE=0, INT8=1, INT16=2, INT32=3, FLOAT=4 - uint8_t flags:4; // for future use + uint8_t flags:4; // bit 0: default value included, bits 1-3: for future use uint8_t common_len:4; // number of name bytes in common with previous entry, 0..15 uint8_t name_len:4; // non-common length of param name -1 (0..15) uint8_t name[name_len]; // name uint8_t data[]; // value, length given by variable type + uint8_t default[]; // optional default value, included if flags bit 0 is set ``` There may be any number of leading zero pad bytes before the start of @@ -91,6 +92,10 @@ file. The name_len field is the number of non-common characters, minus one. +The default value is included only if requested by the withdefaults +query string and if different from the set value. Otherwise, flags +bit 0 will not be set, and default will be of zero length. + ### Query Strings The file name @PARAM/param.pck can optionally be extended with query @@ -101,6 +106,11 @@ string elements to change the result. For example: that means to download 10 parameters starting with parameter number 50. + - @PARAM/param.pck?withdefaults=1 + +that means to include the default values in the returned data, where +it is different from the parameter's set value. + ### Parameter Client Examples The script Tools/scripts/param_unpack.py can be used to unpack a