Merge pull request 'added missing act cmd' (#295) from gnss-improv into main
All checks were successful
EIVE/-/pipeline/head This commit looks good

Reviewed-on: #295
This commit is contained in:
Marius Eggert 2024-04-29 11:42:51 +02:00
commit da35c7fdf1
3 changed files with 20 additions and 11 deletions

View File

@ -10,6 +10,10 @@ list yields a list of all related PRs for each release.
# [unreleased] # [unreleased]
## Fixed
- GNSS commands working again (again).
## Added ## Added
- Added handling for new clock events. - Added handling for new clock events.

View File

@ -227,7 +227,7 @@ def handle_acs_procedure(queue_helper: DefaultPusQueueHelper, cmd_path_list: Lis
object_id=RW4_ID, rw_idx=4, q=queue_helper, cmd_str=cmd_path_list[2] object_id=RW4_ID, rw_idx=4, q=queue_helper, cmd_str=cmd_path_list[2]
) )
if cmd_path_list[0] == "gnss_devs": if cmd_path_list[0] == "gnss_ctrl":
return pack_gps_command( return pack_gps_command(
object_id=oids.GPS_CONTROLLER, q=queue_helper, cmd_str=cmd_path_list[1] object_id=oids.GPS_CONTROLLER, q=queue_helper, cmd_str=cmd_path_list[1]
) )

View File

@ -23,7 +23,11 @@ class GpsInfo:
MAX_SATELLITES = 30 MAX_SATELLITES = 30
class GnssChip(enum.IntEnum): class ActIds:
RESET_GNSS = 5
class AcsBoardSides(enum.IntEnum):
A_SIDE = 0 A_SIDE = 0
B_SIDE = 1 B_SIDE = 1
@ -37,7 +41,7 @@ class OpCode:
REQ_SKYVIEW_HK = "skyview_hk_request" REQ_SKYVIEW_HK = "skyview_hk_request"
ENABLE_SKYVIEW_HK = "skyview_hk_enable" ENABLE_SKYVIEW_HK = "skyview_hk_enable"
DISABLE_SKYVIEW_HK = "skyview_hk_disable" DISABLE_SKYVIEW_HK = "skyview_hk_disable"
RESET_GNSS = "reset" RESET_GNSS = "reset_gnss"
class Info: class Info:
@ -63,7 +67,7 @@ def create_gnss_node() -> CmdTreeNode:
] ]
info_strs = [getattr(Info, key) for key in dir(OpCode) if not key.startswith("__")] info_strs = [getattr(Info, key) for key in dir(OpCode) if not key.startswith("__")]
combined_dict = dict(zip(op_code_strs, info_strs)) combined_dict = dict(zip(op_code_strs, info_strs))
node = CmdTreeNode("gnss_devs", "GNSS Controller", hide_children_for_print=True) node = CmdTreeNode("gnss_ctrl", "GNSS Ctrl", hide_children_for_print=True)
for op_code, info in combined_dict.items(): for op_code, info in combined_dict.items():
node.add_child(CmdTreeNode(op_code, info)) node.add_child(CmdTreeNode(op_code, info))
return node return node
@ -73,16 +77,17 @@ def pack_gps_command( # noqa: C901
object_id: bytes, q: DefaultPusQueueHelper, cmd_str: str object_id: bytes, q: DefaultPusQueueHelper, cmd_str: str
): # noqa: C901: ): # noqa: C901:
if cmd_str == OpCode.RESET_GNSS: if cmd_str == OpCode.RESET_GNSS:
for val in GnssChip: for val in AcsBoardSides:
print("{:<2}: {:<20}".format(val, val.name)) print("{:<2}: {:<20}".format(val, val.name))
chip: str = "" board_side = int(input("Select Board Side \n" ""))
while chip not in ["0", "1"]: q.add_log_cmd(f"GPS: {Info.RESET_GNSS}")
chip = input("Please specify which chip to reset: ")
q.add_log_cmd(f"gps: {Info.DISABLE_CORE_HK}")
q.add_pus_tc( q.add_pus_tc(
create_action_cmd(object_id=object_id, action_id=5, user_data=chip.encode()) create_action_cmd(
object_id=object_id,
action_id=ActIds.RESET_GNSS,
user_data=bytearray([board_side]),
)
) )
_LOGGER.warning("Reset pin handling needs to be re-implemented")
if cmd_str == OpCode.ENABLE_CORE_HK: if cmd_str == OpCode.ENABLE_CORE_HK:
interval = float(input("Please specify interval in floating point seconds: ")) interval = float(input("Please specify interval in floating point seconds: "))
if interval <= 0: if interval <= 0: