From 3457b3a8f958929da6ee48128b8f8e42d39a1f7d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 19 Feb 2023 20:52:42 +0100 Subject: [PATCH] add first definitions --- src/cfdp/mod.rs | 38 ++++++++++++++++++++++++++++++++++++++ src/lib.rs | 1 + 2 files changed, 39 insertions(+) diff --git a/src/cfdp/mod.rs b/src/cfdp/mod.rs index e69de29..5943d78 100644 --- a/src/cfdp/mod.rs +++ b/src/cfdp/mod.rs @@ -0,0 +1,38 @@ +use num_enum::{IntoPrimitive, TryFromPrimitive}; +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; + +pub const CFDP_VERSION_2_NAME: &str = "CCSDS 727.0-B-5"; +pub const CFDP_VERSION_2: u8 = 0b001; + +#[derive(Debug, Copy, Clone, PartialEq, Eq, TryFromPrimitive, IntoPrimitive)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[repr(u8)] +pub enum PduType { + FileDirective = 0, + FileData = 1, +} + +#[derive(Debug, Copy, Clone, PartialEq, Eq, TryFromPrimitive, IntoPrimitive)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[repr(u8)] +pub enum Direction { + TowardsReceiver = 0, + TowardsSender = 1, +} + +#[derive(Debug, Copy, Clone, PartialEq, Eq, TryFromPrimitive, IntoPrimitive)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[repr(u8)] +pub enum TransmissionMode { + Acknowledged = 0, + Unacknowledged = 1, +} + +#[derive(Debug, Copy, Clone, PartialEq, Eq, TryFromPrimitive, IntoPrimitive)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[repr(u8)] +pub enum CrcFlag { + NoCrc = 0, + WithCrc = 1, +} diff --git a/src/lib.rs b/src/lib.rs index a3b02e0..bdb2187 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -68,6 +68,7 @@ use std::error::Error; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; +pub mod cfdp; pub mod ecss; pub mod tc; pub mod time;