add tmtccmd client program

This commit is contained in:
Robin Müller 2022-11-20 18:45:11 +01:00
parent c19d49d331
commit db6fb0ab5c
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
7 changed files with 24 additions and 7 deletions

View File

@ -1 +1,4 @@
/venv
/log
/.idea/*
!/.idea/runConfigurations

View File

@ -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:

View File

@ -0,0 +1 @@
30

View File

@ -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
}

View File

@ -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(())
}
}

View File

@ -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);

@ -1 +1 @@
Subproject commit c750f94fba31114c5ade530ea6235acb6bb8835a
Subproject commit 1ec21c1bff69a04b9112c66bec39cb0acb3412be