From 3818dcd46fce19ce3194e54e6f756cfaf7e821b3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 6 Dec 2023 16:17:54 +0100 Subject: [PATCH] this is less confusing --- CHANGELOG.md | 1 + src/ecss/mod.rs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86efb20..95dfbef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Changed - Renamed `SerializablePusPacket` to `WritablePusPacket`. +- Renamed `UnsignedPfc` to `PfcUnsigned` and `RealPfc` to `PfcReal`. - Renamed `WritablePduPacket.written_len` and `SerializablePusPacket.len_packed` to `len_written`. - Introduce custom implementation of `PartialEq` for `CommonPduConfig` which only compares the values for the source entity ID, destination entity ID and transaction sequence number field to diff --git a/src/ecss/mod.rs b/src/ecss/mod.rs index c373ecf..323509a 100644 --- a/src/ecss/mod.rs +++ b/src/ecss/mod.rs @@ -120,7 +120,7 @@ pub type Ptc = PacketTypeCodes; #[derive(Debug, Copy, Clone, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[repr(u8)] -pub enum UnsignedPfc { +pub enum PfcUnsigned { OneByte = 4, TwelveBits = 8, TwoBytes = 12, @@ -137,7 +137,7 @@ pub enum UnsignedPfc { #[derive(Debug, Copy, Clone, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[repr(u8)] -pub enum RealPfc { +pub enum PfcReal { /// 4 octets simple precision format (IEEE) Float = 1, /// 8 octets simple precision format (IEEE) @@ -483,16 +483,16 @@ mod tests { #[test] fn test_unsigned_pfc_from_u8() { - let pfc_raw = UnsignedPfc::OneByte as u8; - let pfc = UnsignedPfc::try_from(pfc_raw).unwrap(); - assert_eq!(pfc, UnsignedPfc::OneByte); + let pfc_raw = PfcUnsigned::OneByte as u8; + let pfc = PfcUnsigned::try_from(pfc_raw).unwrap(); + assert_eq!(pfc, PfcUnsigned::OneByte); } #[test] fn test_real_pfc_from_u8() { - let pfc_raw = RealPfc::Double as u8; - let pfc = RealPfc::try_from(pfc_raw).unwrap(); - assert_eq!(pfc, RealPfc::Double); + let pfc_raw = PfcReal::Double as u8; + let pfc = PfcReal::try_from(pfc_raw).unwrap(); + assert_eq!(pfc, PfcReal::Double); } #[test]