diff --git a/satrs-example/src/acs/assembly.rs b/satrs-example/src/acs/assembly.rs new file mode 100644 index 0000000..09e2227 --- /dev/null +++ b/satrs-example/src/acs/assembly.rs @@ -0,0 +1 @@ +// TODO: Write the assembly diff --git a/satrs-example/src/acs/ctrl.rs b/satrs-example/src/acs/ctrl.rs new file mode 100644 index 0000000..ebe9f95 --- /dev/null +++ b/satrs-example/src/acs/ctrl.rs @@ -0,0 +1 @@ +// TODO: Write dummy controller diff --git a/satrs-example/src/acs/mod.rs b/satrs-example/src/acs/mod.rs index bd61e8b..e9223e5 100644 --- a/satrs-example/src/acs/mod.rs +++ b/satrs-example/src/acs/mod.rs @@ -1 +1,4 @@ +pub mod assembly; +pub mod ctrl; pub mod mgm; +pub mod subsystem; diff --git a/satrs-example/src/acs/subsystem.rs b/satrs-example/src/acs/subsystem.rs new file mode 100644 index 0000000..ec11077 --- /dev/null +++ b/satrs-example/src/acs/subsystem.rs @@ -0,0 +1 @@ +// TODO: Write subsystem diff --git a/satrs-example/src/eps/pcdu.rs b/satrs-example/src/eps/pcdu.rs index e975c1d..67e6230 100644 --- a/satrs-example/src/eps/pcdu.rs +++ b/satrs-example/src/eps/pcdu.rs @@ -35,6 +35,7 @@ use crate::{ hk::PusHkHelper, pus::hk::{HkReply, HkReplyVariant}, requests::CompositeRequest, + tmtc::sender::TmTcSender, }; pub trait SerialInterface { @@ -203,14 +204,14 @@ pub type SharedSwitchSet = Arc>; /// Example PCDU device handler. #[derive(new)] #[allow(clippy::too_many_arguments)] -pub struct PcduHandler { +pub struct PcduHandler { id: UniqueApidTargetId, dev_str: &'static str, mode_node: ModeRequestHandlerMpscBounded, composite_request_rx: mpsc::Receiver>, hk_reply_tx: mpsc::SyncSender>, switch_request_rx: mpsc::Receiver>, - tm_sender: TmSender, + tm_sender: TmTcSender, pub com_interface: ComInterface, shared_switch_map: Arc>, #[new(value = "PusHkHelper::new(id)")] @@ -223,7 +224,7 @@ pub struct PcduHandler { tm_buf: [u8; 256], } -impl PcduHandler { +impl PcduHandler { pub fn periodic_operation(&mut self, op_code: OpCode) { match op_code { OpCode::RegularOp => { @@ -404,17 +405,13 @@ impl PcduHandler ModeProvider - for PcduHandler -{ +impl ModeProvider for PcduHandler { fn mode_and_submode(&self) -> ModeAndSubmode { self.mode_and_submode } } -impl ModeRequestHandler - for PcduHandler -{ +impl ModeRequestHandler for PcduHandler { type Error = ModeError; fn start_transition( &mut self, @@ -490,17 +487,13 @@ impl ModeRequestHandler } } -impl ModeNode - for PcduHandler -{ +impl ModeNode for PcduHandler { fn id(&self) -> satrs::ComponentId { PCDU_HANDLER.into() } } -impl ModeChild - for PcduHandler -{ +impl ModeChild for PcduHandler { type Sender = mpsc::SyncSender>; fn add_mode_parent(&mut self, id: satrs::ComponentId, reply_sender: Self::Sender) { @@ -563,7 +556,7 @@ mod tests { pub hk_reply_rx: mpsc::Receiver>, pub tm_rx: mpsc::Receiver, pub switch_request_tx: mpsc::Sender>, - pub handler: PcduHandler>, + pub handler: PcduHandler, } impl PcduTestbench { @@ -575,7 +568,7 @@ mod tests { ModeRequestHandlerMpscBounded::new(PCDU_HANDLER.into(), mode_request_rx); let (composite_request_tx, composite_request_rx) = mpsc::channel(); let (hk_reply_tx, hk_reply_rx) = mpsc::sync_channel(10); - let (tm_tx, tm_rx) = mpsc::channel::(); + let (tm_tx, tm_rx) = mpsc::sync_channel::(5); let (switch_request_tx, switch_reqest_rx) = mpsc::channel(); let shared_switch_map = Arc::new(Mutex::new(SwitchSet::default())); let mut handler = PcduHandler::new( @@ -585,7 +578,7 @@ mod tests { composite_request_rx, hk_reply_tx, switch_reqest_rx, - tm_tx, + TmTcSender::Heap(tm_tx.clone()), SerialInterfaceTest::default(), shared_switch_map, ); diff --git a/satrs-example/src/main.rs b/satrs-example/src/main.rs index 7be5717..0e5be95 100644 --- a/satrs-example/src/main.rs +++ b/satrs-example/src/main.rs @@ -311,7 +311,7 @@ fn main() { mgm_handler_composite_rx, pus_hk_reply_tx.clone(), switch_helper.clone(), - tm_sender, + tm_sender.clone(), mgm_spi_interface, shared_mgm_set, ); @@ -341,7 +341,7 @@ fn main() { pcdu_handler_composite_rx, pus_hk_reply_tx, switch_request_rx, - tm_sink_tx, + tm_sender.clone(), pcdu_serial_interface, shared_switch_set, );