Compare commits
1 Commits
satrs-core
...
1a4102ac6d
Author | SHA1 | Date | |
---|---|---|---|
1a4102ac6d |
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "satrs-core"
|
name = "satrs-core"
|
||||||
version = "0.1.0-alpha.3"
|
version = "0.1.0-alpha.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.61"
|
rust-version = "1.61"
|
||||||
authors = ["Robin Mueller <muellerr@irs.uni-stuttgart.de>"]
|
authors = ["Robin Mueller <muellerr@irs.uni-stuttgart.de>"]
|
||||||
|
@@ -1,12 +1,5 @@
|
|||||||
//! # Pool implementation providing memory pools for packet storage.
|
//! # Pool implementation providing memory pools for packet storage.
|
||||||
//!
|
//!
|
||||||
//! This module provides generic abstractions for memory pools which provide a storage
|
|
||||||
//! machanism for variable sized data like Telemetry and Telecommand (TMTC) packets. The core
|
|
||||||
//! abstraction for this is the [PoolProvider] trait.
|
|
||||||
//!
|
|
||||||
//! It also contains the [StaticMemoryPool] as a concrete implementation which can be used to avoid
|
|
||||||
//! dynamic run-time allocations for the storage of TMTC packets.
|
|
||||||
//!
|
|
||||||
//! # Example for the [StaticMemoryPool]
|
//! # Example for the [StaticMemoryPool]
|
||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
@@ -380,8 +373,8 @@ mod alloc_mod {
|
|||||||
/// the number of memory blocks in the subpool, the second entry the size of the blocks
|
/// the number of memory blocks in the subpool, the second entry the size of the blocks
|
||||||
/// * `spill_to_higher_subpools` - Specifies whether data will be spilled to higher subpools
|
/// * `spill_to_higher_subpools` - Specifies whether data will be spilled to higher subpools
|
||||||
/// if the next fitting subpool is full. This is useful to ensure the pool remains useful
|
/// if the next fitting subpool is full. This is useful to ensure the pool remains useful
|
||||||
/// for all data sizes as long as possible. However, an undesirable side-effect might be
|
/// for all data sizes as long as possible, but it might also lead to frequently used
|
||||||
/// the chocking of larger subpools by underdimensioned smaller subpools.
|
/// subpools which were not dimensioned properly chocking larger subpools.
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct StaticPoolConfig {
|
pub struct StaticPoolConfig {
|
||||||
cfg: Vec<(NumBlocks, usize)>,
|
cfg: Vec<(NumBlocks, usize)>,
|
||||||
|
@@ -238,8 +238,7 @@ impl Error for ScheduleError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Generic trait for scheduler objects which are able to schedule ECSS PUS C packets.
|
pub trait PusSchedulerInterface {
|
||||||
pub trait PusSchedulerProvider {
|
|
||||||
type TimeProvider: CcsdsTimeProvider + TimeReader;
|
type TimeProvider: CcsdsTimeProvider + TimeReader;
|
||||||
|
|
||||||
fn reset(&mut self, store: &mut (impl PoolProvider + ?Sized)) -> Result<(), StoreError>;
|
fn reset(&mut self, store: &mut (impl PoolProvider + ?Sized)) -> Result<(), StoreError>;
|
||||||
@@ -783,7 +782,7 @@ pub mod alloc_mod {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PusSchedulerProvider for PusScheduler {
|
impl PusSchedulerInterface for PusScheduler {
|
||||||
type TimeProvider = cds::TimeProvider;
|
type TimeProvider = cds::TimeProvider;
|
||||||
|
|
||||||
/// This will disable the scheduler and clear the schedule as specified in 6.11.4.4.
|
/// This will disable the scheduler and clear the schedule as specified in 6.11.4.4.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
use super::scheduler::PusSchedulerProvider;
|
use super::scheduler::PusSchedulerInterface;
|
||||||
use super::{EcssTcInMemConverter, PusServiceBase, PusServiceHelper};
|
use super::{EcssTcInMemConverter, PusServiceBase, PusServiceHelper};
|
||||||
use crate::pool::PoolProvider;
|
use crate::pool::PoolProvider;
|
||||||
use crate::pus::{PusPacketHandlerResult, PusPacketHandlingError};
|
use crate::pus::{PusPacketHandlerResult, PusPacketHandlingError};
|
||||||
@@ -16,13 +16,13 @@ use spacepackets::time::cds::TimeProvider;
|
|||||||
/// telecommands when applicable.
|
/// telecommands when applicable.
|
||||||
pub struct PusService11SchedHandler<
|
pub struct PusService11SchedHandler<
|
||||||
TcInMemConverter: EcssTcInMemConverter,
|
TcInMemConverter: EcssTcInMemConverter,
|
||||||
PusScheduler: PusSchedulerProvider,
|
Scheduler: PusSchedulerInterface,
|
||||||
> {
|
> {
|
||||||
pub service_helper: PusServiceHelper<TcInMemConverter>,
|
pub service_helper: PusServiceHelper<TcInMemConverter>,
|
||||||
scheduler: PusScheduler,
|
scheduler: Scheduler,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<TcInMemConverter: EcssTcInMemConverter, Scheduler: PusSchedulerProvider>
|
impl<TcInMemConverter: EcssTcInMemConverter, Scheduler: PusSchedulerInterface>
|
||||||
PusService11SchedHandler<TcInMemConverter, Scheduler>
|
PusService11SchedHandler<TcInMemConverter, Scheduler>
|
||||||
{
|
{
|
||||||
pub fn new(service_helper: PusServiceHelper<TcInMemConverter>, scheduler: Scheduler) -> Self {
|
pub fn new(service_helper: PusServiceHelper<TcInMemConverter>, scheduler: Scheduler) -> Self {
|
||||||
@@ -173,7 +173,7 @@ mod tests {
|
|||||||
use crate::pool::{StaticMemoryPool, StaticPoolConfig};
|
use crate::pool::{StaticMemoryPool, StaticPoolConfig};
|
||||||
use crate::pus::tests::TEST_APID;
|
use crate::pus::tests::TEST_APID;
|
||||||
use crate::pus::{
|
use crate::pus::{
|
||||||
scheduler::{self, PusSchedulerProvider, TcInfo},
|
scheduler::{self, PusSchedulerInterface, TcInfo},
|
||||||
tests::{PusServiceHandlerWithSharedStoreCommon, PusTestHarness},
|
tests::{PusServiceHandlerWithSharedStoreCommon, PusTestHarness},
|
||||||
verification::{RequestId, TcStateAccepted, VerificationToken},
|
verification::{RequestId, TcStateAccepted, VerificationToken},
|
||||||
EcssTcInSharedStoreConverter,
|
EcssTcInSharedStoreConverter,
|
||||||
@@ -232,7 +232,7 @@ mod tests {
|
|||||||
inserted_tcs: VecDeque<TcInfo>,
|
inserted_tcs: VecDeque<TcInfo>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PusSchedulerProvider for TestScheduler {
|
impl PusSchedulerInterface for TestScheduler {
|
||||||
type TimeProvider = cds::TimeProvider;
|
type TimeProvider = cds::TimeProvider;
|
||||||
|
|
||||||
fn reset(
|
fn reset(
|
||||||
|
@@ -23,8 +23,8 @@ version = "1"
|
|||||||
optional = true
|
optional = true
|
||||||
|
|
||||||
[dependencies.satrs-core]
|
[dependencies.satrs-core]
|
||||||
path = "../satrs-core"
|
# path = "../satrs-core"
|
||||||
# version = "0.1.0-alpha.1"
|
version = "0.1.0-alpha.2"
|
||||||
# git = "https://egit.irs.uni-stuttgart.de/rust/sat-rs.git"
|
# git = "https://egit.irs.uni-stuttgart.de/rust/sat-rs.git"
|
||||||
# branch = "main"
|
# branch = "main"
|
||||||
# rev = "35e1f7a983f6535c5571186e361fe101d4306b89"
|
# rev = "35e1f7a983f6535c5571186e361fe101d4306b89"
|
||||||
|
@@ -20,8 +20,8 @@ quote = "1"
|
|||||||
proc-macro2 = "1"
|
proc-macro2 = "1"
|
||||||
|
|
||||||
[dependencies.satrs-core]
|
[dependencies.satrs-core]
|
||||||
path = "../../satrs-core"
|
# path = "../../satrs-core"
|
||||||
# version = "0.1.0-alpha.1"
|
version = "0.1.0-alpha.2"
|
||||||
# git = "https://egit.irs.uni-stuttgart.de/rust/sat-rs.git"
|
# git = "https://egit.irs.uni-stuttgart.de/rust/sat-rs.git"
|
||||||
# branch = "main"
|
# branch = "main"
|
||||||
# rev = "35e1f7a983f6535c5571186e361fe101d4306b89"
|
# rev = "35e1f7a983f6535c5571186e361fe101d4306b89"
|
||||||
|
Reference in New Issue
Block a user