This commit is contained in:
parent
d0b857dfb7
commit
d5e923233b
@ -654,7 +654,7 @@ def pack_star_tracker_commands( # noqa C901
|
|||||||
create_action_cmd(
|
create_action_cmd(
|
||||||
STAR_TRACKER_ID,
|
STAR_TRACKER_ID,
|
||||||
StarTrackerActionId.ADD_SECONDARY_TM_TO_NORMAL_MODE,
|
StarTrackerActionId.ADD_SECONDARY_TM_TO_NORMAL_MODE,
|
||||||
set_id.to_bytes(4, byteorder="big"),
|
struct.pack("!I", set_id),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if op_code == OpCodes.RESET_SECONDARY_TM_SET:
|
if op_code == OpCodes.RESET_SECONDARY_TM_SET:
|
||||||
@ -680,7 +680,10 @@ def request_dataset(q: DefaultPusQueueHelper, type: DataSetRequest):
|
|||||||
setId = int(input("Specify the dataset \n" ""))
|
setId = int(input("Specify the dataset \n" ""))
|
||||||
match type:
|
match type:
|
||||||
case DataSetRequest.ONESHOT:
|
case DataSetRequest.ONESHOT:
|
||||||
if setId in [SetId.SOLUTION]:
|
if setId in [
|
||||||
|
SetId.SOLUTION,
|
||||||
|
SetId.TEMPERATURE,
|
||||||
|
]:
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
create_request_one_diag_command(make_sid(STAR_TRACKER_ID, setId))
|
create_request_one_diag_command(make_sid(STAR_TRACKER_ID, setId))
|
||||||
)
|
)
|
||||||
@ -1074,15 +1077,18 @@ def handle_checksum(pw: PrintWrapper, custom_data: bytes):
|
|||||||
|
|
||||||
def handle_read_secondary_tm_set(pw: PrintWrapper, custom_data: bytes):
|
def handle_read_secondary_tm_set(pw: PrintWrapper, custom_data: bytes):
|
||||||
pw.dlog("Received secondary TM Sets")
|
pw.dlog("Received secondary TM Sets")
|
||||||
data_length = len(custom_data)
|
if len(custom_data) % 4 != 0:
|
||||||
if data_length < 1: # lul
|
raise ValueError(f"Received data of unexpected length {len(custom_data)}")
|
||||||
raise ValueError("Received data shorter than expected")
|
data_length = int(len(custom_data) / 4)
|
||||||
fmt_str = "!B" * data_length
|
fmt_str = "!" + "I" * data_length
|
||||||
inc_len = struct.calcsize(fmt_str)
|
inc_len = struct.calcsize(fmt_str)
|
||||||
set_ids = struct.unpack(fmt_str, custom_data[:inc_len])
|
set_ids = struct.unpack(fmt_str, custom_data[:inc_len])
|
||||||
pw.dlog("The following Datasets are currently Part of the secondary TM list")
|
pw.dlog("The following Datasets are currently Part of the secondary TM list")
|
||||||
for set_id in set_ids:
|
for set_id in set_ids:
|
||||||
pw.dlog(SetId(set_id).name)
|
if set_id in SetId._value2member_map_:
|
||||||
|
pw.dlog(SetId(set_id).name)
|
||||||
|
else:
|
||||||
|
pw.dlog(f"Unknown Set ID {set_id}")
|
||||||
|
|
||||||
|
|
||||||
@tmtc_definitions_provider
|
@tmtc_definitions_provider
|
||||||
@ -1154,4 +1160,3 @@ def add_str_cmds(defs: TmtcDefinitionWrapper):
|
|||||||
oce.add(OpCodes.FW_UPDATE, Info.FW_UPDATE)
|
oce.add(OpCodes.FW_UPDATE, Info.FW_UPDATE)
|
||||||
oce.add(OpCodes.SET_TIME_FROM_SYS_TIME, Info.SET_TIME_FROM_SYS_TIME)
|
oce.add(OpCodes.SET_TIME_FROM_SYS_TIME, Info.SET_TIME_FROM_SYS_TIME)
|
||||||
defs.add_service(CustomServiceList.STAR_TRACKER.value, "Star Tracker", oce)
|
defs.add_service(CustomServiceList.STAR_TRACKER.value, "Star Tracker", oce)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user