changelog
This commit is contained in:
parent
f18a7f49cf
commit
2aa1ecd3a7
@ -10,6 +10,10 @@ list yields a list of all related PRs for each release.
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- Health set and health announce commands
|
||||||
|
|
||||||
# [v2.16.4] 2023-03-04
|
# [v2.16.4] 2023-03-04
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
@ -28,7 +28,7 @@ class Info:
|
|||||||
def prompt_health() -> FsfwHealth:
|
def prompt_health() -> FsfwHealth:
|
||||||
for item in FsfwHealth:
|
for item in FsfwHealth:
|
||||||
print(f"{item}: {item.name}")
|
print(f"{item}: {item.name}")
|
||||||
health_idx = input("Please enter health by index: ")
|
health_idx = int(input("Please enter health by index: "))
|
||||||
return FsfwHealth(health_idx)
|
return FsfwHealth(health_idx)
|
||||||
|
|
||||||
|
|
||||||
@ -39,14 +39,14 @@ def pack_test_command(p: ServiceProviderParams):
|
|||||||
if o == OpCode.SET_HEALTH:
|
if o == OpCode.SET_HEALTH:
|
||||||
app_data = bytearray(prompt_object())
|
app_data = bytearray(prompt_object())
|
||||||
health = prompt_health()
|
health = prompt_health()
|
||||||
app_data.extend(struct.pack("!I", health))
|
app_data.append(health)
|
||||||
q.add_log_cmd(Info.SET_HEALTH)
|
q.add_log_cmd(Info.SET_HEALTH)
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
PusTelecommand(
|
PusTelecommand(
|
||||||
service=201, subservice=Subservice.TC_SET_HEALTH, app_data=app_data
|
service=201, subservice=Subservice.TC_SET_HEALTH, app_data=app_data
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if o == OpCode.ANNOUNCE_HEALTH:
|
elif o == OpCode.ANNOUNCE_HEALTH:
|
||||||
app_data = bytearray(prompt_object())
|
app_data = bytearray(prompt_object())
|
||||||
q.add_log_cmd(Info.ANNOUNCE_HEALTH)
|
q.add_log_cmd(Info.ANNOUNCE_HEALTH)
|
||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
@ -59,8 +59,8 @@ def pack_test_command(p: ServiceProviderParams):
|
|||||||
q.add_pus_tc(
|
q.add_pus_tc(
|
||||||
PusTelecommand(service=201, subservice=Subservice.TC_ANNOUNCE_HEALTH_ALL)
|
PusTelecommand(service=201, subservice=Subservice.TC_ANNOUNCE_HEALTH_ALL)
|
||||||
)
|
)
|
||||||
return
|
else:
|
||||||
raise ValueError(f"unknown op code {o} for service {CustomServiceList.HEALTH}")
|
raise ValueError(f"unknown op code {o} for service {CustomServiceList.HEALTH}")
|
||||||
|
|
||||||
|
|
||||||
@tmtc_definitions_provider
|
@tmtc_definitions_provider
|
||||||
|
@ -23,14 +23,14 @@ ACS_OBJ_DICT = {
|
|||||||
|
|
||||||
|
|
||||||
def prompt_object() -> bytes:
|
def prompt_object() -> bytes:
|
||||||
for k, v in SUBSYSTEM_DICT:
|
for k, v in SUBSYSTEM_DICT.items():
|
||||||
print(f"{k}: {v}")
|
print(f"{k}: {v}")
|
||||||
subsystem_key = int(input("Please specify target subsystem by key: "))
|
subsystem_key = int(input("Please specify target subsystem by key: "))
|
||||||
subsystem = SUBSYSTEM_DICT[subsystem_key]
|
subsystem = SUBSYSTEM_DICT[subsystem_key]
|
||||||
if subsystem is None:
|
if subsystem is None:
|
||||||
raise ValueError("invalid key")
|
raise ValueError("invalid key")
|
||||||
if subsystem == "acs":
|
if subsystem == "acs":
|
||||||
for k, v in ACS_OBJ_DICT:
|
for k, v in ACS_OBJ_DICT.items():
|
||||||
print(f"{k}: {v[0]}")
|
print(f"{k}: {v[0]}")
|
||||||
obj_key = int(input("Please specify target object by key: "))
|
obj_key = int(input("Please specify target object by key: "))
|
||||||
acs_obj = ACS_OBJ_DICT[obj_key]
|
acs_obj = ACS_OBJ_DICT[obj_key]
|
||||||
|
Loading…
Reference in New Issue
Block a user