From c19d49d331ffef2cff0d91dbd2d7de94468ae798 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 20 Nov 2022 18:07:38 +0100 Subject: [PATCH 1/9] add first version of tmtccmd client --- fsrc-example/pyclient/.gitignore | 1 + fsrc-example/pyclient/main.py | 274 +++++++++++++++++++++++++ fsrc-example/pyclient/requirements.txt | 1 + 3 files changed, 276 insertions(+) create mode 100644 fsrc-example/pyclient/.gitignore create mode 100755 fsrc-example/pyclient/main.py create mode 100644 fsrc-example/pyclient/requirements.txt diff --git a/fsrc-example/pyclient/.gitignore b/fsrc-example/pyclient/.gitignore new file mode 100644 index 0000000..f9606a3 --- /dev/null +++ b/fsrc-example/pyclient/.gitignore @@ -0,0 +1 @@ +/venv diff --git a/fsrc-example/pyclient/main.py b/fsrc-example/pyclient/main.py new file mode 100755 index 0000000..c059a86 --- /dev/null +++ b/fsrc-example/pyclient/main.py @@ -0,0 +1,274 @@ +#!/usr/bin/env python3 +"""Example client for the sat-rs example application""" +import sys +import time +from typing import Optional + +import tmtccmd +from spacepackets.ecss import PusTelemetry, PusTelecommand, PusVerificator +from spacepackets.ecss.pus_17_test import Service17Tm +from spacepackets.ecss.pus_1_verification import UnpackParams, Service1Tm +from spacepackets.util import UnsignedByteField + +from tmtccmd import CcsdsTmtcBackend, TcHandlerBase, ProcedureParamsWrapper +from tmtccmd.core.base import BackendRequest +from tmtccmd.pus import VerificationWrapper +from tmtccmd.tm import CcsdsTmHandler, SpecificApidHandlerBase +from tmtccmd.com_if import ComInterface +from tmtccmd.config import ( + default_json_path, + SetupParams, + TmTcCfgHookBase, + TmtcDefinitionWrapper, + CoreServiceList, + OpCodeEntry, + params_to_procedure_conversion, +) +from tmtccmd.config import PreArgsParsingWrapper, SetupWrapper +from tmtccmd.logging import get_console_logger +from tmtccmd.logging.pus import ( + RegularTmtcLogWrapper, + RawTmtcTimedLogWrapper, + TimedLogWhen, +) +from tmtccmd.tc import ( + TcQueueEntryType, + ProcedureWrapper, + TcProcedureType, + FeedWrapper, + SendCbParams, + DefaultPusQueueHelper, +) +from tmtccmd.tm.pus_5_event import Service5Tm +from tmtccmd.util import FileSeqCountProvider, PusFileSeqCountProvider +from tmtccmd.util.obj_id import ObjectIdDictT + +from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter + +LOGGER = get_console_logger() + +EXAMPLE_PUS_APID = 0xEF + + +class SatRsConfigHook(TmTcCfgHookBase): + def __init__(self, json_cfg_path: str): + super().__init__(json_cfg_path=json_cfg_path) + + def assign_communication_interface(self, com_if_key: str) -> Optional[ComInterface]: + print("Communication interface assignment function was called") + from tmtccmd.config.com_if import ( + create_com_interface_default, + create_com_interface_cfg_default, + ) + + cfg = create_com_interface_cfg_default( + com_if_key=com_if_key, + json_cfg_path=self.cfg_path, + space_packet_ids=None, + ) + return create_com_interface_default(cfg) + + def get_tmtc_definitions(self) -> TmtcDefinitionWrapper: + from tmtccmd.config.globals import get_default_tmtc_defs + + defs = get_default_tmtc_defs() + srv_5 = OpCodeEntry() + srv_5.add("0", "Event Test") + defs.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") + defs.add_service( + name=CoreServiceList.SERVICE_17_ALT, + info="PUS Service 17 Test", + op_code_entry=srv_17, + ) + return defs + + def perform_mode_operation(self, tmtc_backend: CcsdsTmtcBackend, mode: int): + LOGGER.info("Mode operation hook was called") + pass + + def get_object_ids(self) -> ObjectIdDictT: + from tmtccmd.config.objects import get_core_object_ids + + return get_core_object_ids() + + +class PusHandler(SpecificApidHandlerBase): + def __init__( + self, + verif_wrapper: VerificationWrapper, + printer: FsfwTmTcPrinter, + raw_logger: RawTmtcTimedLogWrapper, + ): + super().__init__(EXAMPLE_PUS_APID, None) + self.printer = printer + self.raw_logger = raw_logger + self.verif_wrapper = verif_wrapper + + def handle_tm(self, packet: bytes, _user_args: any): + try: + tm_packet = PusTelemetry.unpack(packet) + except ValueError: + LOGGER.warning("Could not generate PUS TM object from raw data") + LOGGER.warning(f"Raw Packet: [{packet.hex(sep=',')}], REPR: {packet!r}") + return + service = tm_packet.service + dedicated_handler = False + if service == 1: + tm_packet = Service1Tm.unpack(data=packet, params=UnpackParams(1, 2)) + res = self.verif_wrapper.add_tm(tm_packet) + if res is None: + LOGGER.info( + f"Received Verification TM[{tm_packet.service}, {tm_packet.subservice}] " + f"with Request ID {tm_packet.tc_req_id.as_u32():#08x}" + ) + LOGGER.warning( + f"No matching telecommand found for {tm_packet.tc_req_id}" + ) + else: + self.verif_wrapper.log_to_console(tm_packet, res) + self.verif_wrapper.log_to_file(tm_packet, res) + dedicated_handler = True + if service == 5: + tm_packet = Service5Tm.unpack(packet) + if service == 17: + tm_packet = Service17Tm.unpack(packet) + dedicated_handler = True + if tm_packet.subservice == 2: + self.printer.file_logger.info("Received Ping Reply TM[17,2]") + LOGGER.info("Received Ping Reply TM[17,2]") + else: + self.printer.file_logger.info( + f"Received Test Packet with unknown subservice {tm_packet.subservice}" + ) + LOGGER.info( + f"Received Test Packet with unknown subservice {tm_packet.subservice}" + ) + if tm_packet is None: + LOGGER.info( + f"The service {service} is not implemented in Telemetry Factory" + ) + tm_packet = PusTelemetry.unpack(packet) + self.raw_logger.log_tm(tm_packet) + if not dedicated_handler and tm_packet is not None: + self.printer.handle_long_tm_print(packet_if=tm_packet, info_if=tm_packet) + + +class TcHandler(TcHandlerBase): + def __init__( + self, + seq_count_provider: FileSeqCountProvider, + verif_wrapper: VerificationWrapper, + ): + super(TcHandler, self).__init__() + self.seq_count_provider = seq_count_provider + self.verif_wrapper = verif_wrapper + self.queue_helper = DefaultPusQueueHelper( + queue_wrapper=None, + seq_cnt_provider=seq_count_provider, + ) + + def send_cb(self, send_params: SendCbParams): + entry_helper = send_params.entry + if entry_helper.is_tc: + if entry_helper.entry_type == TcQueueEntryType.PUS_TC: + pus_tc_wrapper = entry_helper.to_pus_tc_entry() + pus_tc_wrapper.pus_tc.seq_count = ( + self.seq_count_provider.get_and_increment() + ) + self.verif_wrapper.add_tc(pus_tc_wrapper.pus_tc) + raw_tc = pus_tc_wrapper.pus_tc.pack() + LOGGER.info(f"Sending {pus_tc_wrapper.pus_tc}") + send_params.com_if.send(raw_tc) + elif entry_helper.entry_type == TcQueueEntryType.LOG: + log_entry = entry_helper.to_log_entry() + LOGGER.info(log_entry.log_str) + + def queue_finished_cb(self, helper: ProcedureWrapper): + if helper.proc_type == TcProcedureType.DEFAULT: + def_proc = helper.to_def_procedure() + LOGGER.info( + f"Queue handling finished for service {def_proc.service} and " + f"op code {def_proc.op_code}" + ) + + def feed_cb(self, helper: ProcedureWrapper, wrapper: FeedWrapper): + self.queue_helper.queue_wrapper = wrapper.queue_wrapper + if helper.proc_type == TcProcedureType.DEFAULT: + def_proc = helper.to_def_procedure() + service = def_proc.service + if ( + service == CoreServiceList.SERVICE_17 + or service == CoreServiceList.SERVICE_17_ALT + ): + return self.queue_helper.add_pus_tc( + PusTelecommand(service=17, subservice=1) + ) + + +def main(): + tmtccmd.init_printout(False) + hook_obj = SatRsConfigHook(json_cfg_path=default_json_path()) + parser_wrapper = PreArgsParsingWrapper() + parser_wrapper.create_default_parent_parser() + parser_wrapper.create_default_parser() + parser_wrapper.add_def_proc_args() + post_args_wrapper = parser_wrapper.parse(hook_obj) + params = SetupParams() + proc_wrapper = ProcedureParamsWrapper() + if post_args_wrapper.use_gui: + post_args_wrapper.set_params_without_prompts(params, proc_wrapper) + else: + post_args_wrapper.set_params_with_prompts(params, proc_wrapper) + params.apid = EXAMPLE_PUS_APID + setup_args = SetupWrapper( + hook_obj=hook_obj, setup_params=params, proc_param_wrapper=proc_wrapper + ) + # Create console logger helper and file loggers + tmtc_logger = RegularTmtcLogWrapper() + printer = FsfwTmTcPrinter(tmtc_logger.logger) + raw_logger = RawTmtcTimedLogWrapper(when=TimedLogWhen.PER_HOUR, interval=1) + verificator = PusVerificator() + verification_wrapper = VerificationWrapper(verificator, LOGGER, printer.file_logger) + # Create primary TM handler and add it to the CCSDS Packet Handler + tm_handler = PusHandler(verification_wrapper, printer, raw_logger) + ccsds_handler = CcsdsTmHandler(generic_handler=None) + ccsds_handler.add_apid_handler(tm_handler) + + # Create TC handler + seq_count_provider = PusFileSeqCountProvider() + tc_handler = TcHandler(seq_count_provider, verification_wrapper) + tmtccmd.setup(setup_args=setup_args) + init_proc = params_to_procedure_conversion(setup_args.proc_param_wrapper) + tmtc_backend = tmtccmd.create_default_tmtc_backend( + setup_wrapper=setup_args, + tm_handler=ccsds_handler, + tc_handler=tc_handler, + init_procedure=init_proc, + ) + tmtccmd.start(tmtc_backend=tmtc_backend, hook_obj=hook_obj) + try: + while True: + state = tmtc_backend.periodic_op(None) + if state.request == BackendRequest.TERMINATION_NO_ERROR: + sys.exit(0) + elif state.request == BackendRequest.DELAY_IDLE: + LOGGER.info("TMTC Client in IDLE mode") + time.sleep(3.0) + elif state.request == BackendRequest.DELAY_LISTENER: + time.sleep(0.8) + elif state.request == BackendRequest.DELAY_CUSTOM: + time.sleep(state.next_delay) + elif state.request == BackendRequest.CALL_NEXT: + pass + except KeyboardInterrupt: + sys.exit(0) + + +if __name__ == "__main__": + main() diff --git a/fsrc-example/pyclient/requirements.txt b/fsrc-example/pyclient/requirements.txt new file mode 100644 index 0000000..9bd57cd --- /dev/null +++ b/fsrc-example/pyclient/requirements.txt @@ -0,0 +1 @@ +tmtccmd == 3.0.0rc2 -- 2.43.0 From db6fb0ab5cb6b4918fde9f61fe2a215b030a8093 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 20 Nov 2022 18:45:11 +0100 Subject: [PATCH 2/9] add tmtccmd client program --- fsrc-example/pyclient/.gitignore | 3 +++ fsrc-example/pyclient/main.py | 11 +++++++---- fsrc-example/pyclient/seqcnt.txt | 1 + fsrc-example/pyclient/tmtc_conf.json | 6 ++++++ fsrc-example/src/bin/obsw/ccsds.rs | 4 ++-- fsrc-example/src/bin/obsw/main.rs | 4 ++++ spacepackets | 2 +- 7 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 fsrc-example/pyclient/seqcnt.txt create mode 100644 fsrc-example/pyclient/tmtc_conf.json diff --git a/fsrc-example/pyclient/.gitignore b/fsrc-example/pyclient/.gitignore index f9606a3..13485ba 100644 --- a/fsrc-example/pyclient/.gitignore +++ b/fsrc-example/pyclient/.gitignore @@ -1 +1,4 @@ /venv +/log +/.idea/* +!/.idea/runConfigurations diff --git a/fsrc-example/pyclient/main.py b/fsrc-example/pyclient/main.py index c059a86..431bebc 100755 --- a/fsrc-example/pyclient/main.py +++ b/fsrc-example/pyclient/main.py @@ -47,7 +47,7 @@ from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter LOGGER = get_console_logger() -EXAMPLE_PUS_APID = 0xEF +EXAMPLE_PUS_APID = 0x02 class SatRsConfigHook(TmTcCfgHookBase): @@ -113,10 +113,10 @@ class PusHandler(SpecificApidHandlerBase): def handle_tm(self, packet: bytes, _user_args: any): try: tm_packet = PusTelemetry.unpack(packet) - except ValueError: + except ValueError as e: LOGGER.warning("Could not generate PUS TM object from raw data") LOGGER.warning(f"Raw Packet: [{packet.hex(sep=',')}], REPR: {packet!r}") - return + raise e service = tm_packet.service dedicated_handler = False if service == 1: @@ -263,7 +263,10 @@ def main(): elif state.request == BackendRequest.DELAY_LISTENER: time.sleep(0.8) elif state.request == BackendRequest.DELAY_CUSTOM: - time.sleep(state.next_delay) + if state.next_delay.total_seconds() <= 0.4: + time.sleep(state.next_delay.total_seconds()) + else: + time.sleep(0.4) elif state.request == BackendRequest.CALL_NEXT: pass except KeyboardInterrupt: diff --git a/fsrc-example/pyclient/seqcnt.txt b/fsrc-example/pyclient/seqcnt.txt new file mode 100644 index 0000000..64bb6b7 --- /dev/null +++ b/fsrc-example/pyclient/seqcnt.txt @@ -0,0 +1 @@ +30 diff --git a/fsrc-example/pyclient/tmtc_conf.json b/fsrc-example/pyclient/tmtc_conf.json new file mode 100644 index 0000000..ab02100 --- /dev/null +++ b/fsrc-example/pyclient/tmtc_conf.json @@ -0,0 +1,6 @@ +{ + "com_if": "udp", + "tcpip_udp_ip_addr": "127.0.0.1", + "tcpip_udp_port": 7301, + "tcpip_udp_recv_max_size": 1500 +} \ No newline at end of file diff --git a/fsrc-example/src/bin/obsw/ccsds.rs b/fsrc-example/src/bin/obsw/ccsds.rs index b058e4d..c86be63 100644 --- a/fsrc-example/src/bin/obsw/ccsds.rs +++ b/fsrc-example/src/bin/obsw/ccsds.rs @@ -28,10 +28,10 @@ impl CcsdsPacketHandler for CcsdsReceiver { fn handle_unknown_apid( &mut self, - _sp_header: &SpHeader, + sp_header: &SpHeader, _tc_raw: &[u8], ) -> Result<(), Self::Error> { - println!("Unknown APID detected"); + println!("Unknown APID 0x{:x?} detected", sp_header.apid()); Ok(()) } } diff --git a/fsrc-example/src/bin/obsw/main.rs b/fsrc-example/src/bin/obsw/main.rs index 3794d86..298fda9 100644 --- a/fsrc-example/src/bin/obsw/main.rs +++ b/fsrc-example/src/bin/obsw/main.rs @@ -100,10 +100,13 @@ fn main() { event_sender, event_request_tx, }; + + println!("Starting TMTC task"); let jh0 = thread::spawn(move || { core_tmtc_task(core_args, tm_server_rx, addr, reporter_with_sender_0); }); + println!("Starting TM funnel task"); let jh1 = thread::spawn(move || { let tm_funnel = TmFunnel { tm_server_tx, @@ -119,6 +122,7 @@ fn main() { } }); + println!("Starting event handling task"); let jh2 = thread::spawn(move || { let mut timestamp: [u8; 7] = [0; 7]; let mut sender = EventTmSender::new(tm_store_helper, tm_funnel_tx); diff --git a/spacepackets b/spacepackets index c750f94..1ec21c1 160000 --- a/spacepackets +++ b/spacepackets @@ -1 +1 @@ -Subproject commit c750f94fba31114c5ade530ea6235acb6bb8835a +Subproject commit 1ec21c1bff69a04b9112c66bec39cb0acb3412be -- 2.43.0 From 2e249ec086277df3f3e4c4c1bf243c5fb0e58cbc Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 20 Nov 2022 19:04:08 +0100 Subject: [PATCH 3/9] rename subfolders, add more READMEs --- Cargo.toml | 4 ++-- README.md | 11 ++++++++++- {fsrc-core => satrs-core}/CHANGELOG.md | 0 {fsrc-core => satrs-core}/Cargo.toml | 0 .../images/event_man_arch.graphml | 0 {fsrc-core => satrs-core}/images/event_man_arch.png | Bin {fsrc-core => satrs-core}/src/error.rs | 0 {fsrc-core => satrs-core}/src/event_man.rs | 0 {fsrc-core => satrs-core}/src/events.rs | 0 {fsrc-core => satrs-core}/src/executable.rs | 0 {fsrc-core => satrs-core}/src/hal/host/mod.rs | 0 .../src/hal/host/udp_server.rs | 0 {fsrc-core => satrs-core}/src/hal/mod.rs | 0 {fsrc-core => satrs-core}/src/lib.rs | 0 {fsrc-core => satrs-core}/src/objects.rs | 0 {fsrc-core => satrs-core}/src/params.rs | 0 {fsrc-core => satrs-core}/src/pool.rs | 0 {fsrc-core => satrs-core}/src/pus/event.rs | 0 {fsrc-core => satrs-core}/src/pus/event_man.rs | 0 {fsrc-core => satrs-core}/src/pus/mod.rs | 0 {fsrc-core => satrs-core}/src/pus/verification.rs | 0 {fsrc-core => satrs-core}/src/tmtc/ccsds_distrib.rs | 0 {fsrc-core => satrs-core}/src/tmtc/mod.rs | 0 {fsrc-core => satrs-core}/src/tmtc/pus_distrib.rs | 0 {fsrc-core => satrs-core}/src/tmtc/tm_helper.rs | 0 {fsrc-core => satrs-core}/tests/pools.rs | 0 .../tests/pus_autogen_events.rs | 0 {fsrc-core => satrs-core}/tests/pus_events.rs | 0 {fsrc-core => satrs-core}/tests/pus_verification.rs | 0 {fsrc-example => satrs-example}/Cargo.toml | 0 satrs-example/README.md | 0 {fsrc-example => satrs-example}/pyclient/.gitignore | 0 {fsrc-example => satrs-example}/pyclient/main.py | 0 .../pyclient/requirements.txt | 0 {fsrc-example => satrs-example}/pyclient/seqcnt.txt | 0 .../pyclient/tmtc_conf.json | 0 {fsrc-example => satrs-example}/src/bin/client.rs | 0 .../src/bin/obsw/ccsds.rs | 0 .../src/bin/obsw/main.rs | 0 {fsrc-example => satrs-example}/src/bin/obsw/pus.rs | 0 .../src/bin/obsw/tmtc.rs | 0 {fsrc-example => satrs-example}/src/bin/test.rs | 0 {fsrc-example => satrs-example}/src/lib.rs | 0 43 files changed, 12 insertions(+), 3 deletions(-) rename {fsrc-core => satrs-core}/CHANGELOG.md (100%) rename {fsrc-core => satrs-core}/Cargo.toml (100%) rename {fsrc-core => satrs-core}/images/event_man_arch.graphml (100%) rename {fsrc-core => satrs-core}/images/event_man_arch.png (100%) rename {fsrc-core => satrs-core}/src/error.rs (100%) rename {fsrc-core => satrs-core}/src/event_man.rs (100%) rename {fsrc-core => satrs-core}/src/events.rs (100%) rename {fsrc-core => satrs-core}/src/executable.rs (100%) rename {fsrc-core => satrs-core}/src/hal/host/mod.rs (100%) rename {fsrc-core => satrs-core}/src/hal/host/udp_server.rs (100%) rename {fsrc-core => satrs-core}/src/hal/mod.rs (100%) rename {fsrc-core => satrs-core}/src/lib.rs (100%) rename {fsrc-core => satrs-core}/src/objects.rs (100%) rename {fsrc-core => satrs-core}/src/params.rs (100%) rename {fsrc-core => satrs-core}/src/pool.rs (100%) rename {fsrc-core => satrs-core}/src/pus/event.rs (100%) rename {fsrc-core => satrs-core}/src/pus/event_man.rs (100%) rename {fsrc-core => satrs-core}/src/pus/mod.rs (100%) rename {fsrc-core => satrs-core}/src/pus/verification.rs (100%) rename {fsrc-core => satrs-core}/src/tmtc/ccsds_distrib.rs (100%) rename {fsrc-core => satrs-core}/src/tmtc/mod.rs (100%) rename {fsrc-core => satrs-core}/src/tmtc/pus_distrib.rs (100%) rename {fsrc-core => satrs-core}/src/tmtc/tm_helper.rs (100%) rename {fsrc-core => satrs-core}/tests/pools.rs (100%) rename {fsrc-core => satrs-core}/tests/pus_autogen_events.rs (100%) rename {fsrc-core => satrs-core}/tests/pus_events.rs (100%) rename {fsrc-core => satrs-core}/tests/pus_verification.rs (100%) rename {fsrc-example => satrs-example}/Cargo.toml (100%) create mode 100644 satrs-example/README.md rename {fsrc-example => satrs-example}/pyclient/.gitignore (100%) rename {fsrc-example => satrs-example}/pyclient/main.py (100%) rename {fsrc-example => satrs-example}/pyclient/requirements.txt (100%) rename {fsrc-example => satrs-example}/pyclient/seqcnt.txt (100%) rename {fsrc-example => satrs-example}/pyclient/tmtc_conf.json (100%) rename {fsrc-example => satrs-example}/src/bin/client.rs (100%) rename {fsrc-example => satrs-example}/src/bin/obsw/ccsds.rs (100%) rename {fsrc-example => satrs-example}/src/bin/obsw/main.rs (100%) rename {fsrc-example => satrs-example}/src/bin/obsw/pus.rs (100%) rename {fsrc-example => satrs-example}/src/bin/obsw/tmtc.rs (100%) rename {fsrc-example => satrs-example}/src/bin/test.rs (100%) rename {fsrc-example => satrs-example}/src/lib.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index 66610da..4334157 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [workspace] members = [ - "fsrc-core", + "satrs-core", "spacepackets", - "fsrc-example" + "satrs-example" ] diff --git a/README.md b/README.md index ce87c7a..e27e06b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,14 @@ -Rust Flight Software Framework Launchpad +sat-rs launchpad ========= This is the prototyping repository for the initial version of a Rust Flight Software Framework. + +Currently, it contains the following major subcrates: + +1. The [`spacepackets`](https://egit.irs.uni-stuttgart.de/rust/spacepackets) crate which contains + basic ECSS and CCSDS packet protocol implementations. +2. The [`fsrc-core`](https://egit.irs.uni-stuttgart.de/rust/fsrc-launchpad/src/branch/main/fsrc-core) + crate containing the core components of sat-rs +3. The [`fscr-example`](https://egit.irs.uni-stuttgart.de/rust/fsrc-launchpad/src/branch/main/fsrc-example) + crate which shows a simple example on-board software using various sat-rs components. diff --git a/fsrc-core/CHANGELOG.md b/satrs-core/CHANGELOG.md similarity index 100% rename from fsrc-core/CHANGELOG.md rename to satrs-core/CHANGELOG.md diff --git a/fsrc-core/Cargo.toml b/satrs-core/Cargo.toml similarity index 100% rename from fsrc-core/Cargo.toml rename to satrs-core/Cargo.toml diff --git a/fsrc-core/images/event_man_arch.graphml b/satrs-core/images/event_man_arch.graphml similarity index 100% rename from fsrc-core/images/event_man_arch.graphml rename to satrs-core/images/event_man_arch.graphml diff --git a/fsrc-core/images/event_man_arch.png b/satrs-core/images/event_man_arch.png similarity index 100% rename from fsrc-core/images/event_man_arch.png rename to satrs-core/images/event_man_arch.png diff --git a/fsrc-core/src/error.rs b/satrs-core/src/error.rs similarity index 100% rename from fsrc-core/src/error.rs rename to satrs-core/src/error.rs diff --git a/fsrc-core/src/event_man.rs b/satrs-core/src/event_man.rs similarity index 100% rename from fsrc-core/src/event_man.rs rename to satrs-core/src/event_man.rs diff --git a/fsrc-core/src/events.rs b/satrs-core/src/events.rs similarity index 100% rename from fsrc-core/src/events.rs rename to satrs-core/src/events.rs diff --git a/fsrc-core/src/executable.rs b/satrs-core/src/executable.rs similarity index 100% rename from fsrc-core/src/executable.rs rename to satrs-core/src/executable.rs diff --git a/fsrc-core/src/hal/host/mod.rs b/satrs-core/src/hal/host/mod.rs similarity index 100% rename from fsrc-core/src/hal/host/mod.rs rename to satrs-core/src/hal/host/mod.rs diff --git a/fsrc-core/src/hal/host/udp_server.rs b/satrs-core/src/hal/host/udp_server.rs similarity index 100% rename from fsrc-core/src/hal/host/udp_server.rs rename to satrs-core/src/hal/host/udp_server.rs diff --git a/fsrc-core/src/hal/mod.rs b/satrs-core/src/hal/mod.rs similarity index 100% rename from fsrc-core/src/hal/mod.rs rename to satrs-core/src/hal/mod.rs diff --git a/fsrc-core/src/lib.rs b/satrs-core/src/lib.rs similarity index 100% rename from fsrc-core/src/lib.rs rename to satrs-core/src/lib.rs diff --git a/fsrc-core/src/objects.rs b/satrs-core/src/objects.rs similarity index 100% rename from fsrc-core/src/objects.rs rename to satrs-core/src/objects.rs diff --git a/fsrc-core/src/params.rs b/satrs-core/src/params.rs similarity index 100% rename from fsrc-core/src/params.rs rename to satrs-core/src/params.rs diff --git a/fsrc-core/src/pool.rs b/satrs-core/src/pool.rs similarity index 100% rename from fsrc-core/src/pool.rs rename to satrs-core/src/pool.rs diff --git a/fsrc-core/src/pus/event.rs b/satrs-core/src/pus/event.rs similarity index 100% rename from fsrc-core/src/pus/event.rs rename to satrs-core/src/pus/event.rs diff --git a/fsrc-core/src/pus/event_man.rs b/satrs-core/src/pus/event_man.rs similarity index 100% rename from fsrc-core/src/pus/event_man.rs rename to satrs-core/src/pus/event_man.rs diff --git a/fsrc-core/src/pus/mod.rs b/satrs-core/src/pus/mod.rs similarity index 100% rename from fsrc-core/src/pus/mod.rs rename to satrs-core/src/pus/mod.rs diff --git a/fsrc-core/src/pus/verification.rs b/satrs-core/src/pus/verification.rs similarity index 100% rename from fsrc-core/src/pus/verification.rs rename to satrs-core/src/pus/verification.rs diff --git a/fsrc-core/src/tmtc/ccsds_distrib.rs b/satrs-core/src/tmtc/ccsds_distrib.rs similarity index 100% rename from fsrc-core/src/tmtc/ccsds_distrib.rs rename to satrs-core/src/tmtc/ccsds_distrib.rs diff --git a/fsrc-core/src/tmtc/mod.rs b/satrs-core/src/tmtc/mod.rs similarity index 100% rename from fsrc-core/src/tmtc/mod.rs rename to satrs-core/src/tmtc/mod.rs diff --git a/fsrc-core/src/tmtc/pus_distrib.rs b/satrs-core/src/tmtc/pus_distrib.rs similarity index 100% rename from fsrc-core/src/tmtc/pus_distrib.rs rename to satrs-core/src/tmtc/pus_distrib.rs diff --git a/fsrc-core/src/tmtc/tm_helper.rs b/satrs-core/src/tmtc/tm_helper.rs similarity index 100% rename from fsrc-core/src/tmtc/tm_helper.rs rename to satrs-core/src/tmtc/tm_helper.rs diff --git a/fsrc-core/tests/pools.rs b/satrs-core/tests/pools.rs similarity index 100% rename from fsrc-core/tests/pools.rs rename to satrs-core/tests/pools.rs diff --git a/fsrc-core/tests/pus_autogen_events.rs b/satrs-core/tests/pus_autogen_events.rs similarity index 100% rename from fsrc-core/tests/pus_autogen_events.rs rename to satrs-core/tests/pus_autogen_events.rs diff --git a/fsrc-core/tests/pus_events.rs b/satrs-core/tests/pus_events.rs similarity index 100% rename from fsrc-core/tests/pus_events.rs rename to satrs-core/tests/pus_events.rs diff --git a/fsrc-core/tests/pus_verification.rs b/satrs-core/tests/pus_verification.rs similarity index 100% rename from fsrc-core/tests/pus_verification.rs rename to satrs-core/tests/pus_verification.rs diff --git a/fsrc-example/Cargo.toml b/satrs-example/Cargo.toml similarity index 100% rename from fsrc-example/Cargo.toml rename to satrs-example/Cargo.toml diff --git a/satrs-example/README.md b/satrs-example/README.md new file mode 100644 index 0000000..e69de29 diff --git a/fsrc-example/pyclient/.gitignore b/satrs-example/pyclient/.gitignore similarity index 100% rename from fsrc-example/pyclient/.gitignore rename to satrs-example/pyclient/.gitignore diff --git a/fsrc-example/pyclient/main.py b/satrs-example/pyclient/main.py similarity index 100% rename from fsrc-example/pyclient/main.py rename to satrs-example/pyclient/main.py diff --git a/fsrc-example/pyclient/requirements.txt b/satrs-example/pyclient/requirements.txt similarity index 100% rename from fsrc-example/pyclient/requirements.txt rename to satrs-example/pyclient/requirements.txt diff --git a/fsrc-example/pyclient/seqcnt.txt b/satrs-example/pyclient/seqcnt.txt similarity index 100% rename from fsrc-example/pyclient/seqcnt.txt rename to satrs-example/pyclient/seqcnt.txt diff --git a/fsrc-example/pyclient/tmtc_conf.json b/satrs-example/pyclient/tmtc_conf.json similarity index 100% rename from fsrc-example/pyclient/tmtc_conf.json rename to satrs-example/pyclient/tmtc_conf.json diff --git a/fsrc-example/src/bin/client.rs b/satrs-example/src/bin/client.rs similarity index 100% rename from fsrc-example/src/bin/client.rs rename to satrs-example/src/bin/client.rs diff --git a/fsrc-example/src/bin/obsw/ccsds.rs b/satrs-example/src/bin/obsw/ccsds.rs similarity index 100% rename from fsrc-example/src/bin/obsw/ccsds.rs rename to satrs-example/src/bin/obsw/ccsds.rs diff --git a/fsrc-example/src/bin/obsw/main.rs b/satrs-example/src/bin/obsw/main.rs similarity index 100% rename from fsrc-example/src/bin/obsw/main.rs rename to satrs-example/src/bin/obsw/main.rs diff --git a/fsrc-example/src/bin/obsw/pus.rs b/satrs-example/src/bin/obsw/pus.rs similarity index 100% rename from fsrc-example/src/bin/obsw/pus.rs rename to satrs-example/src/bin/obsw/pus.rs diff --git a/fsrc-example/src/bin/obsw/tmtc.rs b/satrs-example/src/bin/obsw/tmtc.rs similarity index 100% rename from fsrc-example/src/bin/obsw/tmtc.rs rename to satrs-example/src/bin/obsw/tmtc.rs diff --git a/fsrc-example/src/bin/test.rs b/satrs-example/src/bin/test.rs similarity index 100% rename from fsrc-example/src/bin/test.rs rename to satrs-example/src/bin/test.rs diff --git a/fsrc-example/src/lib.rs b/satrs-example/src/lib.rs similarity index 100% rename from fsrc-example/src/lib.rs rename to satrs-example/src/lib.rs -- 2.43.0 From ba537f08c6796313a5f3ab33a7af26b3e626c97b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 20 Nov 2022 19:29:50 +0100 Subject: [PATCH 4/9] somethings wrong --- satrs-core/Cargo.toml | 2 +- satrs-example/Cargo.toml | 2 +- satrs-example/README.md | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/satrs-core/Cargo.toml b/satrs-core/Cargo.toml index 1f10514..6574eee 100644 --- a/satrs-core/Cargo.toml +++ b/satrs-core/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "fsrc-core" +name = "satrs-core" version = "0.1.0" edition = "2021" diff --git a/satrs-example/Cargo.toml b/satrs-example/Cargo.toml index 1bc9f48..066913e 100644 --- a/satrs-example/Cargo.toml +++ b/satrs-example/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "fsrc-example" +name = "satrs-example" version = "0.1.0" edition = "2021" authors = ["Robin Mueller "] diff --git a/satrs-example/README.md b/satrs-example/README.md index e69de29..32ff8aa 100644 --- a/satrs-example/README.md +++ b/satrs-example/README.md @@ -0,0 +1,2 @@ +sat-rs example +====== -- 2.43.0 From 0b591773f586ec1db94908c138a57bdb1d50a7d0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 20 Nov 2022 19:38:34 +0100 Subject: [PATCH 5/9] update cargo.lock --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d036d26..36b9d6c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -205,9 +205,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" +checksum = "422f23e724af1240ec469ea1e834d87a4b59ce2efe2c6a96256b0c47e2fd86aa" dependencies = [ "cfg-if", ] -- 2.43.0 From 6385a65c4f1a01a1dfc91ff4609dca5489d63b8a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 20 Nov 2022 19:54:14 +0100 Subject: [PATCH 6/9] all name changes --- Cargo.lock | 62 +++++++++++++------------- satrs-core/src/events.rs | 2 +- satrs-core/src/hal/host/udp_server.rs | 4 +- satrs-core/src/objects.rs | 2 +- satrs-core/src/params.rs | 2 +- satrs-core/src/pool.rs | 2 +- satrs-core/src/pus/verification.rs | 4 +- satrs-core/src/tmtc/ccsds_distrib.rs | 4 +- satrs-core/src/tmtc/pus_distrib.rs | 4 +- satrs-core/tests/pools.rs | 2 +- satrs-core/tests/pus_autogen_events.rs | 2 +- satrs-core/tests/pus_events.rs | 12 ++--- satrs-core/tests/pus_verification.rs | 4 +- satrs-example/Cargo.toml | 4 +- satrs-example/src/bin/client.rs | 4 +- satrs-example/src/bin/obsw/ccsds.rs | 2 +- satrs-example/src/bin/obsw/main.rs | 18 ++++---- satrs-example/src/bin/obsw/pus.rs | 14 +++--- satrs-example/src/bin/obsw/tmtc.rs | 14 +++--- 19 files changed, 81 insertions(+), 81 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 36b9d6c..ea90067 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -306,37 +306,6 @@ dependencies = [ "void", ] -[[package]] -name = "fsrc-core" -version = "0.1.0" -dependencies = [ - "bus", - "crossbeam-channel", - "delegate 0.8.0", - "downcast-rs", - "embed-doc-image", - "hashbrown", - "heapless", - "num-traits", - "once_cell", - "paste", - "postcard", - "serde", - "spacepackets", - "zerocopy", -] - -[[package]] -name = "fsrc-example" -version = "0.1.0" -dependencies = [ - "crossbeam-channel", - "delegate 0.8.0", - "fsrc-core", - "spacepackets", - "zerocopy", -] - [[package]] name = "hash32" version = "0.2.1" @@ -620,6 +589,37 @@ dependencies = [ "semver 1.0.14", ] +[[package]] +name = "satrs-core" +version = "0.1.0" +dependencies = [ + "bus", + "crossbeam-channel", + "delegate 0.8.0", + "downcast-rs", + "embed-doc-image", + "hashbrown", + "heapless", + "num-traits", + "once_cell", + "paste", + "postcard", + "serde", + "spacepackets", + "zerocopy", +] + +[[package]] +name = "satrs-example" +version = "0.1.0" +dependencies = [ + "crossbeam-channel", + "delegate 0.8.0", + "satrs-core", + "spacepackets", + "zerocopy", +] + [[package]] name = "scopeguard" version = "1.1.0" diff --git a/satrs-core/src/events.rs b/satrs-core/src/events.rs index eded68e..1c06945 100644 --- a/satrs-core/src/events.rs +++ b/satrs-core/src/events.rs @@ -18,7 +18,7 @@ //! # Examples //! //! ``` -//! use fsrc_core::events::{EventU16, EventU32, EventU32TypedSev, Severity, SeverityHigh, SeverityInfo}; +//! use satrs_core::events::{EventU16, EventU32, EventU32TypedSev, Severity, SeverityHigh, SeverityInfo}; //! //! const MSG_RECVD: EventU32TypedSev = EventU32TypedSev::const_new(1, 0); //! const MSG_FAILED: EventU32 = EventU32::const_new(Severity::LOW, 1, 1); diff --git a/satrs-core/src/hal/host/udp_server.rs b/satrs-core/src/hal/host/udp_server.rs index dd7ca67..4d597f9 100644 --- a/satrs-core/src/hal/host/udp_server.rs +++ b/satrs-core/src/hal/host/udp_server.rs @@ -18,8 +18,8 @@ use std::vec::Vec; /// /// ``` /// use std::net::{IpAddr, Ipv4Addr, SocketAddr, UdpSocket}; -/// use fsrc_core::hal::host::udp_server::UdpTcServer; -/// use fsrc_core::tmtc::ReceivesTc; +/// use satrs_core::hal::host::udp_server::UdpTcServer; +/// use satrs_core::tmtc::ReceivesTc; /// use spacepackets::SpHeader; /// use spacepackets::tc::PusTc; /// diff --git a/satrs-core/src/objects.rs b/satrs-core/src/objects.rs index 0654f98..266db7a 100644 --- a/satrs-core/src/objects.rs +++ b/satrs-core/src/objects.rs @@ -10,7 +10,7 @@ //! ```rust //! use std::any::Any; //! use std::error::Error; -//! use fsrc_core::objects::{ManagedSystemObject, ObjectId, ObjectManager, SystemObject}; +//! use satrs_core::objects::{ManagedSystemObject, ObjectId, ObjectManager, SystemObject}; //! //! struct ExampleSysObj { //! id: ObjectId, diff --git a/satrs-core/src/params.rs b/satrs-core/src/params.rs index 3117b65..f1b6c6a 100644 --- a/satrs-core/src/params.rs +++ b/satrs-core/src/params.rs @@ -13,7 +13,7 @@ //! ## Example for primitive type wrapper //! //! ``` -//! use fsrc_core::params::{ParamsRaw, ToBeBytes, U32Pair, WritableToBeBytes}; +//! use satrs_core::params::{ParamsRaw, ToBeBytes, U32Pair, WritableToBeBytes}; //! //! let u32_pair = U32Pair(0x1010, 25); //! assert_eq!(u32_pair.0, 0x1010); diff --git a/satrs-core/src/pool.rs b/satrs-core/src/pool.rs index 8b7c841..70d9dcd 100644 --- a/satrs-core/src/pool.rs +++ b/satrs-core/src/pool.rs @@ -13,7 +13,7 @@ //! # Example //! //! ``` -//! use fsrc_core::pool::{LocalPool, PoolCfg, PoolProvider}; +//! use satrs_core::pool::{LocalPool, PoolCfg, PoolProvider}; //! //! // 4 buckets of 4 bytes, 2 of 8 bytes and 1 of 16 bytes //! let pool_cfg = PoolCfg::new(vec![(4, 4), (2, 8), (1, 16)]); diff --git a/satrs-core/src/pus/verification.rs b/satrs-core/src/pus/verification.rs index 76cfc5c..b9b0949 100644 --- a/satrs-core/src/pus/verification.rs +++ b/satrs-core/src/pus/verification.rs @@ -15,8 +15,8 @@ //! ``` //! use std::sync::{Arc, RwLock}; //! use std::time::Duration; -//! use fsrc_core::pool::{LocalPool, PoolCfg, PoolProvider, SharedPool}; -//! use fsrc_core::pus::verification::{CrossbeamVerifSender, VerificationReporterCfg, VerificationReporterWithSender}; +//! use satrs_core::pool::{LocalPool, PoolCfg, PoolProvider, SharedPool}; +//! use satrs_core::pus::verification::{CrossbeamVerifSender, VerificationReporterCfg, VerificationReporterWithSender}; //! use spacepackets::ecss::PusPacket; //! use spacepackets::SpHeader; //! use spacepackets::tc::{PusTc, PusTcSecondaryHeader}; diff --git a/satrs-core/src/tmtc/ccsds_distrib.rs b/satrs-core/src/tmtc/ccsds_distrib.rs index e09cb6b..cb48f72 100644 --- a/satrs-core/src/tmtc/ccsds_distrib.rs +++ b/satrs-core/src/tmtc/ccsds_distrib.rs @@ -18,8 +18,8 @@ //! # Example //! //! ```rust -//! use fsrc_core::tmtc::ccsds_distrib::{CcsdsPacketHandler, CcsdsDistributor}; -//! use fsrc_core::tmtc::ReceivesTc; +//! use satrs_core::tmtc::ccsds_distrib::{CcsdsPacketHandler, CcsdsDistributor}; +//! use satrs_core::tmtc::ReceivesTc; //! use spacepackets::{CcsdsPacket, SpHeader}; //! use spacepackets::tc::PusTc; //! diff --git a/satrs-core/src/tmtc/pus_distrib.rs b/satrs-core/src/tmtc/pus_distrib.rs index 3171b4b..1a2bf1e 100644 --- a/satrs-core/src/tmtc/pus_distrib.rs +++ b/satrs-core/src/tmtc/pus_distrib.rs @@ -17,8 +17,8 @@ //! # Example //! //! ```rust -//! use fsrc_core::tmtc::pus_distrib::{PusDistributor, PusServiceProvider}; -//! use fsrc_core::tmtc::ReceivesTc; +//! use satrs_core::tmtc::pus_distrib::{PusDistributor, PusServiceProvider}; +//! use satrs_core::tmtc::ReceivesTc; //! use spacepackets::SpHeader; //! use spacepackets::tc::PusTc; //! struct ConcretePusHandler { diff --git a/satrs-core/tests/pools.rs b/satrs-core/tests/pools.rs index 3187fd9..c92570e 100644 --- a/satrs-core/tests/pools.rs +++ b/satrs-core/tests/pools.rs @@ -1,4 +1,4 @@ -use fsrc_core::pool::{LocalPool, PoolCfg, PoolGuard, PoolProvider, StoreAddr}; +use satrs_core::pool::{LocalPool, PoolCfg, PoolGuard, PoolProvider, StoreAddr}; use std::ops::DerefMut; use std::sync::mpsc; use std::sync::mpsc::{Receiver, Sender}; diff --git a/satrs-core/tests/pus_autogen_events.rs b/satrs-core/tests/pus_autogen_events.rs index 03b4006..eaec7e6 100644 --- a/satrs-core/tests/pus_autogen_events.rs +++ b/satrs-core/tests/pus_autogen_events.rs @@ -1,6 +1,6 @@ #![allow(dead_code, unused_imports)] -use fsrc_core::events::{ +use satrs_core::events::{ EventU32, EventU32TypedSev, GenericEvent, HasSeverity, LargestEventRaw, LargestGroupIdRaw, Severity, SeverityInfo, SeverityLow, SeverityMedium, }; diff --git a/satrs-core/tests/pus_events.rs b/satrs-core/tests/pus_events.rs index 37b4fa3..77dc8f2 100644 --- a/satrs-core/tests/pus_events.rs +++ b/satrs-core/tests/pus_events.rs @@ -1,11 +1,11 @@ -use fsrc_core::event_man::{ +use satrs_core::event_man::{ EventManagerWithMpscQueue, MpscEventU32Receiver, MpscEventU32SendProvider, SendEventProvider, }; -use fsrc_core::events::{EventU32, EventU32TypedSev, Severity, SeverityInfo}; -use fsrc_core::params::U32Pair; -use fsrc_core::params::{Params, ParamsHeapless, WritableToBeBytes}; -use fsrc_core::pus::event_man::{DefaultPusMgmtBackendProvider, EventReporter, PusEventDispatcher}; -use fsrc_core::pus::{EcssTmError, EcssTmSender}; +use satrs_core::events::{EventU32, EventU32TypedSev, Severity, SeverityInfo}; +use satrs_core::params::U32Pair; +use satrs_core::params::{Params, ParamsHeapless, WritableToBeBytes}; +use satrs_core::pus::event_man::{DefaultPusMgmtBackendProvider, EventReporter, PusEventDispatcher}; +use satrs_core::pus::{EcssTmError, EcssTmSender}; use spacepackets::ecss::PusPacket; use spacepackets::tm::PusTm; use std::sync::mpsc::{channel, SendError, TryRecvError}; diff --git a/satrs-core/tests/pus_verification.rs b/satrs-core/tests/pus_verification.rs index a158706..b6c36ff 100644 --- a/satrs-core/tests/pus_verification.rs +++ b/satrs-core/tests/pus_verification.rs @@ -1,5 +1,5 @@ -use fsrc_core::pool::{LocalPool, PoolCfg, PoolProvider, SharedPool}; -use fsrc_core::pus::verification::{ +use satrs_core::pool::{LocalPool, PoolCfg, PoolProvider, SharedPool}; +use satrs_core::pus::verification::{ CrossbeamVerifSender, FailParams, RequestId, VerificationReporterCfg, VerificationReporterWithSender, }; diff --git a/satrs-example/Cargo.toml b/satrs-example/Cargo.toml index 066913e..4c6eae7 100644 --- a/satrs-example/Cargo.toml +++ b/satrs-example/Cargo.toml @@ -12,5 +12,5 @@ zerocopy = "0.6" [dependencies.spacepackets] path = "../spacepackets" -[dependencies.fsrc-core] -path = "../fsrc-core" +[dependencies.satrs-core] +path = "../satrs-core" diff --git a/satrs-example/src/bin/client.rs b/satrs-example/src/bin/client.rs index 59ad725..f29a7e9 100644 --- a/satrs-example/src/bin/client.rs +++ b/satrs-example/src/bin/client.rs @@ -1,5 +1,5 @@ -use fsrc_core::pus::verification::RequestId; -use fsrc_example::{OBSW_SERVER_ADDR, SERVER_PORT}; +use satrs_core::pus::verification::RequestId; +use satrs_example::{OBSW_SERVER_ADDR, SERVER_PORT}; use spacepackets::ecss::PusPacket; use spacepackets::tc::PusTc; use spacepackets::tm::PusTm; diff --git a/satrs-example/src/bin/obsw/ccsds.rs b/satrs-example/src/bin/obsw/ccsds.rs index c86be63..cbaf5c7 100644 --- a/satrs-example/src/bin/obsw/ccsds.rs +++ b/satrs-example/src/bin/obsw/ccsds.rs @@ -1,5 +1,5 @@ use crate::tmtc::PUS_APID; -use fsrc_core::tmtc::{CcsdsPacketHandler, PusDistributor, ReceivesCcsdsTc}; +use satrs_core::tmtc::{CcsdsPacketHandler, PusDistributor, ReceivesCcsdsTc}; use spacepackets::{CcsdsPacket, SpHeader}; pub struct CcsdsReceiver { diff --git a/satrs-example/src/bin/obsw/main.rs b/satrs-example/src/bin/obsw/main.rs index 298fda9..e8ab556 100644 --- a/satrs-example/src/bin/obsw/main.rs +++ b/satrs-example/src/bin/obsw/main.rs @@ -3,22 +3,22 @@ mod pus; mod tmtc; use crate::tmtc::{core_tmtc_task, CoreTmtcArgs, TmStore, PUS_APID}; -use fsrc_core::event_man::{ +use satrs_core::event_man::{ EventManagerWithMpscQueue, MpscEventReceiver, MpscEventU32SendProvider, SendEventProvider, }; -use fsrc_core::events::EventU32; -use fsrc_core::hal::host::udp_server::UdpTcServer; -use fsrc_core::pool::{LocalPool, PoolCfg, SharedPool, StoreAddr}; -use fsrc_core::pus::event_man::{ +use satrs_core::events::EventU32; +use satrs_core::hal::host::udp_server::UdpTcServer; +use satrs_core::pool::{LocalPool, PoolCfg, SharedPool, StoreAddr}; +use satrs_core::pus::event_man::{ DefaultPusMgmtBackendProvider, EventReporter, EventRequest, EventRequestWithToken, PusEventDispatcher, }; -use fsrc_core::pus::verification::{ +use satrs_core::pus::verification::{ MpscVerifSender, VerificationReporterCfg, VerificationReporterWithSender, }; -use fsrc_core::pus::{EcssTmError, EcssTmSender}; -use fsrc_core::tmtc::CcsdsError; -use fsrc_example::{OBSW_SERVER_ADDR, SERVER_PORT}; +use satrs_core::pus::{EcssTmError, EcssTmSender}; +use satrs_core::tmtc::CcsdsError; +use satrs_example::{OBSW_SERVER_ADDR, SERVER_PORT}; use spacepackets::time::{CdsShortTimeProvider, TimeWriter}; use spacepackets::tm::PusTm; use std::net::{IpAddr, SocketAddr}; diff --git a/satrs-example/src/bin/obsw/pus.rs b/satrs-example/src/bin/obsw/pus.rs index 5caaf17..836e873 100644 --- a/satrs-example/src/bin/obsw/pus.rs +++ b/satrs-example/src/bin/obsw/pus.rs @@ -1,13 +1,13 @@ use crate::tmtc::TmStore; -use fsrc_core::events::EventU32; -use fsrc_core::pool::StoreAddr; -use fsrc_core::pus::event::Subservices; -use fsrc_core::pus::event_man::{EventRequest, EventRequestWithToken}; -use fsrc_core::pus::verification::{ +use satrs_core::events::EventU32; +use satrs_core::pool::StoreAddr; +use satrs_core::pus::event::Subservices; +use satrs_core::pus::event_man::{EventRequest, EventRequestWithToken}; +use satrs_core::pus::verification::{ FailParams, SharedStdVerifReporterWithSender, TcStateAccepted, VerificationToken, }; -use fsrc_core::tmtc::tm_helper::PusTmWithCdsShortHelper; -use fsrc_core::tmtc::PusServiceProvider; +use satrs_core::tmtc::tm_helper::PusTmWithCdsShortHelper; +use satrs_core::tmtc::PusServiceProvider; use spacepackets::ecss::{EcssEnumU16, PusPacket}; use spacepackets::tc::PusTc; use spacepackets::time::{CdsShortTimeProvider, TimeWriter}; diff --git a/satrs-example/src/bin/obsw/tmtc.rs b/satrs-example/src/bin/obsw/tmtc.rs index 7806347..9fc1d0e 100644 --- a/satrs-example/src/bin/obsw/tmtc.rs +++ b/satrs-example/src/bin/obsw/tmtc.rs @@ -1,6 +1,6 @@ -use fsrc_core::events::EventU32; -use fsrc_core::hal::host::udp_server::{ReceiveResult, UdpTcServer}; -use fsrc_core::params::Params; +use satrs_core::events::EventU32; +use satrs_core::hal::host::udp_server::{ReceiveResult, UdpTcServer}; +use satrs_core::params::Params; use std::net::SocketAddr; use std::sync::mpsc; use std::sync::mpsc::Sender; @@ -10,10 +10,10 @@ use std::time::Duration; use crate::ccsds::CcsdsReceiver; use crate::pus::PusReceiver; use crate::UdpTmtcServer; -use fsrc_core::pool::{SharedPool, StoreAddr}; -use fsrc_core::pus::event_man::EventRequestWithToken; -use fsrc_core::pus::verification::SharedStdVerifReporterWithSender; -use fsrc_core::tmtc::{CcsdsDistributor, CcsdsError, PusDistributor}; +use satrs_core::pool::{SharedPool, StoreAddr}; +use satrs_core::pus::event_man::EventRequestWithToken; +use satrs_core::pus::verification::SharedStdVerifReporterWithSender; +use satrs_core::tmtc::{CcsdsDistributor, CcsdsError, PusDistributor}; use spacepackets::tm::PusTm; pub const PUS_APID: u16 = 0x02; -- 2.43.0 From ba78db1701007b00146d6c4dab78dbb7388864f7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 20 Nov 2022 20:07:08 +0100 Subject: [PATCH 7/9] bump README again --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e27e06b..5cd44bb 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Currently, it contains the following major subcrates: 1. The [`spacepackets`](https://egit.irs.uni-stuttgart.de/rust/spacepackets) crate which contains basic ECSS and CCSDS packet protocol implementations. -2. The [`fsrc-core`](https://egit.irs.uni-stuttgart.de/rust/fsrc-launchpad/src/branch/main/fsrc-core) +2. The [`satrs-core`](https://egit.irs.uni-stuttgart.de/rust/satrs-launchpad/src/branch/main/satrs-core) crate containing the core components of sat-rs -3. The [`fscr-example`](https://egit.irs.uni-stuttgart.de/rust/fsrc-launchpad/src/branch/main/fsrc-example) +3. The [`satrs-example`](https://egit.irs.uni-stuttgart.de/rust/satrs-launchpad/src/branch/main/satrs-example) crate which shows a simple example on-board software using various sat-rs components. -- 2.43.0 From c1d81779a2a69426fc9084e89507dba35051ce65 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 20 Nov 2022 20:12:35 +0100 Subject: [PATCH 8/9] the OBSW is the primary application --- satrs-example/README.md | 3 +++ satrs-example/src/{bin/obsw => }/ccsds.rs | 0 satrs-example/src/{bin/obsw => }/main.rs | 0 satrs-example/src/{bin/obsw => }/pus.rs | 0 satrs-example/src/{bin/obsw => }/tmtc.rs | 0 5 files changed, 3 insertions(+) rename satrs-example/src/{bin/obsw => }/ccsds.rs (100%) rename satrs-example/src/{bin/obsw => }/main.rs (100%) rename satrs-example/src/{bin/obsw => }/pus.rs (100%) rename satrs-example/src/{bin/obsw => }/tmtc.rs (100%) diff --git a/satrs-example/README.md b/satrs-example/README.md index 32ff8aa..1318fc5 100644 --- a/satrs-example/README.md +++ b/satrs-example/README.md @@ -1,2 +1,5 @@ sat-rs example ====== + +# Installing the OBSW client + diff --git a/satrs-example/src/bin/obsw/ccsds.rs b/satrs-example/src/ccsds.rs similarity index 100% rename from satrs-example/src/bin/obsw/ccsds.rs rename to satrs-example/src/ccsds.rs diff --git a/satrs-example/src/bin/obsw/main.rs b/satrs-example/src/main.rs similarity index 100% rename from satrs-example/src/bin/obsw/main.rs rename to satrs-example/src/main.rs diff --git a/satrs-example/src/bin/obsw/pus.rs b/satrs-example/src/pus.rs similarity index 100% rename from satrs-example/src/bin/obsw/pus.rs rename to satrs-example/src/pus.rs diff --git a/satrs-example/src/bin/obsw/tmtc.rs b/satrs-example/src/tmtc.rs similarity index 100% rename from satrs-example/src/bin/obsw/tmtc.rs rename to satrs-example/src/tmtc.rs -- 2.43.0 From 0424db936567aac993eda5bb0bda1de8e69d8fa7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 20 Nov 2022 20:42:29 +0100 Subject: [PATCH 9/9] basic README for example --- .idea/runConfigurations/Run_obsw_example.xml | 2 +- ...example.xml => Run_obsw_simple_client.xml} | 2 +- satrs-example/Cargo.toml | 1 + satrs-example/README.md | 42 ++++++++++++++++++- satrs-example/pyclient/.gitignore | 2 + satrs-example/pyclient/seqcnt.txt | 1 - .../src/bin/{client.rs => simpleclient.rs} | 0 7 files changed, 46 insertions(+), 4 deletions(-) rename .idea/runConfigurations/{Run_obsw_client_example.xml => Run_obsw_simple_client.xml} (84%) delete mode 100644 satrs-example/pyclient/seqcnt.txt rename satrs-example/src/bin/{client.rs => simpleclient.rs} (100%) diff --git a/.idea/runConfigurations/Run_obsw_example.xml b/.idea/runConfigurations/Run_obsw_example.xml index ed323c9..df610ba 100644 --- a/.idea/runConfigurations/Run_obsw_example.xml +++ b/.idea/runConfigurations/Run_obsw_example.xml @@ -1,6 +1,6 @@ -