diff --git a/src/cfdp/pdu/eof.rs b/src/cfdp/pdu/eof.rs index 3c338b0..02cdb42 100644 --- a/src/cfdp/pdu/eof.rs +++ b/src/cfdp/pdu/eof.rs @@ -2,12 +2,26 @@ use crate::cfdp::tlv::EntityIdTlv; use crate::cfdp::ConditionCode; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; +use crate::cfdp::pdu::PduHeader; #[derive(Debug, Copy, Clone, PartialEq, Eq)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct EofPdu { + pdu_header: PduHeader, condition_code: ConditionCode, file_checksum: u32, file_size: u64, fault_location: Option, } + +impl EofPdu { + pub fn new_no_error(pdu_header: PduHeader, file_checksum: u32, file_size: u64) -> Self { + Self { + pdu_header, + condition_code: ConditionCode::NoError, + file_checksum, + file_size, + fault_location: None + } + } +} \ No newline at end of file