continue
This commit is contained in:
@ -20,7 +20,6 @@ pub mod verification;
|
||||
#[cfg(feature = "alloc")]
|
||||
pub use alloc_mod::*;
|
||||
|
||||
use crate::pus::verification::TcStateToken;
|
||||
use crate::SenderId;
|
||||
#[cfg(feature = "std")]
|
||||
pub use std_mod::*;
|
||||
|
@ -1,8 +1,43 @@
|
||||
use spacepackets::ecss::SerializablePusPacket;
|
||||
use spacepackets::time::cds::TimeProvider;
|
||||
use spacepackets::time::TimeWriter;
|
||||
use spacepackets::tm::{PusTm, PusTmSecondaryHeader};
|
||||
use spacepackets::SpHeader;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
pub use std_mod::*;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
pub mod std_mod {
|
||||
use crate::pool::{SharedPool, StoreAddr};
|
||||
use spacepackets::ecss::SerializablePusPacket;
|
||||
use spacepackets::tm::PusTm;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct SharedTmStore {
|
||||
pool: SharedPool,
|
||||
}
|
||||
|
||||
impl SharedTmStore {
|
||||
pub fn new(backing_pool: SharedPool) -> Self {
|
||||
Self { pool: backing_pool }
|
||||
}
|
||||
|
||||
pub fn backing_pool(&self) -> SharedPool {
|
||||
self.pool.clone()
|
||||
}
|
||||
|
||||
pub fn add_pus_tm(&mut self, pus_tm: &PusTm) -> StoreAddr {
|
||||
let mut pg = self.pool.write().expect("error locking TM store");
|
||||
let (addr, buf) = pg.free_element(pus_tm.len_packed()).expect("Store error");
|
||||
pus_tm
|
||||
.write_to_bytes(buf)
|
||||
.expect("writing PUS TM to store failed");
|
||||
addr
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct PusTmWithCdsShortHelper {
|
||||
apid: u16,
|
||||
cds_short_buf: [u8; 7],
|
||||
|
Reference in New Issue
Block a user