adaptions for spacepackets update
Some checks failed
Rust/sat-rs/pipeline/head There was a failure building this commit
Rust/sat-rs/pipeline/pr-main There was a failure building this commit

This commit is contained in:
2023-08-18 10:21:15 +02:00
parent 698c2edb93
commit ad01472a8e
10 changed files with 47 additions and 47 deletions

View File

@ -2,7 +2,7 @@ use crate::tmtc::TargetId;
use core::mem::size_of;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use spacepackets::{ByteConversionError, SizeMissmatch};
use spacepackets::ByteConversionError;
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
@ -26,10 +26,10 @@ impl ModeAndSubmode {
pub fn from_be_bytes(buf: &[u8]) -> Result<Self, ByteConversionError> {
if buf.len() < 6 {
return Err(ByteConversionError::FromSliceTooSmall(SizeMissmatch {
return Err(ByteConversionError::FromSliceTooSmall {
expected: 6,
found: buf.len(),
}));
});
}
Ok(Self {
mode: u32::from_be_bytes(buf[0..4].try_into().unwrap()),