diff --git a/scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py b/scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py index f4e9a2b2bfb014..02ebc6de0a650f 100644 --- a/scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py +++ b/scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py @@ -301,6 +301,8 @@ def generate_json(self): self._add_entry("product_id", self._args.product_id) self._add_entry("vendor_name", self._args.vendor_name) self._add_entry("product_name", self._args.product_name) + self._add_entry("product_label", self._args.product_label) + self._add_entry("part_number", self._args.part_number) self._add_entry("date", self._args.date) self._add_entry("hw_ver", self._args.hw_ver) self._add_entry("hw_ver_str", self._args.hw_ver_str) @@ -438,6 +440,10 @@ def base64_str(s): return base64.b64decode(s) the setup code. Discriminator is used during a discovery process.") # optional keys + optional_arguments.add_argument("--product_label", type=str, + help="[string] provide human-readable product label") + optional_arguments.add_argument("--part_number", type=str, + help="[string] provide human-readable product number") optional_arguments.add_argument("--chip_cert_path", type=str, help="Generate DAC and PAI certificates instead giving a path to .der files. This option requires a path to chip-cert executable." "By default You can find spake2p in connectedhomeip/src/tools/chip-cert directory and build it there.") diff --git a/scripts/tools/nrfconnect/nrfconnect_factory_data.schema b/scripts/tools/nrfconnect/nrfconnect_factory_data.schema index fa2e9a2679d6cc..73f3ddc4609daf 100644 --- a/scripts/tools/nrfconnect/nrfconnect_factory_data.schema +++ b/scripts/tools/nrfconnect/nrfconnect_factory_data.schema @@ -55,6 +55,16 @@ "type": "string", "maxLength": 32 }, + "product_label": { + "description": "more user-friendly human-readable product name", + "type": "string", + "maxLength": 64 + }, + "part_number": { + "description": "human-readable vendor assigned part number", + "type": "string", + "maxLength": 32 + }, "date": { "description": "Manufacturing date according to ISO 8601 in notation YYYY-MM-DD", "type": "string", @@ -144,4 +154,4 @@ "type": "object" } } -} \ No newline at end of file +} diff --git a/scripts/tools/nrfconnect/tests/test_generate_factory_data.py b/scripts/tools/nrfconnect/tests/test_generate_factory_data.py index 8b45a0e81556ac..dc588959c680e9 100755 --- a/scripts/tools/nrfconnect/tests/test_generate_factory_data.py +++ b/scripts/tools/nrfconnect/tests/test_generate_factory_data.py @@ -153,7 +153,9 @@ def test_generate_factory_data_all_specified(self): '--vendor_id', '0x127F', '--product_id', '0xABCD', '--vendor_name', 'Nordic Semiconductor ASA', - '--product_name', 'Lock', + '--product_name', 'Lock Gen2', + '--product_label', 'Lock', + '--part_number', 'PCA10056', '--date', '2022-07-20', '--hw_ver', '101', '--hw_ver_str', 'v1.1', @@ -177,7 +179,9 @@ def test_generate_factory_data_all_specified(self): self.assertEqual(factory_data.get('vendor_id'), 0x127F) self.assertEqual(factory_data.get('product_id'), 0xABCD) self.assertEqual(factory_data.get('vendor_name'), 'Nordic Semiconductor ASA') - self.assertEqual(factory_data.get('product_name'), 'Lock') + self.assertEqual(factory_data.get('product_name'), 'Lock Gen2') + self.assertEqual(factory_data.get('product_label'), 'Lock') + self.assertEqual(factory_data.get('part_number'), 'PCA10056') self.assertEqual(factory_data.get('date'), '2022-07-20') self.assertEqual(factory_data.get('hw_ver'), 101) self.assertEqual(factory_data.get('hw_ver_str'), 'v1.1')