Add SUPV latchup report handling, clean up code #273
@ -861,8 +861,8 @@ def handle_counters_report(hk_data: bytes):
|
|||||||
|
|
||||||
|
|
||||||
def handle_latchup_status_report(hk_data: bytes):
|
def handle_latchup_status_report(hk_data: bytes):
|
||||||
# 1 byte ID, 7 times 2 bytes of counts, and 8 bytes of time.
|
# 1 byte ID, 7 times 2 bytes of counts, and 8 bytes of time and 1 byte sync status.
|
||||||
if len(hk_data) < 23:
|
if len(hk_data) < 24:
|
||||||
raise ValueError("Latchup status report smaller than expected")
|
raise ValueError("Latchup status report smaller than expected")
|
||||||
current_idx = 0
|
current_idx = 0
|
||||||
id = hk_data[current_idx]
|
id = hk_data[current_idx]
|
||||||
@ -889,6 +889,9 @@ def handle_latchup_status_report(hk_data: bytes):
|
|||||||
current_idx += 1
|
current_idx += 1
|
||||||
# Is stored as years since 1900.
|
# Is stored as years since 1900.
|
||||||
time_year = 1900 + hk_data[current_idx]
|
time_year = 1900 + hk_data[current_idx]
|
||||||
|
current_idx += 1
|
||||||
|
is_synced = hk_data[current_idx]
|
||||||
|
print(f"Time Sync Status: {is_synced}")
|
||||||
try:
|
try:
|
||||||
dt = datetime(
|
dt = datetime(
|
||||||
year=time_year,
|
year=time_year,
|
||||||
|
Loading…
Reference in New Issue
Block a user