this should make clippy happy
All checks were successful
Rust/spacepackets/pipeline/head This commit looks good
All checks were successful
Rust/spacepackets/pipeline/head This commit looks good
This commit is contained in:
parent
3b11af8d4a
commit
35073a45a5
@ -12,7 +12,7 @@ pub const CRC_CCITT_FALSE: Crc<u16> = Crc::<u16>::new(&CRC_16_IBM_3740);
|
||||
pub const CCSDS_HEADER_LEN: usize = size_of::<crate::zc::SpHeader>();
|
||||
|
||||
/// All PUS versions. Only PUS C is supported by this library.
|
||||
#[derive(PartialEq, Copy, Clone, Serialize, Deserialize, Debug)]
|
||||
#[derive(PartialEq, Eq, Copy, Clone, Serialize, Deserialize, Debug)]
|
||||
pub enum PusVersion {
|
||||
EsaPus = 0,
|
||||
PusA = 1,
|
||||
@ -33,7 +33,7 @@ impl TryFrom<u8> for PusVersion {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
pub enum PusError {
|
||||
VersionNotSupported(PusVersion),
|
||||
IncorrectCrc(u16),
|
||||
|
14
src/lib.rs
14
src/lib.rs
@ -59,12 +59,12 @@ pub mod tc;
|
||||
pub mod time;
|
||||
pub mod tm;
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
pub struct SizeMissmatch {
|
||||
pub found: usize,
|
||||
pub expected: usize,
|
||||
}
|
||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
pub enum PacketError {
|
||||
/// The passed slice is too small. Returns the found and expected minimum size
|
||||
ToBytesSliceTooSmall(SizeMissmatch),
|
||||
@ -75,7 +75,7 @@ pub enum PacketError {
|
||||
FromBytesZeroCopyError,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Copy, Clone)]
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Copy, Clone)]
|
||||
pub enum PacketType {
|
||||
Tm = 0,
|
||||
Tc = 1,
|
||||
@ -97,7 +97,7 @@ pub fn packet_type_in_raw_packet_id(packet_id: u16) -> PacketType {
|
||||
PacketType::try_from((packet_id >> 12) as u8 & 0b1).unwrap()
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Copy, Clone)]
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Copy, Clone)]
|
||||
pub enum SequenceFlags {
|
||||
ContinuationSegment = 0b00,
|
||||
FirstSegment = 0b01,
|
||||
@ -121,7 +121,7 @@ impl TryFrom<u8> for SequenceFlags {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Copy, Clone)]
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Copy, Clone)]
|
||||
pub struct PacketId {
|
||||
pub ptype: PacketType,
|
||||
pub sec_header_flag: bool,
|
||||
@ -168,7 +168,7 @@ impl From<u16> for PacketId {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Copy, Clone)]
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Copy, Clone)]
|
||||
pub struct PacketSequenceCtrl {
|
||||
pub seq_flags: SequenceFlags,
|
||||
seq_count: u16,
|
||||
@ -314,7 +314,7 @@ pub trait CcsdsPrimaryHeader {
|
||||
/// 13 bits of the first two bytes of the raw header
|
||||
/// * `psc` - Packet Sequence Control, occupies the third and fourth byte of the raw header
|
||||
/// * `data_len` - Data length field occupies the fifth and the sixth byte of the raw header
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug, PartialEq, Copy, Clone)]
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug, PartialEq, Eq, Copy, Clone)]
|
||||
pub struct SpHeader {
|
||||
pub version: u8,
|
||||
pub packet_id: PacketId,
|
||||
|
@ -134,7 +134,7 @@ pub mod zc {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Copy, Clone, Serialize, Deserialize, Debug)]
|
||||
#[derive(PartialEq, Eq, Copy, Clone, Serialize, Deserialize, Debug)]
|
||||
pub struct PusTcSecondaryHeader {
|
||||
pub service: u8,
|
||||
pub subservice: u8,
|
||||
@ -209,7 +209,7 @@ impl PusTcSecondaryHeader {
|
||||
/// [postcard](https://docs.rs/postcard/latest/postcard/).
|
||||
///
|
||||
/// There is no spare bytes support yet.
|
||||
#[derive(PartialEq, Copy, Clone, Serialize, Deserialize, Debug)]
|
||||
#[derive(PartialEq, Eq, Copy, Clone, Serialize, Deserialize, Debug)]
|
||||
pub struct PusTc<'slice> {
|
||||
sp_header: SpHeader,
|
||||
pub sec_header: PusTcSecondaryHeader,
|
||||
|
@ -14,7 +14,7 @@ pub const CDS_SHORT_LEN: usize = 7;
|
||||
pub const DAYS_CCSDS_TO_UNIX: i32 = -4383;
|
||||
pub const SECONDS_PER_DAY: u32 = 86400;
|
||||
|
||||
#[derive(Debug, PartialEq, Copy, Clone)]
|
||||
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
|
||||
pub enum CcsdsTimeCodes {
|
||||
None = 0,
|
||||
CucCcsdsEpoch = 0b001,
|
||||
@ -38,7 +38,7 @@ impl TryFrom<u8> for CcsdsTimeCodes {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub enum TimestampError {
|
||||
/// Contains tuple where first value is the expected time code and the second
|
||||
/// value is the found raw value
|
||||
|
@ -103,7 +103,7 @@ pub mod zc {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Serialize, Deserialize, Copy, Clone, Debug)]
|
||||
#[derive(PartialEq, Eq, Serialize, Deserialize, Copy, Clone, Debug)]
|
||||
pub struct PusTmSecondaryHeader<'slice> {
|
||||
pus_version: PusVersion,
|
||||
pub sc_time_ref_status: u8,
|
||||
@ -197,7 +197,7 @@ impl<'slice> TryFrom<zc::PusTmSecHeader<'slice>> for PusTmSecondaryHeader<'slice
|
||||
/// [postcard](https://docs.rs/postcard/latest/postcard/).
|
||||
///
|
||||
/// There is no spare bytes support yet.
|
||||
#[derive(PartialEq, Serialize, Deserialize, Debug, Copy, Clone)]
|
||||
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Copy, Clone)]
|
||||
pub struct PusTm<'slice> {
|
||||
pub sp_header: SpHeader,
|
||||
pub sec_header: PusTmSecondaryHeader<'slice>,
|
||||
|
Loading…
x
Reference in New Issue
Block a user