This commit is contained in:
parent
beebf00565
commit
2213a25508
@ -1,6 +1,5 @@
|
|||||||
use spacepackets::cfdp::{pdu::FileDirectiveType, PduType};
|
|
||||||
|
|
||||||
use super::{State, TransactionStep};
|
use super::{State, TransactionStep};
|
||||||
|
use spacepackets::cfdp::{pdu::FileDirectiveType, PduType};
|
||||||
|
|
||||||
pub struct DestinationHandler {
|
pub struct DestinationHandler {
|
||||||
step: TransactionStep,
|
step: TransactionStep,
|
||||||
@ -13,8 +12,29 @@ impl DestinationHandler {
|
|||||||
pdu_type: PduType,
|
pdu_type: PduType,
|
||||||
pdu_directive: Option<FileDirectiveType>,
|
pdu_directive: Option<FileDirectiveType>,
|
||||||
raw_packet: &[u8],
|
raw_packet: &[u8],
|
||||||
) {
|
) -> Result<(), ()> {
|
||||||
|
match pdu_type {
|
||||||
|
PduType::FileDirective => {
|
||||||
|
if pdu_directive.is_none() {
|
||||||
|
return Err(());
|
||||||
|
}
|
||||||
|
self.handle_file_directive(pdu_directive.unwrap(), raw_packet)
|
||||||
|
}
|
||||||
|
PduType::FileData => self.handle_file_data(raw_packet),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn handle_file_data(&mut self, raw_packet: &[u8]) -> Result<(), ()> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
pub fn handle_file_directive(
|
||||||
|
&mut self,
|
||||||
|
pdu_directive: FileDirectiveType,
|
||||||
|
raw_packet: &[u8],
|
||||||
|
) -> Result<(), ()> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
pub fn state_machine(&mut self) {
|
pub fn state_machine(&mut self) {
|
||||||
match self.state {
|
match self.state {
|
||||||
State::Idle => todo!(),
|
State::Idle => todo!(),
|
||||||
|
Loading…
Reference in New Issue
Block a user