this is less confusing
Some checks failed
Rust/spacepackets/pipeline/head There was a failure building this commit

This commit is contained in:
Robin Müller 2023-12-06 16:17:54 +01:00
parent 38f5e3ba5f
commit 3818dcd46f
Signed by: muellerr
GPG Key ID: A649FB78196E3849
2 changed files with 9 additions and 8 deletions

View File

@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## Changed ## Changed
- Renamed `SerializablePusPacket` to `WritablePusPacket`. - Renamed `SerializablePusPacket` to `WritablePusPacket`.
- Renamed `UnsignedPfc` to `PfcUnsigned` and `RealPfc` to `PfcReal`.
- Renamed `WritablePduPacket.written_len` and `SerializablePusPacket.len_packed` to `len_written`. - Renamed `WritablePduPacket.written_len` and `SerializablePusPacket.len_packed` to `len_written`.
- Introduce custom implementation of `PartialEq` for `CommonPduConfig` which only compares the - 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 values for the source entity ID, destination entity ID and transaction sequence number field to

View File

@ -120,7 +120,7 @@ pub type Ptc = PacketTypeCodes;
#[derive(Debug, Copy, Clone, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)] #[derive(Debug, Copy, Clone, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[repr(u8)] #[repr(u8)]
pub enum UnsignedPfc { pub enum PfcUnsigned {
OneByte = 4, OneByte = 4,
TwelveBits = 8, TwelveBits = 8,
TwoBytes = 12, TwoBytes = 12,
@ -137,7 +137,7 @@ pub enum UnsignedPfc {
#[derive(Debug, Copy, Clone, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)] #[derive(Debug, Copy, Clone, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[repr(u8)] #[repr(u8)]
pub enum RealPfc { pub enum PfcReal {
/// 4 octets simple precision format (IEEE) /// 4 octets simple precision format (IEEE)
Float = 1, Float = 1,
/// 8 octets simple precision format (IEEE) /// 8 octets simple precision format (IEEE)
@ -483,16 +483,16 @@ mod tests {
#[test] #[test]
fn test_unsigned_pfc_from_u8() { fn test_unsigned_pfc_from_u8() {
let pfc_raw = UnsignedPfc::OneByte as u8; let pfc_raw = PfcUnsigned::OneByte as u8;
let pfc = UnsignedPfc::try_from(pfc_raw).unwrap(); let pfc = PfcUnsigned::try_from(pfc_raw).unwrap();
assert_eq!(pfc, UnsignedPfc::OneByte); assert_eq!(pfc, PfcUnsigned::OneByte);
} }
#[test] #[test]
fn test_real_pfc_from_u8() { fn test_real_pfc_from_u8() {
let pfc_raw = RealPfc::Double as u8; let pfc_raw = PfcReal::Double as u8;
let pfc = RealPfc::try_from(pfc_raw).unwrap(); let pfc = PfcReal::try_from(pfc_raw).unwrap();
assert_eq!(pfc, RealPfc::Double); assert_eq!(pfc, PfcReal::Double);
} }
#[test] #[test]