add transaction params struct
This commit is contained in:
parent
c0e1cb8bcf
commit
0ea0f90b25
@ -1,6 +1,9 @@
|
|||||||
use super::{State, TransactionStep};
|
use super::{State, TransactionStep};
|
||||||
use spacepackets::cfdp::{
|
use spacepackets::cfdp::{
|
||||||
pdu::{metadata::MetadataPdu, CommonPduConfig, FileDirectiveType, PduError},
|
pdu::{
|
||||||
|
metadata::{MetadataGenericParams, MetadataPdu},
|
||||||
|
CommonPduConfig, FileDirectiveType, PduError,
|
||||||
|
},
|
||||||
PduType,
|
PduType,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -8,6 +11,12 @@ pub struct DestinationHandler {
|
|||||||
step: TransactionStep,
|
step: TransactionStep,
|
||||||
state: State,
|
state: State,
|
||||||
pdu_conf: CommonPduConfig,
|
pdu_conf: CommonPduConfig,
|
||||||
|
transaction_params: TransactionParams,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
|
struct TransactionParams {
|
||||||
|
metadata_params: MetadataGenericParams,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
||||||
@ -32,6 +41,7 @@ impl DestinationHandler {
|
|||||||
step: TransactionStep::Idle,
|
step: TransactionStep::Idle,
|
||||||
state: State::Idle,
|
state: State::Idle,
|
||||||
pdu_conf: CommonPduConfig::new_with_defaults(),
|
pdu_conf: CommonPduConfig::new_with_defaults(),
|
||||||
|
transaction_params: Default::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,8 +96,7 @@ impl DestinationHandler {
|
|||||||
return Err(DestError::RecvdMetadataButIsBusy);
|
return Err(DestError::RecvdMetadataButIsBusy);
|
||||||
}
|
}
|
||||||
let metadata_pdu = MetadataPdu::from_bytes(raw_packet)?;
|
let metadata_pdu = MetadataPdu::from_bytes(raw_packet)?;
|
||||||
let params = metadata_pdu.metadata_params();
|
self.transaction_params.metadata_params = *metadata_pdu.metadata_params();
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user