added ACK PDU impl
Some checks failed
Rust/spacepackets/pipeline/head There was a failure building this commit

This commit is contained in:
2023-11-26 21:24:24 +01:00
parent 9976b53f65
commit fdf6e1de90
8 changed files with 290 additions and 16 deletions

View File

@ -9,10 +9,12 @@ use core::fmt::{Display, Formatter};
#[cfg(feature = "std")]
use std::error::Error;
pub mod ack;
pub mod eof;
pub mod file_data;
pub mod finished;
pub mod metadata;
pub mod nak;
#[derive(Debug, Copy, Clone, PartialEq, Eq, TryFromPrimitive, IntoPrimitive)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
@ -41,11 +43,14 @@ pub enum PduError {
src_id_len: usize,
dest_id_len: usize,
},
/// Wrong directive type, for example when parsing the directive field for a file directive
/// PDU.
WrongDirectiveType {
found: FileDirectiveType,
expected: FileDirectiveType,
},
/// The directive type field contained a value not in the range of permitted values.
/// The directive type field contained a value not in the range of permitted values. This can
/// also happen if an invalid value is passed to the ACK PDU constructor.
InvalidDirectiveType {
found: u8,
expected: Option<FileDirectiveType>,