eive-tmtc/pus_tc/devs/gps.py

27 lines
821 B
Python

import enum
from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.definitions import TcQueueT
from tmtccmd.tc.pus_8_funccmd import generate_action_command
from config.object_ids import GPS_HANDLER_1_ID, GPS_CONTROLLER
class GpsOpCodes(enum.Enum):
RESET_GNSS = "5"
class SetIds:
HK = 0
def pack_gps_command(object_id: bytes, tc_queue: TcQueueT, op_code: str):
if op_code == GpsOpCodes.RESET_GNSS.value:
if object_id == GPS_CONTROLLER:
tc_queue.appendleft((QueueCommands.PRINT, "Resetting GPS device 0"))
elif object_id == GPS_HANDLER_1_ID:
tc_queue.appendleft((QueueCommands.PRINT, "Resetting GPS device 1"))
cmd = generate_action_command(object_id=object_id, action_id=int(op_code))
tc_queue.appendleft(cmd.pack_command_tuple())