Merge branch 'introduce_tm_db' into bump-tmtccmd
All checks were successful
EIVE/-/pipeline/pr-main This commit looks good
All checks were successful
EIVE/-/pipeline/pr-main This commit looks good
This commit is contained in:
43
tmtcc.py
43
tmtcc.py
@ -15,7 +15,6 @@ from spacepackets.ecss import PusVerificator
|
||||
from spacepackets.version import get_version as get_sp_version
|
||||
from tmtccmd import BackendBase
|
||||
from tmtccmd.cfdp.handler import RemoteEntityCfgTable
|
||||
from eive_tmtc.cfdp.handler import CfdpInCcsdsHandler
|
||||
from tmtccmd.cfdp.mib import (
|
||||
IndicationCfg,
|
||||
LocalEntityCfg,
|
||||
@ -41,11 +40,13 @@ from tmtccmd.logging.pus import (
|
||||
TimedLogWhen,
|
||||
)
|
||||
from tmtccmd.pus import VerificationWrapper
|
||||
from tmtccmd.tmtc import CcsdsTmHandler, GenericApidHandlerBase, SpecificApidHandlerBase
|
||||
from tmtccmd.tmtc import CcsdsTmHandler
|
||||
from tmtccmd.util import FileSeqCountProvider, PusFileSeqCountProvider
|
||||
|
||||
from eive_tmtc import APP_LOGGER
|
||||
from eive_tmtc.pus_tm.pus_handler import PusHandler, UnknownApidHandler
|
||||
from eive_tmtc.cfdp.fault_handler import EiveCfdpFaultHandler
|
||||
from eive_tmtc.cfdp.handler import CfdpInCcsdsHandler
|
||||
from eive_tmtc.cfdp.tm import CfdpInCcsdsWrapper
|
||||
from eive_tmtc.cfdp.user import EiveCfdpUser, EiveCheckTimerProvider
|
||||
from eive_tmtc.config.definitions import (
|
||||
@ -56,8 +57,6 @@ from eive_tmtc.config.definitions import (
|
||||
)
|
||||
from eive_tmtc.config.hook import EiveHookObject
|
||||
from eive_tmtc.pus_tc.tc_handler import TcHandler
|
||||
from eive_tmtc.pus_tm.hk_handler import HkFilter
|
||||
from eive_tmtc.pus_tm.pus_demux import pus_factory_hook
|
||||
|
||||
_LOGGER = APP_LOGGER
|
||||
_LOG_LEVEL = logging.INFO
|
||||
@ -67,42 +66,6 @@ ROTATING_TIMED_LOGGER_INTERVAL_WHEN = TimedLogWhen.PER_MINUTE
|
||||
ROTATING_TIMED_LOGGER_INTERVAL = 30
|
||||
|
||||
|
||||
class PusHandler(SpecificApidHandlerBase):
|
||||
def __init__(
|
||||
self,
|
||||
wrapper: VerificationWrapper,
|
||||
printer: FsfwTmTcPrinter,
|
||||
raw_logger: RawTmtcTimedLogWrapper,
|
||||
hk_level: int,
|
||||
):
|
||||
super().__init__(PUS_APID, None)
|
||||
self.printer = printer
|
||||
self.verif_wrapper = wrapper
|
||||
self.raw_logger = raw_logger
|
||||
self.hk_level = hk_level
|
||||
self.these_objs_hk_only = []
|
||||
self.hk_filter = HkFilter(object_ids=self.these_objs_hk_only, set_ids=[])
|
||||
|
||||
def handle_tm(self, packet: bytes, _user_args: any):
|
||||
# with open("tc.bin", "wb") as of:
|
||||
# of.write(packet)
|
||||
pus_factory_hook(
|
||||
packet,
|
||||
self.verif_wrapper,
|
||||
self.printer,
|
||||
self.raw_logger,
|
||||
self.hk_level,
|
||||
self.hk_filter,
|
||||
)
|
||||
|
||||
|
||||
class UnknownApidHandler(GenericApidHandlerBase):
|
||||
def handle_tm(self, apid: int, packet: bytes, _user_args: any):
|
||||
_LOGGER.warning(
|
||||
f"Packet with unknown APID {apid} detected: {packet.hex(sep=',')}"
|
||||
)
|
||||
|
||||
|
||||
class CustomCcsdsTmHandler(CcsdsTmHandler):
|
||||
def user_hook(self, apid: int, packet: bytes):
|
||||
_LOGGER.debug(f"Received packet {packet.hex(sep=',')} with APID {apid}")
|
||||
|
Reference in New Issue
Block a user