From 377ffc052cacd74af3aa9b6a7e2f6ccb872ebd3d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 12 Feb 2024 12:43:17 +0100 Subject: [PATCH 1/3] bump release --- satrs-core/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/satrs-core/Cargo.toml b/satrs-core/Cargo.toml index 19f3044..0c32388 100644 --- a/satrs-core/Cargo.toml +++ b/satrs-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "satrs-core" -version = "0.1.0-alpha.2" +version = "0.1.0-alpha.3" edition = "2021" rust-version = "1.61" authors = ["Robin Mueller "] From 79d095b1f7bbe02400dfbf3087d5b06a0f42ad95 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 12 Feb 2024 12:48:28 +0100 Subject: [PATCH 2/3] some doc improvements --- satrs-core/src/pool.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/satrs-core/src/pool.rs b/satrs-core/src/pool.rs index fb59065..5e7cb55 100644 --- a/satrs-core/src/pool.rs +++ b/satrs-core/src/pool.rs @@ -1,5 +1,12 @@ //! # 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] //! //! ``` @@ -373,8 +380,8 @@ mod alloc_mod { /// 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 /// if the next fitting subpool is full. This is useful to ensure the pool remains useful - /// for all data sizes as long as possible, but it might also lead to frequently used - /// subpools which were not dimensioned properly chocking larger subpools. + /// for all data sizes as long as possible. However, an undesirable side-effect might be + /// the chocking of larger subpools by underdimensioned smaller subpools. #[derive(Clone)] pub struct StaticPoolConfig { cfg: Vec<(NumBlocks, usize)>, From 2dd38c163f2581d5e2f8aa6d9bc4d76b2f2a238f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 12 Feb 2024 12:54:25 +0100 Subject: [PATCH 3/3] better name for new trait --- satrs-core/src/pus/scheduler.rs | 5 +++-- satrs-core/src/pus/scheduler_srv.rs | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/satrs-core/src/pus/scheduler.rs b/satrs-core/src/pus/scheduler.rs index a2ce7fe..e55028c 100644 --- a/satrs-core/src/pus/scheduler.rs +++ b/satrs-core/src/pus/scheduler.rs @@ -238,7 +238,8 @@ impl Error for ScheduleError { } } -pub trait PusSchedulerInterface { +/// Generic trait for scheduler objects which are able to schedule ECSS PUS C packets. +pub trait PusSchedulerProvider { type TimeProvider: CcsdsTimeProvider + TimeReader; fn reset(&mut self, store: &mut (impl PoolProvider + ?Sized)) -> Result<(), StoreError>; @@ -782,7 +783,7 @@ pub mod alloc_mod { } } - impl PusSchedulerInterface for PusScheduler { + impl PusSchedulerProvider for PusScheduler { type TimeProvider = cds::TimeProvider; /// This will disable the scheduler and clear the schedule as specified in 6.11.4.4. diff --git a/satrs-core/src/pus/scheduler_srv.rs b/satrs-core/src/pus/scheduler_srv.rs index 18f1b58..8976143 100644 --- a/satrs-core/src/pus/scheduler_srv.rs +++ b/satrs-core/src/pus/scheduler_srv.rs @@ -1,4 +1,4 @@ -use super::scheduler::PusSchedulerInterface; +use super::scheduler::PusSchedulerProvider; use super::{EcssTcInMemConverter, PusServiceBase, PusServiceHelper}; use crate::pool::PoolProvider; use crate::pus::{PusPacketHandlerResult, PusPacketHandlingError}; @@ -16,13 +16,13 @@ use spacepackets::time::cds::TimeProvider; /// telecommands when applicable. pub struct PusService11SchedHandler< TcInMemConverter: EcssTcInMemConverter, - Scheduler: PusSchedulerInterface, + PusScheduler: PusSchedulerProvider, > { pub service_helper: PusServiceHelper, - scheduler: Scheduler, + scheduler: PusScheduler, } -impl +impl PusService11SchedHandler { pub fn new(service_helper: PusServiceHelper, scheduler: Scheduler) -> Self { @@ -173,7 +173,7 @@ mod tests { use crate::pool::{StaticMemoryPool, StaticPoolConfig}; use crate::pus::tests::TEST_APID; use crate::pus::{ - scheduler::{self, PusSchedulerInterface, TcInfo}, + scheduler::{self, PusSchedulerProvider, TcInfo}, tests::{PusServiceHandlerWithSharedStoreCommon, PusTestHarness}, verification::{RequestId, TcStateAccepted, VerificationToken}, EcssTcInSharedStoreConverter, @@ -232,7 +232,7 @@ mod tests { inserted_tcs: VecDeque, } - impl PusSchedulerInterface for TestScheduler { + impl PusSchedulerProvider for TestScheduler { type TimeProvider = cds::TimeProvider; fn reset(