From ead4c91769034dbd6e4682edf4d93663e77abce0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 16 Jan 2023 17:45:46 +0100 Subject: [PATCH] bump tmtccmd again --- eive_tmtc/pus_tm/action_reply_handler.py | 5 ++++- eive_tmtc/pus_tm/event_handler.py | 3 ++- eive_tmtc/pus_tm/factory_hook.py | 15 +++++++++++---- eive_tmtc/pus_tm/verification_handler.py | 5 ++++- setup.cfg | 2 +- 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/eive_tmtc/pus_tm/action_reply_handler.py b/eive_tmtc/pus_tm/action_reply_handler.py index 065bb4e..67892e3 100644 --- a/eive_tmtc/pus_tm/action_reply_handler.py +++ b/eive_tmtc/pus_tm/action_reply_handler.py @@ -9,6 +9,7 @@ from eive_tmtc.tmtc.power.tm import handle_get_param_data_reply from tmtccmd.logging import get_console_logger from tmtccmd.tm import Service8FsfwTm from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter +from spacepackets.ccsds.time import CdsShortTimestamp LOGGER = get_console_logger() @@ -19,7 +20,9 @@ def handle_action_reply( """Core Action reply handler :return: """ - tm_packet = Service8FsfwTm.unpack(raw_telemetry=raw_tm) + tm_packet = Service8FsfwTm.unpack( + raw_telemetry=raw_tm, time_reader=CdsShortTimestamp.empty() + ) printer.handle_long_tm_print(packet_if=tm_packet, info_if=tm_packet) object_id = obj_id_dict.get(tm_packet.source_object_id_as_bytes) pw = PrintWrapper(printer) diff --git a/eive_tmtc/pus_tm/event_handler.py b/eive_tmtc/pus_tm/event_handler.py index b60cfae..ba2baab 100644 --- a/eive_tmtc/pus_tm/event_handler.py +++ b/eive_tmtc/pus_tm/event_handler.py @@ -11,13 +11,14 @@ from tmtccmd.tm import Service5Tm from tmtccmd.logging import get_console_logger from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter from tmtccmd.fsfw import EventInfo +from spacepackets.ccsds.time import CdsShortTimestamp LOGGER = get_console_logger() def handle_event_packet(raw_tm: bytes, printer: FsfwTmTcPrinter): pw = PrintWrapper(printer) - tm = Service5Tm.unpack(raw_telemetry=raw_tm) + tm = Service5Tm.unpack(raw_telemetry=raw_tm, time_reader=CdsShortTimestamp.empty()) event_dict = get_event_dict() info = event_dict.get(tm.event_id) if info is None: diff --git a/eive_tmtc/pus_tm/factory_hook.py b/eive_tmtc/pus_tm/factory_hook.py index 36b9428..36887f3 100644 --- a/eive_tmtc/pus_tm/factory_hook.py +++ b/eive_tmtc/pus_tm/factory_hook.py @@ -4,6 +4,7 @@ from eive_tmtc.config.object_ids import get_object_ids from spacepackets.ecss import PusTelemetry from spacepackets.ecss.pus_17_test import Service17Tm from spacepackets.util import PrintFormats +from spacepackets.ccsds.time import CdsShortTimestamp from tmtccmd import get_console_logger from tmtccmd.logging.pus import RawTmtcTimedLogWrapper from tmtccmd.pus import VerificationWrapper @@ -30,7 +31,7 @@ def pus_factory_hook( LOGGER.warning("Detected packet shorter than 8 bytes!") return try: - tm_packet = PusTelemetry.unpack(packet) + tm_packet = PusTelemetry.unpack(packet, CdsShortTimestamp.empty()) except ValueError: LOGGER.warning("Could not generate PUS TM object from raw data") LOGGER.warning(f"Raw Packet: [{packet.hex(sep=',')}], REPR: {packet!r}") @@ -48,15 +49,21 @@ def pus_factory_hook( elif service == 8: handle_action_reply(raw_tm=packet, printer=printer, obj_id_dict=obj_id_dict) elif service == 17: - tm_packet = Service17Tm.unpack(raw_telemetry=packet) + tm_packet = Service17Tm.unpack( + raw_telemetry=packet, time_reader=CdsShortTimestamp.empty() + ) if tm_packet.subservice == 2: verif_wrapper.dlog("Received Ping Reply TM[17,2]") dedicated_handler = True elif service == 20: - tm_packet = Service20FsfwTm.unpack(raw_telemetry=packet) + tm_packet = Service20FsfwTm.unpack( + raw_telemetry=packet, time_reader=CdsShortTimestamp.empty() + ) dedicated_handler = False elif service == 200: - tm_packet = Service200FsfwTm.unpack(raw_telemetry=packet) + tm_packet = Service200FsfwTm.unpack( + raw_telemetry=packet, time_reader=CdsShortTimestamp.empty() + ) if tm_packet.subservice == ModeSubservices.TM_CANT_REACH_MODE: obj_id = tm_packet.object_id obj_id_obj = obj_id_dict.get(obj_id) diff --git a/eive_tmtc/pus_tm/verification_handler.py b/eive_tmtc/pus_tm/verification_handler.py index 2cd5b24..c289679 100644 --- a/eive_tmtc/pus_tm/verification_handler.py +++ b/eive_tmtc/pus_tm/verification_handler.py @@ -1,5 +1,6 @@ from typing import List, Optional +from spacepackets.ccsds import CdsShortTimestamp from spacepackets.ecss.pus_1_verification import UnpackParams, Service1Tm from tmtccmd.logging import get_console_logger from tmtccmd.pus import VerificationWrapper @@ -15,7 +16,9 @@ def handle_service_1_fsfw_packet(wrapper: VerificationWrapper, raw_tm: bytes): "Console logger or file logger not valid. Please set a valid one" ) # Error code with length 2 is FSFW specific - tm_packet = Service1Tm.unpack(data=raw_tm, params=UnpackParams(1, 2)) + tm_packet = Service1Tm.unpack( + data=raw_tm, params=UnpackParams(CdsShortTimestamp.empty(), 1, 2) + ) fsfw_wrapper = Service1FsfwWrapper(tm_packet) res = wrapper.verificator.add_tm(tm_packet) if res is None: diff --git a/setup.cfg b/setup.cfg index 384338c..28df461 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,7 +28,7 @@ classifiers = [options] install_requires = # tmtccmd @ git+https://github.com/robamu-org/tmtccmd@v4.0.0a1 - tmtccmd @ git+https://github.com/robamu-org/tmtccmd@aea3c7d05fe88fdf683ea9a192fef02b871afcb0#egg=tmtccmd + tmtccmd @ git+https://github.com/robamu-org/tmtccmd@0f5544e0fd514#egg=tmtccmd packages = find: python_requires = >=3.10 include_package_data = True