This commit is contained in:
parent
6420bd162a
commit
b3d903115e
@ -973,7 +973,7 @@ def handle_blobs_set(hk_data: bytes, pw: PrintWrapper):
|
|||||||
|
|
||||||
|
|
||||||
def handle_centroid_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:
|
if len(hk_data) < 14:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"Centroid dataset HK data with length {len(hk_data)} too short"
|
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):
|
def handle_matched_centroids_set(hk_data: bytes, pw: PrintWrapper):
|
||||||
pw.dlog("Received Matched Centroids Set")
|
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)
|
current_idx = unpack_time_hk(hk_data, 0, pw)
|
||||||
num_matched_centroids = hk_data[current_idx]
|
num_matched_centroids = hk_data[current_idx]
|
||||||
current_idx += 1
|
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):
|
def handle_auto_blob_set(hk_data: bytes, pw: PrintWrapper):
|
||||||
pw.dlog("Received Auto Blob Set")
|
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)
|
current_idx = unpack_time_hk(hk_data, 0, pw)
|
||||||
fmt_threshold = "!f"
|
fmt_threshold = "!f"
|
||||||
inc_len = struct.calcsize(fmt_threshold)
|
inc_len = struct.calcsize(fmt_threshold)
|
||||||
|
Loading…
Reference in New Issue
Block a user