finished basic FS request impl
All checks were successful
Rust/spacepackets/pipeline/pr-main This commit looks good
Rust/spacepackets/pipeline/head This commit looks good

This commit is contained in:
2023-06-12 14:26:40 +02:00
parent 895080bbc0
commit 99dbf9dc85
2 changed files with 217 additions and 8 deletions

View File

@@ -143,8 +143,14 @@ pub enum TlvLvError {
ByteConversionError(ByteConversionError),
/// First value: Found value. Second value: Expected value if there is one.
InvalidTlvTypeField((u8, Option<u8>)),
/// Logically invalid value length detected.
InvalidValueLength(u8),
/// Logically invalid value length detected. The value length may not exceed 255 bytes.
/// Depending on the concrete TLV type, the value length may also be logically invalid.
InvalidValueLength(usize),
/// Only applies to filestore requests and responses. Second name was missing where one is
/// expected.
SecondNameMissing,
/// Invalid action code for filestore requests or responses.
InvalidFilestoreActionCode(u8),
}
impl From<ByteConversionError> for TlvLvError {
@@ -176,6 +182,12 @@ impl Display for TlvLvError {
TlvLvError::InvalidValueLength(len) => {
write!(f, "invalid value length {len} detected")
}
TlvLvError::SecondNameMissing => {
write!(f, "second name missing for filestore request or response")
}
TlvLvError::InvalidFilestoreActionCode(raw) => {
write!(f, "invalid filestore action code with raw value {raw}")
}
}
}
}