Skip to content

Commit 4adaba8

Browse files
ludvigsjnordicjm
authored andcommitted
Bluetooth: Mesh: Store comp data hash as Number in JSON file
The comp data hash is an integer (32-bit unsigned integer), and, like other integers in the JSON file (CID, PID, etc. for instance), should be stored as a number in the JSON file, not a hex-encoded string. Signed-off-by: Ludvig Jordet <[email protected]>
1 parent 0a56342 commit 4adaba8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

doc/nrf/protocols/bt/bt_mesh/dfu_over_bt_mesh.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ For this particular example, the following output is generated:
268268
}
269269
]
270270
},
271-
"composition_hash": "0x71f3267c",
271+
"composition_hash": 1911760508,
272272
"encoded_metadata": "020000000000000094cf24017c26f3710100",
273273
"firmware_id": "59000200000000000000"
274274
}

scripts/bluetooth/mesh/mesh_dfu_metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ def compute_fwid(sysbuild_kconfigs, kconfigs):
464464
"binary_size": binary_size,
465465
"core_type": core_type,
466466
"composition_data": comp.dict_generate(),
467-
"composition_hash": str(hex(comp.hash_generate())),
467+
"composition_hash": comp.hash_generate(),
468468
"encoded_metadata": str(encoded_metadata.hex())
469469
}
470470
if fwid is not None:

tests/subsys/bluetooth/mesh/metadata_extraction/verify_metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def expected_metadata(size):
6262
{'location': 1, 'sig_models': [0, 2], 'vendor_models': []}
6363
]
6464
},
65-
'composition_hash': '0x587a2fb',
65+
'composition_hash': 92775163,
6666
'encoded_metadata': f'0102030004000000{encoded_size}01fba287050100'
6767
},
6868
{
@@ -80,7 +80,7 @@ def expected_metadata(size):
8080
{'location': 2, 'sig_models': [4097, 4099], 'vendor_models': []}
8181
]
8282
},
83-
'composition_hash': '0x13f1a143',
83+
'composition_hash': 334602563,
8484
'encoded_metadata': f'0102030004000000{encoded_size}0143a1f1130200'
8585
}
8686
]

0 commit comments

Comments
 (0)