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
[nrfconnect] Added support for user data in Factory Data parser (#24088)
* [nrfconnect] Added support for user data in Factory Data parser
Factory data parser did not contain methods to obtain user data.
- Added two methods: GetUserData to obtain raw user data
and GetUserKey to obtain a single key.
- Improved the FactoryDataParser to read and manage the user data field.
- Improved documentation.
* Restyled by prettier-markdown
Co-authored-by: Restyled.io <commits@restyled.io>
-[Creating factory data JSON file with the first script](#creating-factory-data-json-file-with-the-first-script)
44
+
-[How to set user data](#how-to-set-user-data)
45
+
-[How to handle user data](#how-to-handle-user-data)
44
46
-[Verifying using the JSON Schema tool](#verifying-using-the-json-schema-tool)
45
47
-[Option 1: Using the php-json-schema tool](#option-1-using-the-php-json-schema-tool)
46
48
-[Option 2: Using a website validator](#option-2-using-a-website-validator)
@@ -110,7 +112,7 @@ The following table lists the parameters of a factory data set:
110
112
|`spake2_verifier`| SPAKE2+ verifier | 97 B | byte string | mandatory | The SPAKE2+ verifier generated using SPAKE2+ salt, iteration counter, and passcode. |
111
113
|`discriminator`| Discriminator | 2 B | uint16 | mandatory | A 12-bit value matching the field of the same name in the setup code. The discriminator is used during the discovery process. |
112
114
|`passcode`| SPAKE passcode | 4 B | uint32 | optional | A pairing passcode is a 27-bit unsigned integer which serves as a proof of possession during the commissioning. Its value must be restricted to the values from `0x0000001` to `0x5F5E0FE` (`00000001` to `99999998` in decimal), excluding the following invalid passcode values: `00000000`, `11111111`, `22222222`, `33333333`, `44444444`, `55555555`, `66666666`, `77777777`, `88888888`, `99999999`, `12345678`, `87654321`. |
113
-
|`user`| User data | variable | JSON string | max 1024 B |The user data is provided in the JSON format. This parameter is optional and depends on user's or manufacturer's purpose (or both). It is provided as a string from persistent storage and should be parsed in the user application. This data is not used by the Matter stack. |
115
+
|`user`| User data | variable | JSON string | max 1024 B | The user data is provided in the JSON format. This parameter is optional and depends on device manufacturer's purpose. It is provided as a CBOR map type from persistent storage and should be parsed in the user application. This data is not used by the Matter stack. To learn how to work with user data, see [How to set user data](#how-to-set-user-data) section.|
114
116
115
117
### Factory data format
116
118
@@ -345,6 +347,89 @@ If the script finishes successfully, go to the location you provided with the
345
347
> location as an existing file. To allow overwriting, add the `--overwrite`
346
348
> option to the argument list of the Python script.
347
349
350
+
### How to set user data
351
+
352
+
The user data is an optional field provided in the factory data JSON file and
353
+
depends on the manufacturer's purpose. The `user` field in a JSON factory data
354
+
file is represented by a flat JSON map and it can consist of `string` or `int32`
355
+
data types only. On the device side, the `user` data will be available as a CBOR
356
+
map containing all defined `string` and `int32` fields.
0 commit comments