some minor bugfixes
All checks were successful
EIVE/-/pipeline/head This commit looks good

This commit is contained in:
2024-01-31 16:49:54 +01:00
parent c6b2edf688
commit f93f713b0e
2 changed files with 25 additions and 14 deletions

View File

@ -264,14 +264,16 @@ def pack_ploc_supv_commands(p: ServiceProviderParams): # noqa C901
action_cmd = create_action_cmd(
PLOC_SUPV_ID, SupvActionId.GET_BOOT_STATUS_REPORT
)
q.add_wait_seconds(2.0)
if action_cmd is None:
_LOGGER.warning(f"invalid set ID {set_id!r} for PLOC SUPV")
return
# Now dump the HK set.
sid = make_sid(object_id.as_bytes, set_id)
req_hk = generate_one_hk_command(sid)
q.add_pus_tc(action_cmd)
q.add_wait_seconds(2.0)
q.add_pus_tc(req_hk)
assert action_cmd is not None
q.add_pus_tc(action_cmd)
elif op_code == OpCode.START_MPSOC:
q.add_log_cmd("PLOC Supervisor: Start MPSoC")
command = obyt + struct.pack("!I", SupvActionId.START_MPSOC)
@ -885,14 +887,21 @@ def handle_latchup_status_report(hk_data: bytes):
current_idx += 1
time_month = hk_data[current_idx]
current_idx += 1
time_year = hk_data[current_idx]
dt = datetime(
year=time_year,
month=time_month,
day=time_day,
hour=time_hour,
minute=time_minutes,
second=time_seconds,
microsecond=time_ms * 1000,
)
print(f"Time Now: {dt}")
# Is stored as years since 1900.
time_year = 1900 + hk_data[current_idx]
try:
dt = datetime(
year=time_year,
month=time_month,
day=time_day,
hour=time_hour,
minute=time_minutes,
second=time_seconds,
microsecond=time_ms * 1000,
)
print(f"Time Now: {dt}")
except ValueError:
print(
f"Time: {time_day}.{time_month}.{time_year}T"
f"{time_hour}:{time_minutes}:{time_seconds}.{time_ms}"
)