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