Skip to content

Commit 2f4a98f

Browse files
pdgendtkrish2718
authored andcommitted
scripts: update_blobs.py: Fix version string order
The version bytes are in a reversed order, take this into account when parsing from binary. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent cedf9e6 commit 2f4a98f

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

scripts/update_blobs.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,12 @@ def parse_version_from_binary(binary_data: bytes) -> str:
3636
logger.warning("Binary too short to extract version, using default")
3737
return "1.0.0"
3838

39-
# Extract version bytes (positions 8-12)
40-
version_bytes = binary_data[8:12]
39+
# Extract version bytes (positions 8-12 reversed)
40+
version_bytes = binary_data[12:8:-1]
4141

42-
# Convert to version string: 02 0e 02 01 -> 1.2.14.2
43-
version_parts = []
44-
for byte in version_bytes:
45-
version_parts.append(str(byte))
42+
# Convert to version string: 01 02 0e 02 -> 1.2.14.2
4643

47-
version = ".".join(version_parts)
44+
version = ".".join(str(byte) for byte in version_bytes)
4845
logger.debug(f"Extracted version from binary: {version}")
4946
return version
5047

@@ -56,7 +53,7 @@ def get_wifi_blob_info(name: str) -> BlobInfo:
5653
"1.0.0", # This will be overridden by actual binary parsing
5754
f"nrf_wifi/bin/zephyr/{name}/{WIFI_FW_BIN_NAME}",
5855
f"wifi_fw_bins/{name}/{WIFI_FW_BIN_NAME}",
59-
f"https://docs.nordicsemi.com/bundle/ps_nrf7000/page/chapters/notice/doc/notice_on_sw.html",
56+
"https://docs.nordicsemi.com/bundle/ps_nrf7000/page/chapters/notice/doc/notice_on_sw.html",
6057
)
6158

6259

0 commit comments

Comments
 (0)