size check
All checks were successful
EIVE/-/pipeline/head This commit looks good

This commit is contained in:
Marius Eggert 2024-03-13 10:18:37 +01:00
parent f8d63e56cb
commit 5f71f27f0e

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): def handle_version_set(hk_data: bytes, pw: PrintWrapper):
pw.dlog("Received Version Set") 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) current_idx = unpack_time_hk(hk_data, 0, pw)
program = struct.unpack("!B", hk_data[current_idx : current_idx + 1])[0] program = struct.unpack("!B", hk_data[current_idx : current_idx + 1])[0]
pw.dlog(f"Program: {program}") pw.dlog(f"Program: {program}")