diff --git a/.run/Ping Command.run.xml b/.run/Ping Command.run.xml
index 6cd3521..7c81b41 100644
--- a/.run/Ping Command.run.xml
+++ b/.run/Ping Command.run.xml
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/tmtcc_Service_17.run.xml b/.run/Test Service w Listener.run.xml
similarity index 82%
rename from .run/tmtcc_Service_17.run.xml
rename to .run/Test Service w Listener.run.xml
index f5951c7..e6c8b0d 100644
--- a/.run/tmtcc_Service_17.run.xml
+++ b/.run/Test Service w Listener.run.xml
@@ -1,5 +1,5 @@
-
+
@@ -13,7 +13,7 @@
-
+
diff --git a/.run/Service 17.run.xml b/.run/Test Service.run.xml
similarity index 83%
rename from .run/Service 17.run.xml
rename to .run/Test Service.run.xml
index e3be66e..1c76d11 100644
--- a/.run/Service 17.run.xml
+++ b/.run/Test Service.run.xml
@@ -1,5 +1,5 @@
-
+
@@ -13,7 +13,7 @@
-
+
diff --git a/config/definitions.py b/config/definitions.py
index 3d062ac..8e2c76e 100644
--- a/config/definitions.py
+++ b/config/definitions.py
@@ -11,7 +11,9 @@ PUS_APID = 0x65
SPACE_PACKET_IDS = (0x08 << 8 | PUS_APID,)
-class CustomServiceList(enum.Enum):
+class CustomServiceList(str, enum.Enum):
+ value: str
+
TEST_DEVICE = "test"
P60DOCK = "p60dock"
PDU1 = "pdu1"
diff --git a/deps/tmtccmd b/deps/tmtccmd
index d042315..9bea7dc 160000
--- a/deps/tmtccmd
+++ b/deps/tmtccmd
@@ -1 +1 @@
-Subproject commit d042315e4cc0b5d0b13ceaaf5e3f36e8ad455740
+Subproject commit 9bea7dc80f855965eb8466419bcb03eb58acc162
diff --git a/pus_tc/cmd_definitions.py b/pus_tc/cmd_definitions.py
index 18eb8a0..4a56413 100644
--- a/pus_tc/cmd_definitions.py
+++ b/pus_tc/cmd_definitions.py
@@ -1,7 +1,7 @@
from pus_tc.devs.bpx_batt import BpxOpCodes
from config.definitions import CustomServiceList
-from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
+from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry, CoreServiceList
from tmtccmd.config.tmtc import (
tmtc_definitions_provider,
call_all_definitions_providers,
@@ -14,6 +14,20 @@ def get_eive_service_op_code_dict() -> TmtcDefinitionWrapper:
the :py:func:`tmtc_definitions_provider` decorator.
"""
def_wrapper = get_default_tmtc_defs()
+ srv_5 = OpCodeEntry()
+ srv_5.add("0", "Event Test")
+ def_wrapper.add_service(
+ name=CoreServiceList.SERVICE_5.value,
+ info="PUS Service 5 Event",
+ op_code_entry=srv_5,
+ )
+ srv_17 = OpCodeEntry()
+ srv_17.add("0", "Ping Test")
+ def_wrapper.add_service(
+ name=CoreServiceList.SERVICE_17_ALT,
+ info="PUS Service 17 Test",
+ op_code_entry=srv_17,
+ )
call_all_definitions_providers(def_wrapper)
return def_wrapper
diff --git a/pus_tc/devs/__init__.py b/pus_tc/devs/__init__.py
index e69de29..bc05547 100644
--- a/pus_tc/devs/__init__.py
+++ b/pus_tc/devs/__init__.py
@@ -0,0 +1 @@
+from . import power
diff --git a/pus_tc/devs/common_power.py b/pus_tc/devs/common_power.py
index b5f0376..0e5741e 100644
--- a/pus_tc/devs/common_power.py
+++ b/pus_tc/devs/common_power.py
@@ -274,25 +274,6 @@ def pdu2_req_hk_cmds(q: DefaultPusQueueHelper, op_code: str):
q.add_pus_tc(generate_one_hk_command(sid=hk_sid))
-def pack_power_commands(q: DefaultPusQueueHelper, op_code: str):
- pdu1_cmds(q, op_code)
- pdu2_cmds(q, op_code)
- if op_code in PowerOpCodes.INFO_CORE:
- pdu1_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
- pdu2_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
- q.add_wait_seconds(3.0)
- elif op_code in PowerOpCodes.INFO_AUX:
- pdu1_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
- pdu2_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
- q.add_wait_seconds(3.0)
- elif op_code in PowerOpCodes.INFO_ALL:
- pdu1_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
- pdu2_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
- pdu1_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
- pdu2_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
- q.add_wait_seconds(3.0)
-
-
def tcs_on_cmd(q: DefaultPusQueueHelper):
generic_on_cmd(PDU_1_HANDLER_ID, q, Pdu1InfoBase.TCS, Pdu1ChIndex.TCS)
diff --git a/pus_tc/devs/power.py b/pus_tc/devs/power.py
index dc3f885..0b8de91 100644
--- a/pus_tc/devs/power.py
+++ b/pus_tc/devs/power.py
@@ -1,18 +1,46 @@
from gomspace.gomspace_common import GsInfo
from pus_tc.devs.common_power import (
PowerOpCodes,
- Pdu1InfoBase,
- Pdu2InfoBase,
add_pdu1_common_defs,
add_pdu2_common_defs,
PowerInfo,
+ pdu1_cmds,
+ pdu2_cmds,
+ pdu1_req_hk_cmds,
+ pdu2_req_hk_cmds,
)
from config.definitions import CustomServiceList
+from tmtccmd import get_console_logger
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
from pus_tc.devs.p60dock import P60OpCodes, GomspaceOpCodes, P60Info
from pus_tc.devs.acu import add_acu_cmds
from tmtccmd.config.tmtc import tmtc_definitions_provider
+from tmtccmd.tc import DefaultPusQueueHelper
+
+
+LOGGER = get_console_logger()
+
+
+def pack_power_commands(q: DefaultPusQueueHelper, op_code: str):
+ pdu1_cmds(q, op_code)
+ pdu2_cmds(q, op_code)
+ if op_code in PowerOpCodes.INFO_CORE:
+ pdu1_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
+ pdu2_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
+ q.add_wait_seconds(3.0)
+ elif op_code in PowerOpCodes.INFO_AUX:
+ pdu1_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
+ pdu2_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
+ q.add_wait_seconds(3.0)
+ elif op_code in PowerOpCodes.INFO_ALL:
+ pdu1_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
+ pdu2_req_hk_cmds(q, GomspaceOpCodes.REQUEST_CORE_HK_ONCE[0])
+ pdu1_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
+ pdu2_req_hk_cmds(q, GomspaceOpCodes.REQUEST_AUX_HK_ONCE[0])
+ q.add_wait_seconds(3.0)
+ if q.empty():
+ LOGGER.info(f"Queue is empty, no stack for op code {op_code}")
@tmtc_definitions_provider
diff --git a/pus_tc/procedure_packer.py b/pus_tc/procedure_packer.py
index aa0b687..9924a55 100644
--- a/pus_tc/procedure_packer.py
+++ b/pus_tc/procedure_packer.py
@@ -2,7 +2,7 @@
"""
from typing import cast
-from pus_tc.devs.common_power import pack_power_commands
+from pus_tc.devs.power import pack_power_commands
from pus_tc.devs.rtd import pack_rtd_commands
from pus_tc.devs.scex import pack_scex_cmds
from pus_tc.system.controllers import (
@@ -85,7 +85,10 @@ def handle_default_procedure(
obj_id_man = get_object_ids()
if service == CoreServiceList.SERVICE_5.value:
return pack_generic_service_5_test_into(q=queue_helper)
- if service == CoreServiceList.SERVICE_17.value:
+ if (
+ service == CoreServiceList.SERVICE_17
+ or service == CoreServiceList.SERVICE_17_ALT
+ ):
return queue_helper.add_pus_tc(pack_service_17_ping_command())
if service == CoreServiceList.SERVICE_200.value:
return pack_service_200_test_into(q=queue_helper)
@@ -188,8 +191,9 @@ def handle_default_procedure(
object_id=PDEC_HANDLER_ID, q=queue_helper, op_code=op_code
)
if service == CustomServiceList.SYRLINKS.value:
+ object_id = cast(ObjectIdU32, obj_id_man.get(SYRLINKS_HANDLER_ID))
return pack_syrlinks_command(
- object_id=SYRLINKS_HANDLER_ID, q=queue_helper, op_code=op_code
+ object_id=object_id, q=queue_helper, op_code=op_code
)
if service == CustomServiceList.SA_DEPLYOMENT.value:
return pack_solar_array_deployment_test_into(
diff --git a/tmtc/acs_ctrl.py b/tmtc/acs_ctrl.py
index d8f3200..c9c6aa2 100644
--- a/tmtc/acs_ctrl.py
+++ b/tmtc/acs_ctrl.py
@@ -41,7 +41,7 @@ class Info:
DISABLE_MGM_HK = "Disable MGM HK data generation"
-PERFORM_MGM_CALIBRATION = True
+PERFORM_MGM_CALIBRATION = False
CALIBRATION_SOCKET_HOST = "localhost"
CALIBRATION_SOCKET_PORT = 6677
CALIBRATION_ADDR = (CALIBRATION_SOCKET_HOST, CALIBRATION_SOCKET_PORT)
@@ -153,7 +153,9 @@ def perform_mgm_calibration(pw: PrintWrapper, mgm_tuple: Tuple):
CALIBR_SOCKET.sendall(f"{declare_api_cmd}\n".encode())
reply = CALIBR_SOCKET.recv(1024)
if len(reply) != 2:
- pw.dlog(f"MGM calibration: Reply received command {declare_api_cmd} has invalid length {len(reply)}")
+ pw.dlog(
+ f"MGM calibration: Reply received command {declare_api_cmd} has invalid length {len(reply)}"
+ )
return
else:
if str(reply[0]) == "0":
@@ -168,7 +170,9 @@ def perform_mgm_calibration(pw: PrintWrapper, mgm_tuple: Tuple):
CALIBR_SOCKET.sendall(command)
reply = CALIBR_SOCKET.recv(1024)
if len(reply) != 2:
- pw.dlog(f"MGM calibration: Reply received command magnetometer_field has invalid length {len(reply)}")
+ pw.dlog(
+ f"MGM calibration: Reply received command magnetometer_field has invalid length {len(reply)}"
+ )
return
else:
if str(reply[0]) == "0":