now its getting tricky again
Some checks failed
Rust/sat-rs/pipeline/pr-main There was a failure building this commit
Some checks failed
Rust/sat-rs/pipeline/pr-main There was a failure building this commit
This commit is contained in:
parent
05391bbafe
commit
c8c18c54df
@ -149,7 +149,7 @@ impl DestinationHandler {
|
|||||||
return Ok(None);
|
return Ok(None);
|
||||||
}
|
}
|
||||||
let directive = self.packets_to_send_ctx.directive.unwrap();
|
let directive = self.packets_to_send_ctx.directive.unwrap();
|
||||||
let mut writte_size = 0;
|
let mut written_size = 0;
|
||||||
match directive {
|
match directive {
|
||||||
FileDirectiveType::EofPdu => todo!(),
|
FileDirectiveType::EofPdu => todo!(),
|
||||||
FileDirectiveType::FinishedPdu => {
|
FileDirectiveType::FinishedPdu => {
|
||||||
@ -175,7 +175,7 @@ impl DestinationHandler {
|
|||||||
entity_id,
|
entity_id,
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
writte_size = finished_pdu.write_to_bytes(buf)?;
|
written_size = finished_pdu.write_to_bytes(buf)?;
|
||||||
}
|
}
|
||||||
FileDirectiveType::AckPdu => todo!(),
|
FileDirectiveType::AckPdu => todo!(),
|
||||||
FileDirectiveType::MetadataPdu => todo!(),
|
FileDirectiveType::MetadataPdu => todo!(),
|
||||||
@ -183,7 +183,7 @@ impl DestinationHandler {
|
|||||||
FileDirectiveType::PromptPdu => todo!(),
|
FileDirectiveType::PromptPdu => todo!(),
|
||||||
FileDirectiveType::KeepAlivePdu => todo!(),
|
FileDirectiveType::KeepAlivePdu => todo!(),
|
||||||
}
|
}
|
||||||
Ok(Some((directive, writte_size)))
|
Ok(Some((directive, written_size)))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_file_directive(
|
pub fn handle_file_directive(
|
||||||
@ -292,23 +292,21 @@ impl DestinationHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn fsm_nacked(&mut self) -> Result<(), DestError> {
|
fn fsm_nacked(&mut self) -> Result<(), DestError> {
|
||||||
match self.step {
|
if self.step == TransactionStep::Idle {}
|
||||||
TransactionStep::Idle => {
|
if self.step == TransactionStep::TransactionStart {
|
||||||
// TODO: Should not happen. Determine what to do later
|
|
||||||
}
|
|
||||||
TransactionStep::TransactionStart => {
|
|
||||||
self.transaction_start()?;
|
self.transaction_start()?;
|
||||||
}
|
}
|
||||||
TransactionStep::ReceivingFileDataPdus => {
|
if self.step == TransactionStep::ReceivingFileDataPdus {
|
||||||
todo!("advance the fsm if everything is finished")
|
todo!("advance the fsm if everything is finished")
|
||||||
}
|
}
|
||||||
TransactionStep::TransferCompletion => {
|
if self.step == TransactionStep::TransferCompletion {
|
||||||
self.transfer_completion()?;
|
self.transfer_completion()?;
|
||||||
}
|
}
|
||||||
TransactionStep::SendingAckPdu => todo!(),
|
if self.step == TransactionStep::SendingAckPdu {
|
||||||
TransactionStep::SendingFinishedPdu => {
|
todo!();
|
||||||
self.prepare_finished_pdu()?;
|
|
||||||
}
|
}
|
||||||
|
if self.step == TransactionStep::SendingFinishedPdu {
|
||||||
|
return Ok(());
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -355,13 +353,17 @@ impl DestinationHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn transfer_completion(&mut self) -> Result<(), DestError> {
|
fn transfer_completion(&mut self) -> Result<(), DestError> {
|
||||||
todo!();
|
if self.transaction_params.metadata_params.closure_requested {
|
||||||
|
self.prepare_finished_pdu()?;
|
||||||
|
}
|
||||||
|
todo!("user indication");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn prepare_finished_pdu(&mut self) -> Result<(), DestError> {
|
fn prepare_finished_pdu(&mut self) -> Result<(), DestError> {
|
||||||
self.packets_to_send_ctx.packet_available = true;
|
self.packets_to_send_ctx.packet_available = true;
|
||||||
self.packets_to_send_ctx.directive = Some(FileDirectiveType::FinishedPdu);
|
self.packets_to_send_ctx.directive = Some(FileDirectiveType::FinishedPdu);
|
||||||
|
self.step = TransactionStep::SendingFinishedPdu;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user