first basic Finished PDU impl

This commit is contained in:
2023-06-12 03:57:38 +02:00
parent eb6bc4b8a8
commit 02675ba086
7 changed files with 333 additions and 43 deletions

View File

@ -140,8 +140,8 @@ pub const NULL_CHECKSUM_U32: [u8; 4] = [0; 4];
pub enum TlvLvError {
DataTooLarge(usize),
ByteConversionError(ByteConversionError),
/// First value: Found value. Second value: Expected value.
InvalidTlvTypeField((u8, u8)),
/// First value: Found value. Second value: Expected value if there is one.
InvalidTlvTypeField((u8, Option<u8>)),
/// Logically invalid value length detected.
InvalidValueLength(u8),
}
@ -169,7 +169,7 @@ impl Display for TlvLvError {
TlvLvError::InvalidTlvTypeField((found, expected)) => {
write!(
f,
"invalid TLV type field, found {found}, expected {expected}"
"invalid TLV type field, found {found}, possibly expected {expected:?}"
)
}
TlvLvError::InvalidValueLength(len) => {