diff --git a/fsrc-core/src/pus/event_man.rs b/fsrc-core/src/pus/event_man.rs index bbfe570..4232258 100644 --- a/fsrc-core/src/pus/event_man.rs +++ b/fsrc-core/src/pus/event_man.rs @@ -5,6 +5,7 @@ use hashbrown::HashSet; #[cfg(feature = "alloc")] pub use crate::pus::event::EventReporter; +use crate::pus::verification::{TcStateStarted, VerificationToken}; use crate::pus::{EcssTmError, EcssTmSender}; #[cfg(feature = "heapless")] #[cfg_attr(doc_cfg, doc(cfg(feature = "heapless")))] @@ -108,6 +109,18 @@ pub mod heapless_mod { } } +#[derive(Debug)] +pub enum EventRequest { + Enable(Event), + Disable(Event), +} + +#[derive(Debug)] +pub struct EventRequestWithToken { + pub request: EventRequest, + pub token: VerificationToken, +} + #[derive(Debug)] pub enum EventManError { EcssTmError(EcssTmError), diff --git a/fsrc-core/src/pus/verification.rs b/fsrc-core/src/pus/verification.rs index 5a35a12..76cfc5c 100644 --- a/fsrc-core/src/pus/verification.rs +++ b/fsrc-core/src/pus/verification.rs @@ -191,39 +191,39 @@ pub struct VerificationToken { } #[derive(Copy, Clone, Debug, Eq, PartialEq)] -pub struct StateNone; +pub struct TcStateNone; #[derive(Copy, Clone, Debug, Eq, PartialEq)] -pub struct StateAccepted; +pub struct TcStateAccepted; #[derive(Copy, Clone, Debug, Eq, PartialEq)] -pub struct StateStarted; +pub struct TcStateStarted; #[derive(Debug, Eq, PartialEq)] -pub enum StateToken { - None(StateNone), - Accepted(StateAccepted), - Started(StateStarted), +pub enum TcStateToken { + None(VerificationToken), + Accepted(VerificationToken), + Started(VerificationToken), } -impl From for StateToken { - fn from(t: StateNone) -> Self { - StateToken::None(t) +impl From> for TcStateToken { + fn from(t: VerificationToken) -> Self { + TcStateToken::None(t) } } -impl From for StateToken { - fn from(t: StateAccepted) -> Self { - StateToken::Accepted(t) +impl From> for TcStateToken { + fn from(t: VerificationToken) -> Self { + TcStateToken::Accepted(t) } } -impl From for StateToken { - fn from(t: StateStarted) -> Self { - StateToken::Started(t) +impl From> for TcStateToken { + fn from(t: VerificationToken) -> Self { + TcStateToken::Started(t) } } impl VerificationToken { - fn new(req_id: RequestId) -> VerificationToken { + fn new(req_id: RequestId) -> VerificationToken { VerificationToken { state: PhantomData, req_id, @@ -316,24 +316,25 @@ impl VerificationReporterBasic { /// Initialize verification handling by passing a TC reference. This returns a token required /// to call the acceptance functions - pub fn add_tc(&mut self, pus_tc: &PusTc) -> VerificationToken { + pub fn add_tc(&mut self, pus_tc: &PusTc) -> VerificationToken { self.add_tc_with_req_id(RequestId::new(pus_tc)) } /// Same as [Self::add_tc] but pass a request ID instead of the direct telecommand. /// This can be useful if the executing thread does not have full access to the telecommand. - pub fn add_tc_with_req_id(&mut self, req_id: RequestId) -> VerificationToken { - VerificationToken::::new(req_id) + pub fn add_tc_with_req_id(&mut self, req_id: RequestId) -> VerificationToken { + VerificationToken::::new(req_id) } /// Package and send a PUS TM\[1, 1\] packet, see 8.1.2.1 of the PUS standard pub fn acceptance_success( &mut self, buf: &mut [u8], - token: VerificationToken, + token: VerificationToken, sender: &mut (impl EcssTmSender + ?Sized), time_stamp: &[u8], - ) -> Result, VerificationErrorWithToken> { + ) -> Result, VerificationErrorWithToken> + { let tm = self .create_pus_verif_success_tm( buf, @@ -357,10 +358,10 @@ impl VerificationReporterBasic { pub fn acceptance_failure( &mut self, buf: &mut [u8], - token: VerificationToken, + token: VerificationToken, sender: &mut (impl EcssTmSender + ?Sized), params: FailParams, - ) -> Result<(), VerificationErrorWithToken> { + ) -> Result<(), VerificationErrorWithToken> { let tm = self .create_pus_verif_fail_tm( buf, @@ -383,10 +384,11 @@ impl VerificationReporterBasic { pub fn start_success( &mut self, buf: &mut [u8], - token: VerificationToken, + token: VerificationToken, sender: &mut (impl EcssTmSender + ?Sized), time_stamp: &[u8], - ) -> Result, VerificationErrorWithToken> { + ) -> Result, VerificationErrorWithToken> + { let tm = self .create_pus_verif_success_tm( buf, @@ -413,10 +415,10 @@ impl VerificationReporterBasic { pub fn start_failure( &mut self, buf: &mut [u8], - token: VerificationToken, + token: VerificationToken, sender: &mut (impl EcssTmSender + ?Sized), params: FailParams, - ) -> Result<(), VerificationErrorWithToken> { + ) -> Result<(), VerificationErrorWithToken> { let tm = self .create_pus_verif_fail_tm( buf, @@ -439,7 +441,7 @@ impl VerificationReporterBasic { pub fn step_success( &mut self, buf: &mut [u8], - token: &VerificationToken, + token: &VerificationToken, sender: &mut (impl EcssTmSender + ?Sized), time_stamp: &[u8], step: impl EcssEnumeration, @@ -463,10 +465,10 @@ impl VerificationReporterBasic { pub fn step_failure( &mut self, buf: &mut [u8], - token: VerificationToken, + token: VerificationToken, sender: &mut (impl EcssTmSender + ?Sized), params: FailParamsWithStep, - ) -> Result<(), VerificationErrorWithToken> { + ) -> Result<(), VerificationErrorWithToken> { let tm = self .create_pus_verif_fail_tm( buf, @@ -490,10 +492,10 @@ impl VerificationReporterBasic { pub fn completion_success( &mut self, buf: &mut [u8], - token: VerificationToken, + token: VerificationToken, sender: &mut (impl EcssTmSender + ?Sized), time_stamp: &[u8], - ) -> Result<(), VerificationErrorWithToken> { + ) -> Result<(), VerificationErrorWithToken> { let tm = self .create_pus_verif_success_tm( buf, @@ -517,10 +519,10 @@ impl VerificationReporterBasic { pub fn completion_failure( &mut self, buf: &mut [u8], - token: VerificationToken, + token: VerificationToken, sender: &mut (impl EcssTmSender + ?Sized), params: FailParams, - ) -> Result<(), VerificationErrorWithToken> { + ) -> Result<(), VerificationErrorWithToken> { let tm = self .create_pus_verif_fail_tm( buf, @@ -689,8 +691,8 @@ mod allocmod { to self.reporter { pub fn set_apid(&mut self, apid: u16) -> bool; pub fn apid(&self) -> u16; - pub fn add_tc(&mut self, pus_tc: &PusTc) -> VerificationToken; - pub fn add_tc_with_req_id(&mut self, req_id: RequestId) -> VerificationToken; + pub fn add_tc(&mut self, pus_tc: &PusTc) -> VerificationToken; + pub fn add_tc_with_req_id(&mut self, req_id: RequestId) -> VerificationToken; pub fn dest_id(&self) -> u16; pub fn set_dest_id(&mut self, dest_id: u16); } @@ -703,10 +705,10 @@ mod allocmod { /// Package and send a PUS TM\[1, 1\] packet, see 8.1.2.1 of the PUS standard pub fn acceptance_success( &mut self, - token: VerificationToken, + token: VerificationToken, sender: &mut (impl EcssTmSender + ?Sized), time_stamp: &[u8], - ) -> Result, VerificationErrorWithToken> + ) -> Result, VerificationErrorWithToken> { self.reporter.acceptance_success( self.source_data_buf.as_mut_slice(), @@ -719,10 +721,10 @@ mod allocmod { /// Package and send a PUS TM\[1, 2\] packet, see 8.1.2.2 of the PUS standard pub fn acceptance_failure( &mut self, - token: VerificationToken, + token: VerificationToken, sender: &mut (impl EcssTmSender + ?Sized), params: FailParams, - ) -> Result<(), VerificationErrorWithToken> { + ) -> Result<(), VerificationErrorWithToken> { self.reporter.acceptance_failure( self.source_data_buf.as_mut_slice(), token, @@ -736,10 +738,10 @@ mod allocmod { /// Requires a token previously acquired by calling [Self::acceptance_success]. pub fn start_success( &mut self, - token: VerificationToken, + token: VerificationToken, sender: &mut (impl EcssTmSender + ?Sized), time_stamp: &[u8], - ) -> Result, VerificationErrorWithToken> + ) -> Result, VerificationErrorWithToken> { self.reporter.start_success( self.source_data_buf.as_mut_slice(), @@ -755,10 +757,10 @@ mod allocmod { /// the token because verification handling is done. pub fn start_failure( &mut self, - token: VerificationToken, + token: VerificationToken, sender: &mut (impl EcssTmSender + ?Sized), params: FailParams, - ) -> Result<(), VerificationErrorWithToken> { + ) -> Result<(), VerificationErrorWithToken> { self.reporter .start_failure(self.source_data_buf.as_mut_slice(), token, sender, params) } @@ -768,7 +770,7 @@ mod allocmod { /// Requires a token previously acquired by calling [Self::start_success]. pub fn step_success( &mut self, - token: &VerificationToken, + token: &VerificationToken, sender: &mut (impl EcssTmSender + ?Sized), time_stamp: &[u8], step: impl EcssEnumeration, @@ -788,10 +790,10 @@ mod allocmod { /// token because verification handling is done. pub fn step_failure( &mut self, - token: VerificationToken, + token: VerificationToken, sender: &mut (impl EcssTmSender + ?Sized), params: FailParamsWithStep, - ) -> Result<(), VerificationErrorWithToken> { + ) -> Result<(), VerificationErrorWithToken> { self.reporter .step_failure(self.source_data_buf.as_mut_slice(), token, sender, params) } @@ -802,10 +804,10 @@ mod allocmod { /// token because verification handling is done. pub fn completion_success( &mut self, - token: VerificationToken, + token: VerificationToken, sender: &mut (impl EcssTmSender + ?Sized), time_stamp: &[u8], - ) -> Result<(), VerificationErrorWithToken> { + ) -> Result<(), VerificationErrorWithToken> { self.reporter.completion_success( self.source_data_buf.as_mut_slice(), token, @@ -820,10 +822,10 @@ mod allocmod { /// token because verification handling is done. pub fn completion_failure( &mut self, - token: VerificationToken, + token: VerificationToken, sender: &mut (impl EcssTmSender + ?Sized), params: FailParams, - ) -> Result<(), VerificationErrorWithToken> { + ) -> Result<(), VerificationErrorWithToken> { self.reporter.completion_failure( self.source_data_buf.as_mut_slice(), token, @@ -857,8 +859,8 @@ mod allocmod { to self.reporter { pub fn set_apid(&mut self, apid: u16) -> bool; pub fn apid(&self) -> u16; - pub fn add_tc(&mut self, pus_tc: &PusTc) -> VerificationToken; - pub fn add_tc_with_req_id(&mut self, req_id: RequestId) -> VerificationToken; + pub fn add_tc(&mut self, pus_tc: &PusTc) -> VerificationToken; + pub fn add_tc_with_req_id(&mut self, req_id: RequestId) -> VerificationToken; pub fn dest_id(&self) -> u16; pub fn set_dest_id(&mut self, dest_id: u16); } @@ -866,9 +868,9 @@ mod allocmod { pub fn acceptance_success( &mut self, - token: VerificationToken, + token: VerificationToken, time_stamp: &[u8], - ) -> Result, VerificationErrorWithToken> + ) -> Result, VerificationErrorWithToken> { self.reporter .acceptance_success(token, self.sender.as_mut(), time_stamp) @@ -876,18 +878,18 @@ mod allocmod { pub fn acceptance_failure( &mut self, - token: VerificationToken, + token: VerificationToken, params: FailParams, - ) -> Result<(), VerificationErrorWithToken> { + ) -> Result<(), VerificationErrorWithToken> { self.reporter .acceptance_failure(token, self.sender.as_mut(), params) } pub fn start_success( &mut self, - token: VerificationToken, + token: VerificationToken, time_stamp: &[u8], - ) -> Result, VerificationErrorWithToken> + ) -> Result, VerificationErrorWithToken> { self.reporter .start_success(token, self.sender.as_mut(), time_stamp) @@ -895,16 +897,16 @@ mod allocmod { pub fn start_failure( &mut self, - token: VerificationToken, + token: VerificationToken, params: FailParams, - ) -> Result<(), VerificationErrorWithToken> { + ) -> Result<(), VerificationErrorWithToken> { self.reporter .start_failure(token, self.sender.as_mut(), params) } pub fn step_success( &mut self, - token: &VerificationToken, + token: &VerificationToken, time_stamp: &[u8], step: impl EcssEnumeration, ) -> Result<(), EcssTmError> { @@ -914,27 +916,27 @@ mod allocmod { pub fn step_failure( &mut self, - token: VerificationToken, + token: VerificationToken, params: FailParamsWithStep, - ) -> Result<(), VerificationErrorWithToken> { + ) -> Result<(), VerificationErrorWithToken> { self.reporter .step_failure(token, self.sender.as_mut(), params) } pub fn completion_success( &mut self, - token: VerificationToken, + token: VerificationToken, time_stamp: &[u8], - ) -> Result<(), VerificationErrorWithToken> { + ) -> Result<(), VerificationErrorWithToken> { self.reporter .completion_success(token, self.sender.as_mut(), time_stamp) } pub fn completion_failure( &mut self, - token: VerificationToken, + token: VerificationToken, params: FailParams, - ) -> Result<(), VerificationErrorWithToken> { + ) -> Result<(), VerificationErrorWithToken> { self.reporter .completion_failure(token, self.sender.as_mut(), params) } @@ -1092,7 +1094,7 @@ mod stdmod { mod tests { use crate::pus::tests::CommonTmInfo; use crate::pus::verification::{ - EcssTmError, EcssTmSender, FailParams, FailParamsWithStep, RequestId, StateNone, + EcssTmError, EcssTmSender, FailParams, FailParamsWithStep, RequestId, TcStateNone, VerificationReporter, VerificationReporterCfg, VerificationReporterWithSender, VerificationToken, }; @@ -1193,7 +1195,7 @@ mod tests { (pus_tc, req_id) } - fn base_init(api_sel: bool) -> (TestBase<'static>, VerificationToken) { + fn base_init(api_sel: bool) -> (TestBase<'static>, VerificationToken) { let mut reporter = base_reporter(); let (tc, req_id) = base_tc_init(None); let init_tok; @@ -1207,7 +1209,7 @@ mod tests { fn base_with_helper_init() -> ( TestBaseWithHelper<'static, ()>, - VerificationToken, + VerificationToken, ) { let mut reporter = base_reporter(); let (tc, _) = base_tc_init(None); diff --git a/fsrc-example/src/bin/obsw/main.rs b/fsrc-example/src/bin/obsw/main.rs index f276e6f..638f3f9 100644 --- a/fsrc-example/src/bin/obsw/main.rs +++ b/fsrc-example/src/bin/obsw/main.rs @@ -2,20 +2,25 @@ mod ccsds; mod pus; mod tmtc; -use crate::tmtc::{core_tmtc_task, TmStore, PUS_APID}; +use crate::tmtc::{core_tmtc_task, CoreTmtcArgs, TmStore, PUS_APID}; use fsrc_core::event_man::{EventManager, MpscEventReceiver, MpscEventU32SendProvider}; use fsrc_core::events::EventU32; use fsrc_core::hal::host::udp_server::UdpTcServer; -use fsrc_core::params::Params; use fsrc_core::pool::{LocalPool, PoolCfg, SharedPool, StoreAddr}; -use fsrc_core::pus::event_man::{DefaultPusMgmtBackendProvider, EventReporter, PusEventDispatcher}; +use fsrc_core::pus::event_man::{ + DefaultPusMgmtBackendProvider, EventReporter, EventRequest, EventRequestWithToken, + PusEventDispatcher, +}; use fsrc_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 spacepackets::time::{CdsShortTimeProvider, TimeWriter}; +use spacepackets::tm::PusTm; use std::net::{IpAddr, SocketAddr}; -use std::sync::mpsc::{channel, TryRecvError}; +use std::sync::mpsc::channel; use std::sync::{mpsc, Arc, Mutex, RwLock}; use std::thread; @@ -32,6 +37,28 @@ struct UdpTmtcServer { unsafe impl Send for UdpTmtcServer {} +struct EventTmSender { + store_helper: TmStore, + sender: mpsc::Sender, +} + +impl EventTmSender { + fn new(store_helper: TmStore, sender: mpsc::Sender) -> Self { + Self { + store_helper, + sender, + } + } +} + +impl EcssTmSender for EventTmSender { + type Error = mpsc::SendError; + + fn send_tm(&mut self, tm: PusTm) -> Result<(), EcssTmError> { + let addr = self.store_helper.add_pus_tm(&tm); + self.sender.send(addr).map_err(EcssTmError::SendError) + } +} fn main() { println!("Running OBSW example"); let pool_cfg = PoolCfg::new(vec![(8, 32), (4, 64), (2, 128)]); @@ -41,32 +68,38 @@ fn main() { pool: tm_store.clone(), }; let addr = SocketAddr::new(IpAddr::V4(OBSW_SERVER_ADDR), SERVER_PORT); - let (tm_funnel_tx, tm_funnel_rx) = mpsc::channel(); - let (tm_server_tx, tm_server_rx) = mpsc::channel(); + let (tm_funnel_tx, tm_funnel_rx) = channel(); + let (tm_server_tx, tm_server_rx) = channel(); let sender = MpscVerifSender::new(tm_store.clone(), tm_funnel_tx.clone()); let verif_cfg = VerificationReporterCfg::new(PUS_APID, 1, 2, 8).unwrap(); let reporter_with_sender_0 = Arc::new(Mutex::new(VerificationReporterWithSender::new( verif_cfg, Box::new(sender), ))); + + // Create event handling components + let (event_request_tx, event_request_rx) = channel::(); let (event_sender, event_man_rx) = channel(); let event_recv = MpscEventReceiver::::new(event_man_rx); let mut event_man = EventManager::new(Box::new(event_recv)); let event_reporter = EventReporter::new(PUS_APID, 128).unwrap(); let pus_tm_backend = DefaultPusMgmtBackendProvider::::default(); - let pus_event_man = PusEventDispatcher::new(event_reporter, Box::new(pus_tm_backend)); + let mut pus_event_dispatcher = + PusEventDispatcher::new(event_reporter, Box::new(pus_tm_backend)); let (pus_event_man_tx, pus_event_man_rx) = channel(); let pus_event_man_send_provider = MpscEventU32SendProvider::new(1, pus_event_man_tx); + let reporter1 = reporter_with_sender_0.clone(); event_man.subscribe_all(pus_event_man_send_provider); + + // Create clones here to allow move for thread 0 + let core_args = CoreTmtcArgs { + tm_store: tm_store_helper.clone(), + tm_sender: tm_funnel_tx.clone(), + event_sender, + event_request_tx, + }; let jh0 = thread::spawn(move || { - core_tmtc_task( - tm_funnel_tx.clone(), - tm_server_rx, - tm_store_helper.clone(), - addr, - reporter_with_sender_0.clone(), - event_sender.clone(), - ); + core_tmtc_task(core_args, tm_server_rx, addr, reporter_with_sender_0); }); let jh1 = thread::spawn(move || { @@ -84,10 +117,43 @@ fn main() { } }); - let jh2 = thread::spawn(move || loop { - match pus_event_man_rx.try_recv() { - Ok(_) => {} - Err(_) => {} + let jh2 = thread::spawn(move || { + let mut timestamp: [u8; 7] = [0; 7]; + let mut sender = EventTmSender::new(tm_store_helper, tm_funnel_tx); + let mut time_provider = CdsShortTimeProvider::new(0, 0); + let report_completion = |event_req: EventRequestWithToken, timestamp: &[u8]| { + let mut reporter = reporter1 + .lock() + .expect("Locking Verification reporter failed"); + reporter + .completion_success(event_req.token, timestamp) + .expect("Sending completion success failed"); + }; + loop { + if let Ok(event_req) = event_request_rx.try_recv() { + match event_req.request { + EventRequest::Enable(event) => { + pus_event_dispatcher + .enable_tm_for_event(&event) + .expect("Enabling TM failed"); + update_time(&mut time_provider, &mut timestamp); + report_completion(event_req, ×tamp); + } + EventRequest::Disable(event) => { + pus_event_dispatcher + .disable_tm_for_event(&event) + .expect("Disabling TM failed"); + update_time(&mut time_provider, &mut timestamp); + report_completion(event_req, ×tamp); + } + } + } + if let Ok((event, _param)) = pus_event_man_rx.try_recv() { + update_time(&mut time_provider, &mut timestamp); + pus_event_dispatcher + .generate_pus_event_tm_generic(&mut sender, ×tamp, event, None) + .expect("Sending TM as event failed"); + } } }); @@ -95,3 +161,12 @@ fn main() { jh1.join().expect("Joining TM Funnel thread failed"); jh2.join().expect("Joining Event Manager thread failed"); } + +pub fn update_time(time_provider: &mut CdsShortTimeProvider, timestamp: &mut [u8]) { + time_provider + .update_from_now() + .expect("Could not get current time"); + time_provider + .write_to_bytes(timestamp) + .expect("Writing timestamp failed"); +} diff --git a/fsrc-example/src/bin/obsw/pus.rs b/fsrc-example/src/bin/obsw/pus.rs index 4ab47b4..c0a0c68 100644 --- a/fsrc-example/src/bin/obsw/pus.rs +++ b/fsrc-example/src/bin/obsw/pus.rs @@ -1,7 +1,7 @@ use crate::tmtc::TmStore; use fsrc_core::pool::StoreAddr; use fsrc_core::pus::verification::{ - SharedStdVerifReporterWithSender, StateAccepted, VerificationToken, + SharedStdVerifReporterWithSender, TcStateAccepted, VerificationToken, }; use fsrc_core::tmtc::tm_helper::PusTmWithCdsShortHelper; use fsrc_core::tmtc::PusServiceProvider; @@ -71,7 +71,7 @@ impl PusServiceProvider for PusReceiver { } impl PusReceiver { - fn handle_test_service(&mut self, pus_tc: &PusTc, token: VerificationToken) { + fn handle_test_service(&mut self, pus_tc: &PusTc, token: VerificationToken) { if pus_tc.subservice() == 1 { println!("Received PUS ping command TC[17,1]"); println!("Sending ping reply PUS TM[17,2]"); diff --git a/fsrc-example/src/bin/obsw/tmtc.rs b/fsrc-example/src/bin/obsw/tmtc.rs index 56352b0..3ff05f4 100644 --- a/fsrc-example/src/bin/obsw/tmtc.rs +++ b/fsrc-example/src/bin/obsw/tmtc.rs @@ -11,12 +11,20 @@ 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 spacepackets::tm::PusTm; pub const PUS_APID: u16 = 0x02; +pub struct CoreTmtcArgs { + pub tm_store: TmStore, + pub tm_sender: Sender, + pub event_sender: Sender<(EventU32, Option)>, + pub event_request_tx: Sender, +} + #[derive(Clone)] pub struct TmStore { pub pool: SharedPool, @@ -34,17 +42,15 @@ impl TmStore { } pub fn core_tmtc_task( - tm_creator_tx: Sender, + args: CoreTmtcArgs, tm_server_rx: mpsc::Receiver, - tm_store_helper: TmStore, addr: SocketAddr, verif_reporter: SharedStdVerifReporterWithSender, - _event_tx: Sender<(EventU32, Option)>, ) { let pus_receiver = PusReceiver::new( PUS_APID, - tm_creator_tx, - tm_store_helper.clone(), + args.tm_sender, + args.tm_store.clone(), verif_reporter, ); let pus_distributor = PusDistributor::new(Box::new(pus_receiver)); @@ -58,7 +64,7 @@ pub fn core_tmtc_task( let mut udp_tmtc_server = UdpTmtcServer { udp_tc_server, tm_rx: tm_server_rx, - tm_store: tm_store_helper.pool.clone(), + tm_store: args.tm_store.pool.clone(), }; loop { core_tmtc_loop(&mut udp_tmtc_server);