Major refactoring and update of PUS module
This commit is contained in:
.gitignoreREADME.mdcoverage.py
misc
satrs-example
satrs-mib
satrs-shared
satrs
CHANGELOG.mdCargo.tomlrelease-checklist.md
src
action.rs
cfdp
encoding
event_man.rsevents.rshal
hk.rslib.rsmode.rsmode_tree.rsobjects.rsparams.rspool.rspus
action.rsevent.rsevent_man.rsevent_srv.rshk.rsmod.rsmode.rsscheduler.rsscheduler_srv.rstest.rsverification.rs
queue.rsrequest.rsseq_count.rstime.rstmtc
tests
@ -8,7 +8,9 @@ pub use std_mod::*;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
pub mod std_mod {
|
||||
use crate::pool::{PoolProvider, SharedStaticMemoryPool, StaticMemoryPool, StoreAddr};
|
||||
use crate::pool::{
|
||||
PoolProvider, SharedStaticMemoryPool, StaticMemoryPool, StoreAddr, StoreError,
|
||||
};
|
||||
use crate::pus::EcssTmtcError;
|
||||
use spacepackets::ecss::tm::PusTmCreator;
|
||||
use spacepackets::ecss::WritablePusPacket;
|
||||
@ -34,7 +36,7 @@ pub mod std_mod {
|
||||
}
|
||||
|
||||
pub fn add_pus_tm(&self, pus_tm: &PusTmCreator) -> Result<StoreAddr, EcssTmtcError> {
|
||||
let mut pg = self.0.write().map_err(|_| EcssTmtcError::StoreLock)?;
|
||||
let mut pg = self.0.write().map_err(|_| StoreError::LockError)?;
|
||||
let addr = pg.free_element(pus_tm.len_written(), |buf| {
|
||||
pus_tm
|
||||
.write_to_bytes(buf)
|
||||
@ -90,9 +92,9 @@ impl PusTmWithCdsShortHelper {
|
||||
source_data: &'a [u8],
|
||||
seq_count: u16,
|
||||
) -> PusTmCreator {
|
||||
let mut reply_header = SpHeader::tm_unseg(self.apid, seq_count, 0).unwrap();
|
||||
let reply_header = SpHeader::new_for_unseg_tm(self.apid, seq_count, 0);
|
||||
let tc_header = PusTmSecondaryHeader::new_simple(service, subservice, &self.cds_short_buf);
|
||||
PusTmCreator::new(&mut reply_header, tc_header, source_data, true)
|
||||
PusTmCreator::new(reply_header, tc_header, source_data, true)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user