push
EIVE/-/pipeline/pr-main This commit looks good Details

This commit is contained in:
Marius Eggert 2023-10-26 17:48:18 +02:00
parent 6420bd162a
commit b3d903115e
1 changed files with 9 additions and 1 deletions

View File

@ -973,7 +973,7 @@ def handle_blobs_set(hk_data: bytes, pw: PrintWrapper):
def handle_centroid_set(hk_data: bytes, pw: PrintWrapper):
pw.dlog("Received Centroid set")
pw.dlog("Received Centroid Set")
if len(hk_data) < 14:
raise ValueError(
f"Centroid dataset HK data with length {len(hk_data)} too short"
@ -1008,6 +1008,10 @@ def handle_centroids_set(hk_data: bytes, pw: PrintWrapper):
def handle_matched_centroids_set(hk_data: bytes, pw: PrintWrapper):
pw.dlog("Received Matched Centroids Set")
if len(hk_data) < 4 + 8 + 1 + 4 * 16 * 5:
raise ValueError(
f"Matched Centroids dataset HK data with length {len(hk_data)} too short. Expected 333 bytes."
)
current_idx = unpack_time_hk(hk_data, 0, pw)
num_matched_centroids = hk_data[current_idx]
current_idx += 1
@ -1042,6 +1046,10 @@ def handle_matched_centroids_set(hk_data: bytes, pw: PrintWrapper):
def handle_auto_blob_set(hk_data: bytes, pw: PrintWrapper):
pw.dlog("Received Auto Blob Set")
if len(hk_data) < 4 + 8 + 4:
raise ValueError(
f"Matched Centroids dataset HK data with length {len(hk_data)} too short. Expected 16 bytes."
)
current_idx = unpack_time_hk(hk_data, 0, pw)
fmt_threshold = "!f"
inc_len = struct.calcsize(fmt_threshold)