RW CMDs #61

Merged
muellerr merged 21 commits from mueller/rw-cmds into develop 2022-05-11 17:59:50 +02:00
2 changed files with 15 additions and 12 deletions
Showing only changes of commit bc02c9d607 - Show all commits

View File

@ -7,7 +7,7 @@ from typing import Union
from spacepackets.ecss import PusTelecommand from spacepackets.ecss import PusTelecommand
from tmtccmd.com_if.com_interface_base import CommunicationInterface from tmtccmd.com_if.com_interface_base import CommunicationInterface
from tmtccmd.config.definitions import CoreServiceList from tmtccmd.config.definitions import CoreServiceList, QueueCommands
from tmtccmd.logging import get_console_logger from tmtccmd.logging import get_console_logger
from tmtccmd.logging.pus import log_raw_pus_tc from tmtccmd.logging.pus import log_raw_pus_tc
from tmtccmd.tc.definitions import TcQueueT from tmtccmd.tc.definitions import TcQueueT
@ -76,19 +76,22 @@ LOGGER = get_console_logger()
def pre_tc_send_cb( def pre_tc_send_cb(
packet: bytes, queue_entry: Union[bytes, QueueCommands],
com_if: CommunicationInterface, com_if: CommunicationInterface,
pus_info: Union[PusTelecommand, any], queue_info: Union[PusTelecommand, any],
file_logger: logging.Logger, file_logger: logging.Logger,
): ):
log_raw_pus_tc( if isinstance(queue_entry, bytes) or isinstance(queue_entry, bytearray):
packet=packet, srv_subservice=(pus_info.service, pus_info.subservice) log_raw_pus_tc(
) packet=queue_entry, srv_subservice=(queue_info.service, queue_info.subservice)
tc_info_string = f"Sent {pus_info}" )
LOGGER.info(tc_info_string) tc_info_string = f"Sent {queue_info}"
file_logger.info(f"{get_current_time_string(True)}: {tc_info_string}") LOGGER.info(tc_info_string)
com_if.send(data=packet) file_logger.info(f"{get_current_time_string(True)}: {tc_info_string}")
com_if.send(data=queue_entry)
elif isinstance(queue_entry, QueueCommands):
if queue_entry == QueueCommands.PRINT:
file_logger.info(queue_info)
def pack_service_queue_user( def pack_service_queue_user(
service: Union[str, int], op_code: str, service_queue: TcQueueT service: Union[str, int], op_code: str, service_queue: TcQueueT

@ -1 +1 @@
Subproject commit 11960d5b35db30c25c1306cab663224fbb1deb86 Subproject commit d503c8b8a95d107f482880a8ba692fdd8d46adbc