CFDP initial packet support #14

Merged
muellerr merged 49 commits from cfdp_first_support into main 2023-07-02 17:31:17 +02:00
Showing only changes of commit 84b909b722 - Show all commits

View File

@ -2,12 +2,26 @@ use crate::cfdp::tlv::EntityIdTlv;
use crate::cfdp::ConditionCode; use crate::cfdp::ConditionCode;
#[cfg(feature = "serde")] #[cfg(feature = "serde")]
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::cfdp::pdu::PduHeader;
#[derive(Debug, Copy, Clone, PartialEq, Eq)] #[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct EofPdu { pub struct EofPdu {
pdu_header: PduHeader,
condition_code: ConditionCode, condition_code: ConditionCode,
file_checksum: u32, file_checksum: u32,
file_size: u64, file_size: u64,
fault_location: Option<EntityIdTlv>, fault_location: Option<EntityIdTlv>,
} }
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
}
}
}