Larger update #49

Merged
muellerr merged 41 commits from this-is-complex into main 2023-07-08 15:02:42 +02:00
Showing only changes of commit dd91b7d815 - Show all commits

View File

@ -906,6 +906,7 @@ impl VerificationReporterCore {
mod alloc_mod { mod alloc_mod {
use super::*; use super::*;
use crate::pus::alloc_mod::EcssTmSender; use crate::pus::alloc_mod::EcssTmSender;
use crate::seq_count::SequenceCountProvider;
use alloc::boxed::Box; use alloc::boxed::Box;
use alloc::vec; use alloc::vec;
use alloc::vec::Vec; use alloc::vec::Vec;
@ -944,8 +945,8 @@ mod alloc_mod {
#[derive(Clone)] #[derive(Clone)]
pub struct VerificationReporter { pub struct VerificationReporter {
source_data_buf: Vec<u8>, source_data_buf: Vec<u8>,
//pub seq_count_provider: Option<Box<dyn >> pub seq_count_provider: Option<Box<dyn SequenceCountProvider<u16> + Send>>,
//pub msg_count_provider: Option<Box<dyn SequenceCountProvider<u16>>>, pub msg_count_provider: Option<Box<dyn SequenceCountProvider<u16> + Send>>,
pub reporter: VerificationReporterCore, pub reporter: VerificationReporterCore,
} }
@ -960,6 +961,8 @@ mod alloc_mod {
+ cfg.fail_code_field_width + cfg.fail_code_field_width
+ cfg.max_fail_data_len + cfg.max_fail_data_len
], ],
seq_count_provider: None,
msg_count_provider: None,
reporter, reporter,
} }
} }
@ -989,11 +992,19 @@ mod alloc_mod {
VerificationToken<TcStateAccepted>, VerificationToken<TcStateAccepted>,
VerificationOrSendErrorWithToken<E, TcStateNone>, VerificationOrSendErrorWithToken<E, TcStateNone>,
> { > {
let seq_count = self
.seq_count_provider
.as_ref()
.map_or(0, |v| v.get_and_increment());
let msg_count = self
.seq_count_provider
.as_ref()
.map_or(0, |v| v.get_and_increment());
let sendable = self.reporter.acceptance_success( let sendable = self.reporter.acceptance_success(
self.source_data_buf.as_mut_slice(), self.source_data_buf.as_mut_slice(),
token, token,
0, seq_count,
0, msg_count,
time_stamp, time_stamp,
)?; )?;
self.reporter.send_acceptance_success(sendable, sender) self.reporter.send_acceptance_success(sendable, sender)
@ -1006,11 +1017,19 @@ mod alloc_mod {
sender: &mut (impl EcssTmSenderCore<Error = E> + ?Sized), sender: &mut (impl EcssTmSenderCore<Error = E> + ?Sized),
params: FailParams, params: FailParams,
) -> Result<(), VerificationOrSendErrorWithToken<E, TcStateNone>> { ) -> Result<(), VerificationOrSendErrorWithToken<E, TcStateNone>> {
let seq_count = self
.seq_count_provider
.as_ref()
.map_or(0, |v| v.get_and_increment());
let msg_count = self
.seq_count_provider
.as_ref()
.map_or(0, |v| v.get_and_increment());
let sendable = self.reporter.acceptance_failure( let sendable = self.reporter.acceptance_failure(
self.source_data_buf.as_mut_slice(), self.source_data_buf.as_mut_slice(),
token, token,
0, seq_count,
0, msg_count,
params, params,
)?; )?;
self.reporter.send_acceptance_failure(sendable, sender) self.reporter.send_acceptance_failure(sendable, sender)
@ -1028,11 +1047,19 @@ mod alloc_mod {
VerificationToken<TcStateStarted>, VerificationToken<TcStateStarted>,
VerificationOrSendErrorWithToken<E, TcStateAccepted>, VerificationOrSendErrorWithToken<E, TcStateAccepted>,
> { > {
let seq_count = self
.seq_count_provider
.as_ref()
.map_or(0, |v| v.get_and_increment());
let msg_count = self
.seq_count_provider
.as_ref()
.map_or(0, |v| v.get_and_increment());
let sendable = self.reporter.start_success( let sendable = self.reporter.start_success(
self.source_data_buf.as_mut_slice(), self.source_data_buf.as_mut_slice(),
token, token,
0, seq_count,
0, msg_count,
time_stamp, time_stamp,
)?; )?;
self.reporter.send_start_success(sendable, sender) self.reporter.send_start_success(sendable, sender)
@ -1048,11 +1075,19 @@ mod alloc_mod {
sender: &mut (impl EcssTmSenderCore<Error = E> + ?Sized), sender: &mut (impl EcssTmSenderCore<Error = E> + ?Sized),
params: FailParams, params: FailParams,
) -> Result<(), VerificationOrSendErrorWithToken<E, TcStateAccepted>> { ) -> Result<(), VerificationOrSendErrorWithToken<E, TcStateAccepted>> {
let seq_count = self
.seq_count_provider
.as_ref()
.map_or(0, |v| v.get_and_increment());
let msg_count = self
.seq_count_provider
.as_ref()
.map_or(0, |v| v.get_and_increment());
let sendable = self.reporter.start_failure( let sendable = self.reporter.start_failure(
self.source_data_buf.as_mut_slice(), self.source_data_buf.as_mut_slice(),
token, token,
0, seq_count,
0, msg_count,
params, params,
)?; )?;
self.reporter.send_start_failure(sendable, sender) self.reporter.send_start_failure(sendable, sender)
@ -1068,11 +1103,19 @@ mod alloc_mod {
time_stamp: Option<&[u8]>, time_stamp: Option<&[u8]>,
step: impl EcssEnumeration, step: impl EcssEnumeration,
) -> Result<(), EcssTmtcErrorWithSend<E>> { ) -> Result<(), EcssTmtcErrorWithSend<E>> {
let seq_count = self
.seq_count_provider
.as_ref()
.map_or(0, |v| v.get_and_increment());
let msg_count = self
.seq_count_provider
.as_ref()
.map_or(0, |v| v.get_and_increment());
let sendable = self.reporter.step_success( let sendable = self.reporter.step_success(
self.source_data_buf.as_mut_slice(), self.source_data_buf.as_mut_slice(),
token, token,
0, seq_count,
0, msg_count,
time_stamp, time_stamp,
step, step,
)?; )?;
@ -1091,11 +1134,19 @@ mod alloc_mod {
sender: &mut (impl EcssTmSenderCore<Error = E> + ?Sized), sender: &mut (impl EcssTmSenderCore<Error = E> + ?Sized),
params: FailParamsWithStep, params: FailParamsWithStep,
) -> Result<(), VerificationOrSendErrorWithToken<E, TcStateStarted>> { ) -> Result<(), VerificationOrSendErrorWithToken<E, TcStateStarted>> {
let seq_count = self
.seq_count_provider
.as_ref()
.map_or(0, |v| v.get_and_increment());
let msg_count = self
.seq_count_provider
.as_ref()
.map_or(0, |v| v.get_and_increment());
let sendable = self.reporter.step_failure( let sendable = self.reporter.step_failure(
self.source_data_buf.as_mut_slice(), self.source_data_buf.as_mut_slice(),
token, token,
0, seq_count,
0, msg_count,
params, params,
)?; )?;
self.reporter self.reporter
@ -1112,11 +1163,19 @@ mod alloc_mod {
sender: &mut (impl EcssTmSenderCore<Error = E> + ?Sized), sender: &mut (impl EcssTmSenderCore<Error = E> + ?Sized),
time_stamp: Option<&[u8]>, time_stamp: Option<&[u8]>,
) -> Result<(), VerificationOrSendErrorWithToken<E, TcState>> { ) -> Result<(), VerificationOrSendErrorWithToken<E, TcState>> {
let seq_count = self
.seq_count_provider
.as_ref()
.map_or(0, |v| v.get_and_increment());
let msg_count = self
.seq_count_provider
.as_ref()
.map_or(0, |v| v.get_and_increment());
let sendable = self.reporter.completion_success( let sendable = self.reporter.completion_success(
self.source_data_buf.as_mut_slice(), self.source_data_buf.as_mut_slice(),
token, token,
0, seq_count,
0, msg_count,
time_stamp, time_stamp,
)?; )?;
self.reporter self.reporter
@ -1133,11 +1192,19 @@ mod alloc_mod {
sender: &mut (impl EcssTmSenderCore<Error = E> + ?Sized), sender: &mut (impl EcssTmSenderCore<Error = E> + ?Sized),
params: FailParams, params: FailParams,
) -> Result<(), VerificationOrSendErrorWithToken<E, TcState>> { ) -> Result<(), VerificationOrSendErrorWithToken<E, TcState>> {
let seq_count = self
.seq_count_provider
.as_ref()
.map_or(0, |v| v.get_and_increment());
let msg_count = self
.seq_count_provider
.as_ref()
.map_or(0, |v| v.get_and_increment());
let sendable = self.reporter.completion_failure( let sendable = self.reporter.completion_failure(
self.source_data_buf.as_mut_slice(), self.source_data_buf.as_mut_slice(),
token, token,
0, seq_count,
0, msg_count,
params, params,
)?; )?;
self.reporter self.reporter