start moving to CCSDS + serde

This commit is contained in:
2025-11-17 11:13:49 +01:00
parent b2bc87641c
commit fef8d6a792
11 changed files with 24 additions and 15 deletions

View File

@@ -26,16 +26,9 @@ bitbybit = "1.4"
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
serde_json = "1" serde_json = "1"
[dependencies.satrs] satrs = { path = "../satrs", features = ["test_util"] }
path = "../satrs" satrs-minisim = { path = "../satrs-minisim" }
features = ["test_util"] satrs-mib = { path = "../satrs-mib" }
[dependencies.satrs-minisim]
path = "../satrs-minisim"
[dependencies.satrs-mib]
version = "0.1.1"
path = "../satrs-mib"
[features] [features]
default = ["heap_tmtc"] default = ["heap_tmtc"]

View File

@@ -39,6 +39,7 @@ pub fn create_verification_reporter(owner_id: ComponentId, apid: Apid) -> Verifi
VerificationReporter::new(owner_id, &verif_cfg) VerificationReporter::new(owner_id, &verif_cfg)
} }
/*
/// Simple router structure which forwards PUS telecommands to dedicated handlers. /// Simple router structure which forwards PUS telecommands to dedicated handlers.
pub struct PusTcMpscRouter { pub struct PusTcMpscRouter {
pub test_tc_sender: mpsc::SyncSender<EcssTcAndToken>, pub test_tc_sender: mpsc::SyncSender<EcssTcAndToken>,
@@ -187,6 +188,7 @@ impl PusTcDistributor {
Ok(HandlingStatus::HandledOne) Ok(HandlingStatus::HandledOne)
} }
} }
*/
pub trait TargetedPusService { pub trait TargetedPusService {
const SERVICE_ID: u8; const SERVICE_ID: u8;

View File

@@ -18,6 +18,7 @@ use interface::{
}; };
use log::info; use log::info;
use logger::setup_logger; use logger::setup_logger;
/*
use pus::{ use pus::{
action::create_action_service, action::create_action_service,
event::create_event_service, event::create_event_service,
@@ -28,6 +29,7 @@ use pus::{
test::create_test_service, test::create_test_service,
PusTcDistributor, PusTcMpscRouter, PusTcDistributor, PusTcMpscRouter,
}; };
*/
use requests::GenericRequestRouter; use requests::GenericRequestRouter;
use satrs::{ use satrs::{
hal::std::{tcp_server::ServerConfig, udp_server::UdpTcServer}, hal::std::{tcp_server::ServerConfig, udp_server::UdpTcServer},
@@ -78,7 +80,7 @@ mod events;
mod hk; mod hk;
mod interface; mod interface;
mod logger; mod logger;
mod pus; //mod pus;
mod requests; mod requests;
mod spi; mod spi;
mod tmtc; mod tmtc;
@@ -177,6 +179,7 @@ fn main() {
let tc_releaser = TcReleaser::Heap(tc_source_tx.clone()); let tc_releaser = TcReleaser::Heap(tc_source_tx.clone());
} }
} }
/*
let pus_router = PusTcMpscRouter { let pus_router = PusTcMpscRouter {
test_tc_sender: pus_test_tx, test_tc_sender: pus_test_tx,
event_tc_sender: pus_event_tx, event_tc_sender: pus_event_tx,
@@ -233,6 +236,7 @@ fn main() {
pus_scheduler_service, pus_scheduler_service,
pus_mode_service, pus_mode_service,
); );
*/
cfg_if::cfg_if! { cfg_if::cfg_if! {
if #[cfg(not(feature = "heap_tmtc"))] { if #[cfg(not(feature = "heap_tmtc"))] {

View File

@@ -2,8 +2,12 @@ use satrs::{
pool::PoolProvider, pool::PoolProvider,
pus::HandlingStatus, pus::HandlingStatus,
tmtc::{PacketAsVec, PacketInPool, SharedPacketPool}, tmtc::{PacketAsVec, PacketInPool, SharedPacketPool},
ComponentId,
};
use std::{
collections::HashMap,
sync::mpsc::{self, TryRecvError},
}; };
use std::sync::mpsc::{self, TryRecvError};
use crate::pus::PusTcDistributor; use crate::pus::PusTcDistributor;
@@ -65,18 +69,24 @@ impl TcSourceTaskStatic {
} }
} }
pub type CcsdsDistributorDyn = HashMap<ComponentId, std::sync::mpsc::SyncSender<PacketAsVec>>;
pub type CcsdsDistributorStatic = HashMap<ComponentId, std::sync::mpsc::SyncSender<PacketInPool>>;
// TC source components where the heap is the backing memory of the received telecommands. // TC source components where the heap is the backing memory of the received telecommands.
pub struct TcSourceTaskDynamic { pub struct TcSourceTaskDynamic {
pub tc_receiver: mpsc::Receiver<PacketAsVec>, pub tc_receiver: mpsc::Receiver<PacketAsVec>,
pus_distributor: PusTcDistributor, ccsds_distributor: CcsdsDistributorDyn,
} }
#[allow(dead_code)] #[allow(dead_code)]
impl TcSourceTaskDynamic { impl TcSourceTaskDynamic {
pub fn new(tc_receiver: mpsc::Receiver<PacketAsVec>, pus_receiver: PusTcDistributor) -> Self { pub fn new(
tc_receiver: mpsc::Receiver<PacketAsVec>,
ccsds_distributor: CcsdsDistributorDyn,
) -> Self {
Self { Self {
tc_receiver, tc_receiver,
pus_distributor: pus_receiver, ccsds_distributor,
} }
} }