Skip to content
Snippets Groups Projects
Commit ac59d6b7 authored by Robin Mueller's avatar Robin Mueller
Browse files

added core commands

parent 84a47631
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,8 @@ Mission/Device specific information.
# TODO: Automate / Autofill this file with the MIB parser
# Object IDs
CORE_CONTROLLER_ID = bytearray([0x40, 0x00, 0x10, 0x00])
SW_IMAGE_HANDLER_ID = bytearray([0x4D, 0x00, 0x90, 0x00])
PUS_SERVICE_17 = bytearray([0x53, 0x00, 0x00, 0x17])
GPS0_DEVICE_ID = bytearray([0x44, 0x10, 0x1F, 0x00])
GPS1_DEVICE_ID = bytearray([0x44, 0x20, 0x20, 0x00])
......@@ -28,7 +30,6 @@ THERMAL_SENSOR_DEVICE_ID = bytearray([0x44, 0x11, 0x54, 0x00])
GYRO_DEVICE_ID = bytearray([0x44, 0x11, 0x55, 0x00])
TEST_TASK_ID = bytearray([0x42, 0x69, 0x42, 0x69])
SD_CARD_HANDLER_ID = bytearray([0x4D, 0x00, 0x73, 0xAD])
SW_IMAGE_HANDLER_ID = bytearray([0x4D, 0x00, 0x90, 0x00])
INTERNAL_ERROR_REPORTER_ID = bytearray([0x53, 0x04, 0x00, 0x00])
# Commands
......
......@@ -20,6 +20,7 @@ from tc.obsw_tc_service200 import pack_mode_data, pack_service200_test_into
from tc.obsw_tc_service5_17 import pack_service5_test_into, pack_service17_test_into
from tc.obsw_image_handler import generate_img_handler_packet
from tc.obsw_tc_gps import pack_gps_test_into
from tc.obsw_tc_core import pack_core_command
from tmtc_core.utility.obsw_logger import get_logger
import config.obsw_config as g
......@@ -48,23 +49,25 @@ class ServiceQueuePacker:
return pack_service17_test_into(service_queue)
if service == 20:
return pack_service20_test_into(service_queue)
if service == 23 or service == "SD":
if service == 23 or service.lower() == "sd":
return pack_service23_commands_into(service_queue, op_code)
if service == 200:
return pack_service200_test_into(service_queue)
if service == "Dummy":
if service.lower() == "dummy":
return pack_dummy_device_test_into(service_queue)
if service == "Img":
if service.lower() == "img":
return generate_img_handler_packet(service_queue, op_code)
if service == "GPS0":
if service.lower() == "core":
return pack_core_command(service_queue, op_code)
if service.lower() == "gps0":
# Object ID: GPS Device
object_id = g.GPS0_DEVICE_ID
return pack_gps_test_into(object_id, service_queue)
if service == "GPS1":
if service.lower() == "gps1":
# Object ID: GPS Device
object_id = g.GPS1_DEVICE_ID
return pack_gps_test_into(object_id, service_queue)
if service == "Error":
if service.lower() == "Error":
return pack_error_testing_into(service_queue)
LOGGER.warning("Invalid Service !")
......
from typing import Deque
from config.obsw_config import CORE_CONTROLLER_ID
from tc.obsw_tc_service8 import make_action_id
from tmtc_core.tc.obsw_pus_tc_base import PusTelecommand
def pack_core_command(tc_queue: Deque, op_code: int, ssc: int = 0):
if op_code == 10:
tc_queue.appendleft(("print", "Resetting OBC."))
command = generate_reset_obc_command(ssc=ssc)
tc_queue.appendleft(command.pack_command_tuple())
def generate_reset_obc_command(ssc: int, object_id: bytearray = CORE_CONTROLLER_ID):
app_data = bytearray(object_id)
app_data += make_action_id(10)
return PusTelecommand(service=8, subservice=128, ssc=ssc, app_data=app_data)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment