diff --git a/src/ecss/tc.rs b/src/ecss/tc.rs index ddac404..b472bc0 100644 --- a/src/ecss/tc.rs +++ b/src/ecss/tc.rs @@ -57,6 +57,9 @@ pub const PUS_TC_MIN_LEN_WITHOUT_APP_DATA: usize = CCSDS_HEADER_LEN + PUC_TC_SECONDARY_HEADER_LEN + size_of::(); const PUS_VERSION: PusVersion = PusVersion::PusC; +/// Marker trait for PUS telecommand structures. +pub trait IsPusTelecommand {} + #[derive(Copy, Clone, PartialEq, Debug)] enum AckOpts { Acceptance = 0b1000, @@ -736,6 +739,8 @@ impl GenericPusTcSecondaryHeader for PusTcCreator<'_> { }); } +impl IsPusTelecommand for PusTcCreator<'_> {} + /// This class can be used to read a PUS TC telecommand from raw memory. /// /// This class also derives the [serde::Serialize] and [serde::Deserialize] trait if the @@ -839,6 +844,8 @@ impl GenericPusTcSecondaryHeader for PusTcReader<'_> { }); } +impl IsPusTelecommand for PusTcReader<'_> {} + impl PartialEq> for PusTcReader<'_> { fn eq(&self, other: &PusTcCreator) -> bool { self.sp_header == other.sp_header diff --git a/src/ecss/tm.rs b/src/ecss/tm.rs index e4def6d..b45506f 100644 --- a/src/ecss/tm.rs +++ b/src/ecss/tm.rs @@ -20,6 +20,8 @@ use delegate::delegate; pub use legacy_tm::*; +pub trait IsPusTelemetry {} + /// Length without timestamp pub const PUC_TM_MIN_SEC_HEADER_LEN: usize = 7; pub const PUS_TM_MIN_LEN_WITHOUT_SOURCE_DATA: usize = @@ -754,6 +756,8 @@ impl GenericPusTmSecondaryHeader for PusTmCreator<'_> { }); } +impl IsPusTelemetry for PusTmCreator<'_> {} + /// This class models the PUS C telemetry packet. It is the primary data structure to read /// a telemetry packet from raw bytes. /// @@ -871,6 +875,8 @@ impl GenericPusTmSecondaryHeader for PusTmReader<'_> { }); } +impl IsPusTelemetry for PusTmReader<'_> {} + impl PartialEq> for PusTmReader<'_> { fn eq(&self, other: &PusTmCreator<'_>) -> bool { self.sp_header == other.sp_header