From 0e2a413505f5b86a0a3c8221ee020a1e2c0c4045 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 21 Jul 2023 20:23:24 +0200 Subject: [PATCH] start adding CFDP state machines --- satrs-core/src/cfdp/dest.rs | 13 +++++++++++++ satrs-core/src/cfdp/mod.rs | 25 +++++++++++++++++++++++++ satrs-core/src/lib.rs | 1 + 3 files changed, 39 insertions(+) create mode 100644 satrs-core/src/cfdp/dest.rs create mode 100644 satrs-core/src/cfdp/mod.rs diff --git a/satrs-core/src/cfdp/dest.rs b/satrs-core/src/cfdp/dest.rs new file mode 100644 index 0000000..13e5cbe --- /dev/null +++ b/satrs-core/src/cfdp/dest.rs @@ -0,0 +1,13 @@ +use super::{TransactionStep, State}; + +pub struct DestinationHandler { + step: TransactionStep, + state: State +} + +impl DestinationHandler { + + pub fn state_machine() {} + + +} diff --git a/satrs-core/src/cfdp/mod.rs b/satrs-core/src/cfdp/mod.rs new file mode 100644 index 0000000..f62bd14 --- /dev/null +++ b/satrs-core/src/cfdp/mod.rs @@ -0,0 +1,25 @@ +pub mod dest; + +#[derive(Copy, Clone, PartialEq, Eq)] +pub enum TransactionStep { + Idle = 0, + TransactionStart = 1, + ReceivingFileDataPdus = 2, + SendingAckPdu = 3, + TransferCompletion = 4, + SendingFinishedPdu = 5 +} + +#[derive(Copy, Clone, PartialEq, Eq)] +pub enum State { + Idle = 0, + BusyClass1Nacked = 2, + BusyClass2Acked = 3, +} + +#[cfg(test)] +mod tests { + #[test] + fn basic_test() { + } +} diff --git a/satrs-core/src/lib.rs b/satrs-core/src/lib.rs index 43c8cfb..6484cc8 100644 --- a/satrs-core/src/lib.rs +++ b/satrs-core/src/lib.rs @@ -40,6 +40,7 @@ pub mod request; pub mod res_code; pub mod seq_count; pub mod tmtc; +pub mod cfdp; pub use spacepackets;