size check
EIVE/-/pipeline/head This commit looks good Details

This commit is contained in:
Marius Eggert 2024-03-13 10:18:37 +01:00
parent f8d63e56cb
commit 5f71f27f0e
1 changed files with 4 additions and 0 deletions

View File

@ -916,6 +916,10 @@ def unpack_time_hk(hk_data: bytes, current_idx: int, pw: PrintWrapper) -> int:
def handle_version_set(hk_data: bytes, pw: PrintWrapper):
pw.dlog("Received Version Set")
if len(hk_data) != 16:
_LOGGER.warning(
f"Version dataset HK with length {len(hk_data)} of unexpected size"
)
current_idx = unpack_time_hk(hk_data, 0, pw)
program = struct.unpack("!B", hk_data[current_idx : current_idx + 1])[0]
pw.dlog(f"Program: {program}")