base line EOF model
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-07 01:12:07 +02:00
parent 0b714b7426
commit 912c03b5c7
5 changed files with 112 additions and 5 deletions

View File

@ -0,0 +1,13 @@
use crate::cfdp::tlv::EntityIdTlv;
use crate::cfdp::ConditionCode;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct EofPdu {
condition_code: ConditionCode,
file_checksum: u32,
file_size: u64,
fault_location: Option<EntityIdTlv>,
}

View File

@ -32,7 +32,7 @@ pub fn build_metadata_opts_from_slice(
) -> Result<usize, ByteConversionError> {
let mut written = 0;
for tlv in tlvs {
written += tlv.write_to_be_bytes(&mut buf[written..])?;
written += tlv.write_to_bytes(&mut buf[written..])?;
}
Ok(written)
}

View File

@ -7,6 +7,7 @@ use core::fmt::{Display, Formatter};
#[cfg(feature = "std")]
use std::error::Error;
pub mod eof;
pub mod file_data;
pub mod metadata;