From 3ea3a7acb657990ee807f7db635137c9989e553c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 12 Feb 2024 14:27:22 +0100 Subject: [PATCH] restructure the crate - Add new shared subcrate satrs-shared to split off some shared components not expected to change very often. - Renmame `satrs-core` to `satrs`. It is expected that sat-rs will remain the primary crate, so the core information is superfluous, and core also implies stability, which will not be the case for some time. --- Cargo.toml | 3 ++- satrs-example/Cargo.toml | 10 ++++---- satrs-example/src/acs.rs | 8 +++---- satrs-example/src/bin/simpleclient.rs | 8 +++---- satrs-example/src/ccsds.rs | 6 ++--- satrs-example/src/config.rs | 4 ++-- satrs-example/src/events.rs | 2 +- satrs-example/src/hk.rs | 2 +- satrs-example/src/lib.rs | 8 +++---- satrs-example/src/main.rs | 18 +++++++------- satrs-example/src/pus/action.rs | 14 +++++------ satrs-example/src/pus/event.rs | 14 +++++------ satrs-example/src/pus/hk.rs | 14 +++++------ satrs-example/src/pus/mod.rs | 12 +++++----- satrs-example/src/pus/scheduler.rs | 14 +++++------ satrs-example/src/pus/stack.rs | 2 +- satrs-example/src/pus/test.rs | 24 +++++++++---------- satrs-example/src/requests.rs | 6 ++--- satrs-example/src/tcp.rs | 2 +- satrs-example/src/tm_funnel.rs | 2 +- satrs-example/src/tmtc.rs | 16 ++++++------- satrs-example/src/udp.rs | 4 ++-- satrs-mib/Cargo.toml | 8 +++++-- satrs-mib/codegen/Cargo.toml | 20 +++++++++------- satrs-mib/codegen/tests/basic.rs | 2 +- satrs-mib/codegen/tests/basic_with_info.rs | 2 +- satrs-mib/codegen/tests/verify_gen_struct.rs | 2 +- satrs-mib/src/res_code.rs | 10 ++++---- satrs-shared/Cargo.toml | 21 ++++++++++++++++ satrs-shared/src/lib.rs | 1 + {satrs-core => satrs-shared}/src/res_code.rs | 0 {satrs-core => satrs}/.gitignore | 0 {satrs-core => satrs}/CHANGELOG.md | 0 {satrs-core => satrs}/Cargo.toml | 9 ++++--- {satrs-core => satrs}/LICENSE-APACHE | 0 {satrs-core => satrs}/NOTICE | 0 {satrs-core => satrs}/README.md | 0 {satrs-core => satrs}/release-checklist.md | 0 {satrs-core => satrs}/src/cfdp/dest.rs | 0 {satrs-core => satrs}/src/cfdp/filestore.rs | 0 {satrs-core => satrs}/src/cfdp/mod.rs | 0 {satrs-core => satrs}/src/cfdp/source.rs | 0 {satrs-core => satrs}/src/cfdp/user.rs | 0 {satrs-core => satrs}/src/device.rs | 0 {satrs-core => satrs}/src/encoding/ccsds.rs | 0 {satrs-core => satrs}/src/encoding/cobs.rs | 2 +- {satrs-core => satrs}/src/encoding/mod.rs | 0 {satrs-core => satrs}/src/event_man.rs | 0 {satrs-core => satrs}/src/events.rs | 2 +- {satrs-core => satrs}/src/executable.rs | 0 {satrs-core => satrs}/src/hal/mod.rs | 0 {satrs-core => satrs}/src/hal/std/mod.rs | 0 .../src/hal/std/tcp_cobs_server.rs | 0 .../src/hal/std/tcp_server.rs | 0 .../src/hal/std/tcp_spacepackets_server.rs | 0 .../src/hal/std/udp_server.rs | 4 ++-- {satrs-core => satrs}/src/hk.rs | 0 {satrs-core => satrs}/src/lib.rs | 0 {satrs-core => satrs}/src/mode.rs | 0 {satrs-core => satrs}/src/objects.rs | 2 +- {satrs-core => satrs}/src/params.rs | 2 +- {satrs-core => satrs}/src/pool.rs | 2 +- {satrs-core => satrs}/src/power.rs | 0 {satrs-core => satrs}/src/pus/event.rs | 0 {satrs-core => satrs}/src/pus/event_man.rs | 0 {satrs-core => satrs}/src/pus/event_srv.rs | 0 {satrs-core => satrs}/src/pus/hk.rs | 0 {satrs-core => satrs}/src/pus/mod.rs | 0 {satrs-core => satrs}/src/pus/mode.rs | 0 {satrs-core => satrs}/src/pus/scheduler.rs | 0 .../src/pus/scheduler_srv.rs | 0 {satrs-core => satrs}/src/pus/test.rs | 0 {satrs-core => satrs}/src/pus/verification.rs | 10 ++++---- {satrs-core => satrs}/src/request.rs | 0 satrs/src/res_code.rs | 1 + {satrs-core => satrs}/src/seq_count.rs | 0 .../src/tmtc/ccsds_distrib.rs | 4 ++-- {satrs-core => satrs}/src/tmtc/mod.rs | 0 {satrs-core => satrs}/src/tmtc/pus_distrib.rs | 4 ++-- {satrs-core => satrs}/src/tmtc/tm_helper.rs | 0 {satrs-core => satrs}/tests/hk_helpers.rs | 0 {satrs-core => satrs}/tests/pools.rs | 2 +- .../tests/pus_autogen_events.rs | 2 +- {satrs-core => satrs}/tests/pus_events.rs | 14 +++++------ .../tests/pus_verification.rs | 10 ++++---- {satrs-core => satrs}/tests/tcp_servers.rs | 2 +- 86 files changed, 180 insertions(+), 151 deletions(-) create mode 100644 satrs-shared/Cargo.toml create mode 100644 satrs-shared/src/lib.rs rename {satrs-core => satrs-shared}/src/res_code.rs (100%) rename {satrs-core => satrs}/.gitignore (100%) rename {satrs-core => satrs}/CHANGELOG.md (100%) rename {satrs-core => satrs}/Cargo.toml (93%) rename {satrs-core => satrs}/LICENSE-APACHE (100%) rename {satrs-core => satrs}/NOTICE (100%) rename {satrs-core => satrs}/README.md (100%) rename {satrs-core => satrs}/release-checklist.md (100%) rename {satrs-core => satrs}/src/cfdp/dest.rs (100%) rename {satrs-core => satrs}/src/cfdp/filestore.rs (100%) rename {satrs-core => satrs}/src/cfdp/mod.rs (100%) rename {satrs-core => satrs}/src/cfdp/source.rs (100%) rename {satrs-core => satrs}/src/cfdp/user.rs (100%) rename {satrs-core => satrs}/src/device.rs (100%) rename {satrs-core => satrs}/src/encoding/ccsds.rs (100%) rename {satrs-core => satrs}/src/encoding/cobs.rs (99%) rename {satrs-core => satrs}/src/encoding/mod.rs (100%) rename {satrs-core => satrs}/src/event_man.rs (100%) rename {satrs-core => satrs}/src/events.rs (99%) rename {satrs-core => satrs}/src/executable.rs (100%) rename {satrs-core => satrs}/src/hal/mod.rs (100%) rename {satrs-core => satrs}/src/hal/std/mod.rs (100%) rename {satrs-core => satrs}/src/hal/std/tcp_cobs_server.rs (100%) rename {satrs-core => satrs}/src/hal/std/tcp_server.rs (100%) rename {satrs-core => satrs}/src/hal/std/tcp_spacepackets_server.rs (100%) rename {satrs-core => satrs}/src/hal/std/udp_server.rs (98%) rename {satrs-core => satrs}/src/hk.rs (100%) rename {satrs-core => satrs}/src/lib.rs (100%) rename {satrs-core => satrs}/src/mode.rs (100%) rename {satrs-core => satrs}/src/objects.rs (99%) rename {satrs-core => satrs}/src/params.rs (99%) rename {satrs-core => satrs}/src/pool.rs (99%) rename {satrs-core => satrs}/src/power.rs (100%) rename {satrs-core => satrs}/src/pus/event.rs (100%) rename {satrs-core => satrs}/src/pus/event_man.rs (100%) rename {satrs-core => satrs}/src/pus/event_srv.rs (100%) rename {satrs-core => satrs}/src/pus/hk.rs (100%) rename {satrs-core => satrs}/src/pus/mod.rs (100%) rename {satrs-core => satrs}/src/pus/mode.rs (100%) rename {satrs-core => satrs}/src/pus/scheduler.rs (100%) rename {satrs-core => satrs}/src/pus/scheduler_srv.rs (100%) rename {satrs-core => satrs}/src/pus/test.rs (100%) rename {satrs-core => satrs}/src/pus/verification.rs (99%) rename {satrs-core => satrs}/src/request.rs (100%) create mode 100644 satrs/src/res_code.rs rename {satrs-core => satrs}/src/seq_count.rs (100%) rename {satrs-core => satrs}/src/tmtc/ccsds_distrib.rs (99%) rename {satrs-core => satrs}/src/tmtc/mod.rs (100%) rename {satrs-core => satrs}/src/tmtc/pus_distrib.rs (98%) rename {satrs-core => satrs}/src/tmtc/tm_helper.rs (100%) rename {satrs-core => satrs}/tests/hk_helpers.rs (100%) rename {satrs-core => satrs}/tests/pools.rs (93%) rename {satrs-core => satrs}/tests/pus_autogen_events.rs (99%) rename {satrs-core => satrs}/tests/pus_events.rs (94%) rename {satrs-core => satrs}/tests/pus_verification.rs (97%) rename {satrs-core => satrs}/tests/tcp_servers.rs (99%) diff --git a/Cargo.toml b/Cargo.toml index eaeb356..6cd72ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,10 @@ [workspace] resolver = "2" members = [ - "satrs-core", + "satrs", "satrs-mib", "satrs-example", + "satrs-shared", ] exclude = [ diff --git a/satrs-example/Cargo.toml b/satrs-example/Cargo.toml index 2b291cc..d7c2298 100644 --- a/satrs-example/Cargo.toml +++ b/satrs-example/Cargo.toml @@ -19,13 +19,13 @@ num_enum = "0.7" thiserror = "1" derive-new = "0.5" -[dependencies.satrs-core] -version = "0.1.0-alpha.3" -# path = "../satrs-core" +[dependencies.satrs] +# version = "0.1.0-alpha.3" +path = "../satrs" [dependencies.satrs-mib] -version = "0.1.0-alpha.2" -# path = "../satrs-mib" +# version = "0.1.0-alpha.2" +path = "../satrs-mib" [features] dyn_tmtc = [] diff --git a/satrs-example/src/acs.rs b/satrs-example/src/acs.rs index 9b4b3ee..dc7763b 100644 --- a/satrs-example/src/acs.rs +++ b/satrs-example/src/acs.rs @@ -1,10 +1,10 @@ use std::sync::mpsc::{self, TryRecvError}; use log::{info, warn}; -use satrs_core::pus::verification::VerificationReporterWithSender; -use satrs_core::pus::{EcssTmSender, PusTmWrapper}; -use satrs_core::spacepackets::ecss::hk::Subservice as HkSubservice; -use satrs_core::{ +use satrs::pus::verification::VerificationReporterWithSender; +use satrs::pus::{EcssTmSender, PusTmWrapper}; +use satrs::spacepackets::ecss::hk::Subservice as HkSubservice; +use satrs::{ hk::HkRequest, spacepackets::{ ecss::tm::{PusTmCreator, PusTmSecondaryHeader}, diff --git a/satrs-example/src/bin/simpleclient.rs b/satrs-example/src/bin/simpleclient.rs index c64aa04..04281ca 100644 --- a/satrs-example/src/bin/simpleclient.rs +++ b/satrs-example/src/bin/simpleclient.rs @@ -1,7 +1,7 @@ -use satrs_core::pus::verification::RequestId; -use satrs_core::spacepackets::ecss::tc::PusTcCreator; -use satrs_core::spacepackets::ecss::tm::PusTmReader; -use satrs_core::{ +use satrs::pus::verification::RequestId; +use satrs::spacepackets::ecss::tc::PusTcCreator; +use satrs::spacepackets::ecss::tm::PusTmReader; +use satrs::{ spacepackets::ecss::{PusPacket, WritablePusPacket}, spacepackets::SpHeader, }; diff --git a/satrs-example/src/ccsds.rs b/satrs-example/src/ccsds.rs index 0706912..e61172e 100644 --- a/satrs-example/src/ccsds.rs +++ b/satrs-example/src/ccsds.rs @@ -1,6 +1,6 @@ -use satrs_core::pus::ReceivesEcssPusTc; -use satrs_core::spacepackets::{CcsdsPacket, SpHeader}; -use satrs_core::tmtc::{CcsdsPacketHandler, ReceivesCcsdsTc}; +use satrs::pus::ReceivesEcssPusTc; +use satrs::spacepackets::{CcsdsPacket, SpHeader}; +use satrs::tmtc::{CcsdsPacketHandler, ReceivesCcsdsTc}; use satrs_example::config::PUS_APID; #[derive(Clone)] diff --git a/satrs-example/src/config.rs b/satrs-example/src/config.rs index bf47691..c442665 100644 --- a/satrs-example/src/config.rs +++ b/satrs-example/src/config.rs @@ -1,10 +1,10 @@ -use satrs_core::res_code::ResultU16; +use satrs::res_code::ResultU16; use satrs_mib::res_code::ResultU16Info; use satrs_mib::resultcode; use std::net::Ipv4Addr; use num_enum::{IntoPrimitive, TryFromPrimitive}; -use satrs_core::{ +use satrs::{ events::{EventU32TypedSev, SeverityInfo}, pool::{StaticMemoryPool, StaticPoolConfig}, }; diff --git a/satrs-example/src/events.rs b/satrs-example/src/events.rs index aa2369b..81f7d1e 100644 --- a/satrs-example/src/events.rs +++ b/satrs-example/src/events.rs @@ -1,6 +1,6 @@ use std::sync::mpsc::{self, SendError}; -use satrs_core::{ +use satrs::{ event_man::{ EventManager, EventManagerWithMpscQueue, MpscEventReceiver, MpscEventU32SendProvider, SendEventProvider, diff --git a/satrs-example/src/hk.rs b/satrs-example/src/hk.rs index deae635..3147cbf 100644 --- a/satrs-example/src/hk.rs +++ b/satrs-example/src/hk.rs @@ -1,5 +1,5 @@ use derive_new::new; -use satrs_core::spacepackets::ByteConversionError; +use satrs::spacepackets::ByteConversionError; #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum AcsHkIds { diff --git a/satrs-example/src/lib.rs b/satrs-example/src/lib.rs index 97157f4..dac8ab0 100644 --- a/satrs-example/src/lib.rs +++ b/satrs-example/src/lib.rs @@ -1,8 +1,8 @@ use derive_new::new; -use satrs_core::spacepackets::ecss::tc::IsPusTelecommand; -use satrs_core::spacepackets::ecss::PusPacket; -use satrs_core::spacepackets::{ByteConversionError, CcsdsPacket}; -use satrs_core::tmtc::TargetId; +use satrs::spacepackets::ecss::tc::IsPusTelecommand; +use satrs::spacepackets::ecss::PusPacket; +use satrs::spacepackets::{ByteConversionError, CcsdsPacket}; +use satrs::tmtc::TargetId; use std::fmt; use thiserror::Error; diff --git a/satrs-example/src/main.rs b/satrs-example/src/main.rs index 71774ce..32dbfcb 100644 --- a/satrs-example/src/main.rs +++ b/satrs-example/src/main.rs @@ -15,9 +15,9 @@ use crate::pus::stack::PusStack; use crate::tm_funnel::{TmFunnelDynamic, TmFunnelStatic}; use log::info; use pus::test::create_test_service_dynamic; -use satrs_core::hal::std::tcp_server::ServerConfig; -use satrs_core::hal::std::udp_server::UdpTcServer; -use satrs_core::tmtc::tm_helper::SharedTmPool; +use satrs::hal::std::tcp_server::ServerConfig; +use satrs::hal::std::udp_server::UdpTcServer; +use satrs::tmtc::tm_helper::SharedTmPool; use satrs_example::config::pool::{create_sched_tc_pool, create_static_pools}; use satrs_example::config::tasks::{ FREQ_MS_AOCS, FREQ_MS_EVENT_HANDLING, FREQ_MS_PUS_STACK, FREQ_MS_UDP_TMTC, @@ -41,12 +41,12 @@ use crate::tmtc::{ PusTcSourceProviderSharedPool, SharedTcPool, TcSourceTaskDynamic, TcSourceTaskStatic, }; use crate::udp::{StaticUdpTmHandler, UdpTmtcServer}; -use satrs_core::pus::event_man::EventRequestWithToken; -use satrs_core::pus::verification::{VerificationReporterCfg, VerificationReporterWithSender}; -use satrs_core::pus::{EcssTmSender, MpscTmAsVecSender, MpscTmInSharedPoolSender}; -use satrs_core::spacepackets::{time::cds::TimeProvider, time::TimeWriter}; -use satrs_core::tmtc::{CcsdsDistributor, TargetId}; -use satrs_core::ChannelId; +use satrs::pus::event_man::EventRequestWithToken; +use satrs::pus::verification::{VerificationReporterCfg, VerificationReporterWithSender}; +use satrs::pus::{EcssTmSender, MpscTmAsVecSender, MpscTmInSharedPoolSender}; +use satrs::spacepackets::{time::cds::TimeProvider, time::TimeWriter}; +use satrs::tmtc::{CcsdsDistributor, TargetId}; +use satrs::ChannelId; use satrs_example::TargetIdWithApid; use std::collections::HashMap; use std::net::{IpAddr, SocketAddr}; diff --git a/satrs-example/src/pus/action.rs b/satrs-example/src/pus/action.rs index 7c59723..a791506 100644 --- a/satrs-example/src/pus/action.rs +++ b/satrs-example/src/pus/action.rs @@ -1,18 +1,18 @@ use crate::requests::{ActionRequest, Request, RequestWithToken}; use log::{error, warn}; -use satrs_core::pool::{SharedStaticMemoryPool, StoreAddr}; -use satrs_core::pus::verification::{ +use satrs::pool::{SharedStaticMemoryPool, StoreAddr}; +use satrs::pus::verification::{ FailParams, TcStateAccepted, VerificationReporterWithSender, VerificationToken, }; -use satrs_core::pus::{ +use satrs::pus::{ EcssTcAndToken, EcssTcInMemConverter, EcssTcInSharedStoreConverter, EcssTcInVecConverter, EcssTcReceiver, EcssTmSender, MpscTcReceiver, MpscTmAsVecSender, MpscTmInSharedPoolSender, PusPacketHandlerResult, PusPacketHandlingError, PusServiceBase, PusServiceHelper, }; -use satrs_core::spacepackets::ecss::tc::PusTcReader; -use satrs_core::spacepackets::ecss::PusPacket; -use satrs_core::tmtc::tm_helper::SharedTmPool; -use satrs_core::ChannelId; +use satrs::spacepackets::ecss::tc::PusTcReader; +use satrs::spacepackets::ecss::PusPacket; +use satrs::tmtc::tm_helper::SharedTmPool; +use satrs::ChannelId; use satrs_example::config::{tmtc_err, TcReceiverId, TmSenderId, PUS_APID}; use satrs_example::TargetIdWithApid; use std::collections::HashMap; diff --git a/satrs-example/src/pus/event.rs b/satrs-example/src/pus/event.rs index fbbe942..0355d9c 100644 --- a/satrs-example/src/pus/event.rs +++ b/satrs-example/src/pus/event.rs @@ -1,17 +1,17 @@ use std::sync::mpsc; use log::{error, warn}; -use satrs_core::pool::{SharedStaticMemoryPool, StoreAddr}; -use satrs_core::pus::event_man::EventRequestWithToken; -use satrs_core::pus::event_srv::PusService5EventHandler; -use satrs_core::pus::verification::VerificationReporterWithSender; -use satrs_core::pus::{ +use satrs::pool::{SharedStaticMemoryPool, StoreAddr}; +use satrs::pus::event_man::EventRequestWithToken; +use satrs::pus::event_srv::PusService5EventHandler; +use satrs::pus::verification::VerificationReporterWithSender; +use satrs::pus::{ EcssTcAndToken, EcssTcInMemConverter, EcssTcInSharedStoreConverter, EcssTcInVecConverter, MpscTcReceiver, MpscTmAsVecSender, MpscTmInSharedPoolSender, PusPacketHandlerResult, PusServiceHelper, }; -use satrs_core::tmtc::tm_helper::SharedTmPool; -use satrs_core::ChannelId; +use satrs::tmtc::tm_helper::SharedTmPool; +use satrs::ChannelId; use satrs_example::config::{TcReceiverId, TmSenderId, PUS_APID}; pub fn create_event_service_static( diff --git a/satrs-example/src/pus/hk.rs b/satrs-example/src/pus/hk.rs index 5a27e9f..41c98b9 100644 --- a/satrs-example/src/pus/hk.rs +++ b/satrs-example/src/pus/hk.rs @@ -1,18 +1,18 @@ use crate::requests::{Request, RequestWithToken}; use log::{error, warn}; -use satrs_core::hk::{CollectionIntervalFactor, HkRequest}; -use satrs_core::pool::{SharedStaticMemoryPool, StoreAddr}; -use satrs_core::pus::verification::{ +use satrs::hk::{CollectionIntervalFactor, HkRequest}; +use satrs::pool::{SharedStaticMemoryPool, StoreAddr}; +use satrs::pus::verification::{ FailParams, StdVerifReporterWithSender, VerificationReporterWithSender, }; -use satrs_core::pus::{ +use satrs::pus::{ EcssTcAndToken, EcssTcInMemConverter, EcssTcInSharedStoreConverter, EcssTcInVecConverter, EcssTcReceiver, EcssTmSender, MpscTcReceiver, MpscTmAsVecSender, MpscTmInSharedPoolSender, PusPacketHandlerResult, PusPacketHandlingError, PusServiceBase, PusServiceHelper, }; -use satrs_core::spacepackets::ecss::{hk, PusPacket}; -use satrs_core::tmtc::tm_helper::SharedTmPool; -use satrs_core::ChannelId; +use satrs::spacepackets::ecss::{hk, PusPacket}; +use satrs::tmtc::tm_helper::SharedTmPool; +use satrs::ChannelId; use satrs_example::config::{hk_err, tmtc_err, TcReceiverId, TmSenderId, PUS_APID}; use satrs_example::TargetIdWithApid; use std::collections::HashMap; diff --git a/satrs-example/src/pus/mod.rs b/satrs-example/src/pus/mod.rs index 3fe3cea..ec63abe 100644 --- a/satrs-example/src/pus/mod.rs +++ b/satrs-example/src/pus/mod.rs @@ -1,11 +1,11 @@ use crate::tmtc::MpscStoreAndSendError; use log::warn; -use satrs_core::pus::verification::{FailParams, StdVerifReporterWithSender}; -use satrs_core::pus::{EcssTcAndToken, PusPacketHandlerResult, TcInMemory}; -use satrs_core::spacepackets::ecss::tc::PusTcReader; -use satrs_core::spacepackets::ecss::PusServiceId; -use satrs_core::spacepackets::time::cds::TimeProvider; -use satrs_core::spacepackets::time::TimeWriter; +use satrs::pus::verification::{FailParams, StdVerifReporterWithSender}; +use satrs::pus::{EcssTcAndToken, PusPacketHandlerResult, TcInMemory}; +use satrs::spacepackets::ecss::tc::PusTcReader; +use satrs::spacepackets::ecss::PusServiceId; +use satrs::spacepackets::time::cds::TimeProvider; +use satrs::spacepackets::time::TimeWriter; use satrs_example::config::{tmtc_err, CustomPusServiceId}; use std::sync::mpsc::Sender; diff --git a/satrs-example/src/pus/scheduler.rs b/satrs-example/src/pus/scheduler.rs index 8ffe8df..c3bc7d3 100644 --- a/satrs-example/src/pus/scheduler.rs +++ b/satrs-example/src/pus/scheduler.rs @@ -2,17 +2,17 @@ use std::sync::mpsc; use std::time::Duration; use log::{error, info, warn}; -use satrs_core::pool::{PoolProvider, StaticMemoryPool, StoreAddr}; -use satrs_core::pus::scheduler::{PusScheduler, TcInfo}; -use satrs_core::pus::scheduler_srv::PusService11SchedHandler; -use satrs_core::pus::verification::VerificationReporterWithSender; -use satrs_core::pus::{ +use satrs::pool::{PoolProvider, StaticMemoryPool, StoreAddr}; +use satrs::pus::scheduler::{PusScheduler, TcInfo}; +use satrs::pus::scheduler_srv::PusService11SchedHandler; +use satrs::pus::verification::VerificationReporterWithSender; +use satrs::pus::{ EcssTcAndToken, EcssTcInMemConverter, EcssTcInSharedStoreConverter, EcssTcInVecConverter, MpscTcReceiver, MpscTmAsVecSender, MpscTmInSharedPoolSender, PusPacketHandlerResult, PusServiceHelper, }; -use satrs_core::tmtc::tm_helper::SharedTmPool; -use satrs_core::ChannelId; +use satrs::tmtc::tm_helper::SharedTmPool; +use satrs::ChannelId; use satrs_example::config::{TcReceiverId, TmSenderId, PUS_APID}; use crate::tmtc::PusTcSourceProviderSharedPool; diff --git a/satrs-example/src/pus/stack.rs b/satrs-example/src/pus/stack.rs index 33bd5af..98718be 100644 --- a/satrs-example/src/pus/stack.rs +++ b/satrs-example/src/pus/stack.rs @@ -1,4 +1,4 @@ -use satrs_core::pus::EcssTcInMemConverter; +use satrs::pus::EcssTcInMemConverter; use super::{ action::Pus8Wrapper, event::Pus5Wrapper, hk::Pus3Wrapper, scheduler::Pus11Wrapper, diff --git a/satrs-example/src/pus/test.rs b/satrs-example/src/pus/test.rs index 1958055..45670cc 100644 --- a/satrs-example/src/pus/test.rs +++ b/satrs-example/src/pus/test.rs @@ -1,19 +1,19 @@ use log::{info, warn}; -use satrs_core::params::Params; -use satrs_core::pool::{SharedStaticMemoryPool, StoreAddr}; -use satrs_core::pus::test::PusService17TestHandler; -use satrs_core::pus::verification::{FailParams, VerificationReporterWithSender}; -use satrs_core::pus::{ +use satrs::params::Params; +use satrs::pool::{SharedStaticMemoryPool, StoreAddr}; +use satrs::pus::test::PusService17TestHandler; +use satrs::pus::verification::{FailParams, VerificationReporterWithSender}; +use satrs::pus::{ EcssTcAndToken, EcssTcInMemConverter, EcssTcInVecConverter, MpscTcReceiver, MpscTmAsVecSender, MpscTmInSharedPoolSender, PusPacketHandlerResult, PusServiceHelper, }; -use satrs_core::spacepackets::ecss::tc::PusTcReader; -use satrs_core::spacepackets::ecss::PusPacket; -use satrs_core::spacepackets::time::cds::TimeProvider; -use satrs_core::spacepackets::time::TimeWriter; -use satrs_core::tmtc::tm_helper::SharedTmPool; -use satrs_core::ChannelId; -use satrs_core::{events::EventU32, pus::EcssTcInSharedStoreConverter}; +use satrs::spacepackets::ecss::tc::PusTcReader; +use satrs::spacepackets::ecss::PusPacket; +use satrs::spacepackets::time::cds::TimeProvider; +use satrs::spacepackets::time::TimeWriter; +use satrs::tmtc::tm_helper::SharedTmPool; +use satrs::ChannelId; +use satrs::{events::EventU32, pus::EcssTcInSharedStoreConverter}; use satrs_example::config::{tmtc_err, TcReceiverId, TmSenderId, PUS_APID, TEST_EVENT}; use std::sync::mpsc::{self, Sender}; diff --git a/satrs-example/src/requests.rs b/satrs-example/src/requests.rs index 031f0f4..1d42b55 100644 --- a/satrs-example/src/requests.rs +++ b/satrs-example/src/requests.rs @@ -1,7 +1,7 @@ use derive_new::new; -use satrs_core::hk::HkRequest; -use satrs_core::mode::ModeRequest; -use satrs_core::pus::verification::{TcStateAccepted, VerificationToken}; +use satrs::hk::HkRequest; +use satrs::mode::ModeRequest; +use satrs::pus::verification::{TcStateAccepted, VerificationToken}; use satrs_example::TargetIdWithApid; #[allow(dead_code)] diff --git a/satrs-example/src/tcp.rs b/satrs-example/src/tcp.rs index b9f3052..566b445 100644 --- a/satrs-example/src/tcp.rs +++ b/satrs-example/src/tcp.rs @@ -4,7 +4,7 @@ use std::{ }; use log::{info, warn}; -use satrs_core::{ +use satrs::{ hal::std::tcp_server::{ServerConfig, TcpSpacepacketsServer}, spacepackets::PacketId, tmtc::{CcsdsDistributor, CcsdsError, TmPacketSourceCore}, diff --git a/satrs-example/src/tm_funnel.rs b/satrs-example/src/tm_funnel.rs index 5024e57..af35045 100644 --- a/satrs-example/src/tm_funnel.rs +++ b/satrs-example/src/tm_funnel.rs @@ -4,7 +4,7 @@ use std::{ }; use log::info; -use satrs_core::{ +use satrs::{ pool::{PoolProvider, StoreAddr}, seq_count::{CcsdsSimpleSeqCountProvider, SequenceCountProviderCore}, spacepackets::{ diff --git a/satrs-example/src/tmtc.rs b/satrs-example/src/tmtc.rs index 7ab891c..f615f23 100644 --- a/satrs-example/src/tmtc.rs +++ b/satrs-example/src/tmtc.rs @@ -1,14 +1,14 @@ use log::warn; -use satrs_core::pus::{EcssTcAndToken, ReceivesEcssPusTc}; -use satrs_core::spacepackets::SpHeader; +use satrs::pus::{EcssTcAndToken, ReceivesEcssPusTc}; +use satrs::spacepackets::SpHeader; use std::sync::mpsc::{self, Receiver, SendError, Sender, TryRecvError}; use thiserror::Error; use crate::pus::PusReceiver; -use satrs_core::pool::{PoolProvider, SharedStaticMemoryPool, StoreAddr, StoreError}; -use satrs_core::spacepackets::ecss::tc::PusTcReader; -use satrs_core::spacepackets::ecss::PusPacket; -use satrs_core::tmtc::ReceivesCcsdsTc; +use satrs::pool::{PoolProvider, SharedStaticMemoryPool, StoreAddr, StoreError}; +use satrs::spacepackets::ecss::tc::PusTcReader; +use satrs::spacepackets::ecss::PusPacket; +use satrs::tmtc::ReceivesCcsdsTc; #[derive(Debug, Clone, PartialEq, Eq, Error)] pub enum MpscStoreAndSendError { @@ -133,7 +133,7 @@ impl TcSourceTaskStatic { Ok((pus_tc, _)) => { self.pus_receiver .handle_tc_packet( - satrs_core::pus::TcInMemory::StoreAddr(addr), + satrs::pus::TcInMemory::StoreAddr(addr), pus_tc.service(), &pus_tc, ) @@ -182,7 +182,7 @@ impl TcSourceTaskDynamic { Ok((pus_tc, _)) => { self.pus_receiver .handle_tc_packet( - satrs_core::pus::TcInMemory::Vec(tc.clone()), + satrs::pus::TcInMemory::Vec(tc.clone()), pus_tc.service(), &pus_tc, ) diff --git a/satrs-example/src/udp.rs b/satrs-example/src/udp.rs index 9e3faa8..b6d1f6b 100644 --- a/satrs-example/src/udp.rs +++ b/satrs-example/src/udp.rs @@ -4,7 +4,7 @@ use std::{ }; use log::{info, warn}; -use satrs_core::{ +use satrs::{ hal::std::udp_server::{ReceiveResult, UdpTcServer}, pool::{PoolProviderWithGuards, SharedStaticMemoryPool, StoreAddr}, tmtc::CcsdsError, @@ -113,7 +113,7 @@ mod tests { sync::{Arc, Mutex}, }; - use satrs_core::{ + use satrs::{ spacepackets::{ ecss::{tc::PusTcCreator, WritablePusPacket}, SpHeader, diff --git a/satrs-mib/Cargo.toml b/satrs-mib/Cargo.toml index ab7083c..f41e2df 100644 --- a/satrs-mib/Cargo.toml +++ b/satrs-mib/Cargo.toml @@ -22,8 +22,12 @@ serde-hex = "0.1.0" version = "1" optional = true -[dependencies.satrs-core] -version = "0.1.0-alpha.3" +[dependencies.satrs-shared] +path = "../satrs-shared" +features = ["serde"] + +# [dependencies.satrs-core] +# version = "0.1.0-alpha.3" # path = "../satrs-core" # git = "https://egit.irs.uni-stuttgart.de/rust/sat-rs.git" # branch = "main" diff --git a/satrs-mib/codegen/Cargo.toml b/satrs-mib/codegen/Cargo.toml index a0067df..e9d439f 100644 --- a/satrs-mib/codegen/Cargo.toml +++ b/satrs-mib/codegen/Cargo.toml @@ -19,12 +19,10 @@ path = "tests/tests.rs" quote = "1" proc-macro2 = "1" -[dependencies.satrs-core] -version = "0.1.0-alpha.3" -# path = "../../satrs-core" -# git = "https://egit.irs.uni-stuttgart.de/rust/sat-rs.git" -# branch = "main" -# rev = "35e1f7a983f6535c5571186e361fe101d4306b89" +[dependencies.syn] +version = "2" +features = ["full"] + [dev-dependencies] trybuild = { version = "1", features = ["diff"] } @@ -32,6 +30,10 @@ trybuild = { version = "1", features = ["diff"] } [dev-dependencies.satrs-mib] path = ".." -[dependencies.syn] -version = "2" -features = ["full"] +[dev-dependencies.satrs-shared] +# version = "0.1.0-alpha.3" +path = "../../satrs-shared" +# git = "https://egit.irs.uni-stuttgart.de/rust/sat-rs.git" +# branch = "main" +# rev = "35e1f7a983f6535c5571186e361fe101d4306b89" + diff --git a/satrs-mib/codegen/tests/basic.rs b/satrs-mib/codegen/tests/basic.rs index d4cf1ab..13d7b54 100644 --- a/satrs-mib/codegen/tests/basic.rs +++ b/satrs-mib/codegen/tests/basic.rs @@ -1,6 +1,6 @@ //! Basic check which just verifies that everything compiles -use satrs_core::res_code::ResultU16; use satrs_mib::resultcode; +use satrs_shared::res_code::ResultU16; #[resultcode] const _TEST_RESULT: ResultU16 = ResultU16::const_new(0, 1); diff --git a/satrs-mib/codegen/tests/basic_with_info.rs b/satrs-mib/codegen/tests/basic_with_info.rs index 2030920..9945e65 100644 --- a/satrs-mib/codegen/tests/basic_with_info.rs +++ b/satrs-mib/codegen/tests/basic_with_info.rs @@ -1,6 +1,6 @@ //! Basic check which just verifies that everything compiles -use satrs_core::res_code::ResultU16; use satrs_mib::resultcode; +use satrs_shared::res_code::ResultU16; #[resultcode(info = "This is a test result where the first parameter is foo")] const _TEST_RESULT: ResultU16 = ResultU16::const_new(0, 1); diff --git a/satrs-mib/codegen/tests/verify_gen_struct.rs b/satrs-mib/codegen/tests/verify_gen_struct.rs index ccd40e8..eb8d3c0 100644 --- a/satrs-mib/codegen/tests/verify_gen_struct.rs +++ b/satrs-mib/codegen/tests/verify_gen_struct.rs @@ -1,6 +1,6 @@ -use satrs_core::res_code::ResultU16; use satrs_mib::res_code::ResultU16Info; use satrs_mib::resultcode; +use satrs_shared::res_code::ResultU16; #[resultcode(info = "This is a test result where the first parameter is foo")] const TEST_RESULT: ResultU16 = ResultU16::const_new(0, 1); diff --git a/satrs-mib/src/res_code.rs b/satrs-mib/src/res_code.rs index 39fa90f..fed9da2 100644 --- a/satrs-mib/src/res_code.rs +++ b/satrs-mib/src/res_code.rs @@ -1,7 +1,7 @@ #[cfg(feature = "std")] pub use stdmod::*; -pub use satrs_core::res_code::ResultU16; +pub use satrs_shared::res_code::ResultU16; use serde::{Deserialize, Serialize}; use serde_hex::{SerHex, StrictCapPfx}; @@ -96,8 +96,8 @@ mod tests { // Special solution for this crate because the code generated by a macro will use // satrs_mib::res_code::* use crate as satrs_mib; - use satrs_core::res_code::ResultU16; use satrs_mib::resultcode; + use satrs_shared::res_code::ResultU16; #[derive(Debug)] #[allow(dead_code)] @@ -119,12 +119,12 @@ mod tests { NOT_ENOUGH_APP_DATA_EXT, ]; - const CSV_NAME: &'static str = "dummy.csv"; + const CSV_NAME: &str = "dummy.csv"; #[test] fn test_printout() { let mut wtrb = csv::WriterBuilder::new(); - wtrb.delimiter(';' as u8); + wtrb.delimiter(b';'); print_resultcodes_as_csv(wtrb, TMTC_RESULTS).expect("Priting result codes failed"); } @@ -133,7 +133,7 @@ mod tests { let csvpath = Path::new(CSV_NAME); let mut wtrb = csv::WriterBuilder::new(); let file = File::create(csvpath).expect("Creating CSV file failed"); - wtrb.delimiter(';' as u8); + wtrb.delimiter(b';'); write_resultcodes_to_csv(wtrb, TMTC_RESULTS, file).expect("CSV export failed"); assert!(csvpath.exists()); let file = File::open(csvpath).expect("Opening CSV file failed"); diff --git a/satrs-shared/Cargo.toml b/satrs-shared/Cargo.toml new file mode 100644 index 0000000..d47ef81 --- /dev/null +++ b/satrs-shared/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "satrs-shared" +description = "Components shared by multiple sat-rs crates" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] + +[dependencies.serde] +version = "1" +default-features = false +optional = true + +[dependencies.spacepackets] +version = "0.9.0" +default-features = false + +[features] +serde = ["dep:serde", "spacepackets/serde"] diff --git a/satrs-shared/src/lib.rs b/satrs-shared/src/lib.rs new file mode 100644 index 0000000..1563025 --- /dev/null +++ b/satrs-shared/src/lib.rs @@ -0,0 +1 @@ +pub mod res_code; diff --git a/satrs-core/src/res_code.rs b/satrs-shared/src/res_code.rs similarity index 100% rename from satrs-core/src/res_code.rs rename to satrs-shared/src/res_code.rs diff --git a/satrs-core/.gitignore b/satrs/.gitignore similarity index 100% rename from satrs-core/.gitignore rename to satrs/.gitignore diff --git a/satrs-core/CHANGELOG.md b/satrs/CHANGELOG.md similarity index 100% rename from satrs-core/CHANGELOG.md rename to satrs/CHANGELOG.md diff --git a/satrs-core/Cargo.toml b/satrs/Cargo.toml similarity index 93% rename from satrs-core/Cargo.toml rename to satrs/Cargo.toml index 0c32388..019f78d 100644 --- a/satrs-core/Cargo.toml +++ b/satrs/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "satrs-core" -version = "0.1.0-alpha.3" +name = "satrs" +version = "0.1.0-alpha.0" edition = "2021" rust-version = "1.61" authors = ["Robin Mueller "] -description = "Core components of the sat-rs framework to build software for remote systems" +description = "A framework to build software for remote systems" homepage = "https://egit.irs.uni-stuttgart.de/rust/sat-rs" repository = "https://egit.irs.uni-stuttgart.de/rust/sat-rs" license = "Apache-2.0" @@ -70,6 +70,9 @@ version = "0.5.4" features = ["all"] optional = true +[dependencies.satrs-shared] +path = "../satrs-shared" + [dependencies.spacepackets] version = "0.9.0" default-features = false diff --git a/satrs-core/LICENSE-APACHE b/satrs/LICENSE-APACHE similarity index 100% rename from satrs-core/LICENSE-APACHE rename to satrs/LICENSE-APACHE diff --git a/satrs-core/NOTICE b/satrs/NOTICE similarity index 100% rename from satrs-core/NOTICE rename to satrs/NOTICE diff --git a/satrs-core/README.md b/satrs/README.md similarity index 100% rename from satrs-core/README.md rename to satrs/README.md diff --git a/satrs-core/release-checklist.md b/satrs/release-checklist.md similarity index 100% rename from satrs-core/release-checklist.md rename to satrs/release-checklist.md diff --git a/satrs-core/src/cfdp/dest.rs b/satrs/src/cfdp/dest.rs similarity index 100% rename from satrs-core/src/cfdp/dest.rs rename to satrs/src/cfdp/dest.rs diff --git a/satrs-core/src/cfdp/filestore.rs b/satrs/src/cfdp/filestore.rs similarity index 100% rename from satrs-core/src/cfdp/filestore.rs rename to satrs/src/cfdp/filestore.rs diff --git a/satrs-core/src/cfdp/mod.rs b/satrs/src/cfdp/mod.rs similarity index 100% rename from satrs-core/src/cfdp/mod.rs rename to satrs/src/cfdp/mod.rs diff --git a/satrs-core/src/cfdp/source.rs b/satrs/src/cfdp/source.rs similarity index 100% rename from satrs-core/src/cfdp/source.rs rename to satrs/src/cfdp/source.rs diff --git a/satrs-core/src/cfdp/user.rs b/satrs/src/cfdp/user.rs similarity index 100% rename from satrs-core/src/cfdp/user.rs rename to satrs/src/cfdp/user.rs diff --git a/satrs-core/src/device.rs b/satrs/src/device.rs similarity index 100% rename from satrs-core/src/device.rs rename to satrs/src/device.rs diff --git a/satrs-core/src/encoding/ccsds.rs b/satrs/src/encoding/ccsds.rs similarity index 100% rename from satrs-core/src/encoding/ccsds.rs rename to satrs/src/encoding/ccsds.rs diff --git a/satrs-core/src/encoding/cobs.rs b/satrs/src/encoding/cobs.rs similarity index 99% rename from satrs-core/src/encoding/cobs.rs rename to satrs/src/encoding/cobs.rs index 2645745..6953c3b 100644 --- a/satrs-core/src/encoding/cobs.rs +++ b/satrs/src/encoding/cobs.rs @@ -13,7 +13,7 @@ use cobs::{decode_in_place, encode, max_encoding_length}; /// /// ``` /// use cobs::decode_in_place_report; -/// use satrs_core::encoding::{encode_packet_with_cobs}; +/// use satrs::encoding::{encode_packet_with_cobs}; // /// const SIMPLE_PACKET: [u8; 5] = [1, 2, 3, 4, 5]; /// const INVERTED_PACKET: [u8; 5] = [5, 4, 3, 2, 1]; diff --git a/satrs-core/src/encoding/mod.rs b/satrs/src/encoding/mod.rs similarity index 100% rename from satrs-core/src/encoding/mod.rs rename to satrs/src/encoding/mod.rs diff --git a/satrs-core/src/event_man.rs b/satrs/src/event_man.rs similarity index 100% rename from satrs-core/src/event_man.rs rename to satrs/src/event_man.rs diff --git a/satrs-core/src/events.rs b/satrs/src/events.rs similarity index 99% rename from satrs-core/src/events.rs rename to satrs/src/events.rs index 20267bd..2b23815 100644 --- a/satrs-core/src/events.rs +++ b/satrs/src/events.rs @@ -18,7 +18,7 @@ //! # Examples //! //! ``` -//! use satrs_core::events::{EventU16, EventU32, EventU32TypedSev, Severity, SeverityHigh, SeverityInfo}; +//! use satrs::events::{EventU16, EventU32, EventU32TypedSev, Severity, SeverityHigh, SeverityInfo}; //! //! const MSG_RECVD: EventU32TypedSev = EventU32TypedSev::const_new(1, 0); //! const MSG_FAILED: EventU32 = EventU32::const_new(Severity::LOW, 1, 1); diff --git a/satrs-core/src/executable.rs b/satrs/src/executable.rs similarity index 100% rename from satrs-core/src/executable.rs rename to satrs/src/executable.rs diff --git a/satrs-core/src/hal/mod.rs b/satrs/src/hal/mod.rs similarity index 100% rename from satrs-core/src/hal/mod.rs rename to satrs/src/hal/mod.rs diff --git a/satrs-core/src/hal/std/mod.rs b/satrs/src/hal/std/mod.rs similarity index 100% rename from satrs-core/src/hal/std/mod.rs rename to satrs/src/hal/std/mod.rs diff --git a/satrs-core/src/hal/std/tcp_cobs_server.rs b/satrs/src/hal/std/tcp_cobs_server.rs similarity index 100% rename from satrs-core/src/hal/std/tcp_cobs_server.rs rename to satrs/src/hal/std/tcp_cobs_server.rs diff --git a/satrs-core/src/hal/std/tcp_server.rs b/satrs/src/hal/std/tcp_server.rs similarity index 100% rename from satrs-core/src/hal/std/tcp_server.rs rename to satrs/src/hal/std/tcp_server.rs diff --git a/satrs-core/src/hal/std/tcp_spacepackets_server.rs b/satrs/src/hal/std/tcp_spacepackets_server.rs similarity index 100% rename from satrs-core/src/hal/std/tcp_spacepackets_server.rs rename to satrs/src/hal/std/tcp_spacepackets_server.rs diff --git a/satrs-core/src/hal/std/udp_server.rs b/satrs/src/hal/std/udp_server.rs similarity index 98% rename from satrs-core/src/hal/std/udp_server.rs rename to satrs/src/hal/std/udp_server.rs index 6f2cb5b..fa117f0 100644 --- a/satrs-core/src/hal/std/udp_server.rs +++ b/satrs/src/hal/std/udp_server.rs @@ -20,8 +20,8 @@ use std::vec::Vec; /// ``` /// use std::net::{IpAddr, Ipv4Addr, SocketAddr, UdpSocket}; /// use spacepackets::ecss::WritablePusPacket; -/// use satrs_core::hal::std::udp_server::UdpTcServer; -/// use satrs_core::tmtc::{ReceivesTc, ReceivesTcCore}; +/// use satrs::hal::std::udp_server::UdpTcServer; +/// use satrs::tmtc::{ReceivesTc, ReceivesTcCore}; /// use spacepackets::SpHeader; /// use spacepackets::ecss::tc::PusTcCreator; /// diff --git a/satrs-core/src/hk.rs b/satrs/src/hk.rs similarity index 100% rename from satrs-core/src/hk.rs rename to satrs/src/hk.rs diff --git a/satrs-core/src/lib.rs b/satrs/src/lib.rs similarity index 100% rename from satrs-core/src/lib.rs rename to satrs/src/lib.rs diff --git a/satrs-core/src/mode.rs b/satrs/src/mode.rs similarity index 100% rename from satrs-core/src/mode.rs rename to satrs/src/mode.rs diff --git a/satrs-core/src/objects.rs b/satrs/src/objects.rs similarity index 99% rename from satrs-core/src/objects.rs rename to satrs/src/objects.rs index 0ff117f..f16b567 100644 --- a/satrs-core/src/objects.rs +++ b/satrs/src/objects.rs @@ -10,7 +10,7 @@ //! ```rust //! use std::any::Any; //! use std::error::Error; -//! use satrs_core::objects::{ManagedSystemObject, ObjectId, ObjectManager, SystemObject}; +//! use satrs::objects::{ManagedSystemObject, ObjectId, ObjectManager, SystemObject}; //! //! struct ExampleSysObj { //! id: ObjectId, diff --git a/satrs-core/src/params.rs b/satrs/src/params.rs similarity index 99% rename from satrs-core/src/params.rs rename to satrs/src/params.rs index bc9cc48..5cad28b 100644 --- a/satrs-core/src/params.rs +++ b/satrs/src/params.rs @@ -13,7 +13,7 @@ //! ## Example for primitive type wrapper //! //! ``` -//! use satrs_core::params::{ParamsRaw, ToBeBytes, U32Pair, WritableToBeBytes}; +//! use satrs::params::{ParamsRaw, ToBeBytes, U32Pair, WritableToBeBytes}; //! //! let u32_pair = U32Pair(0x1010, 25); //! assert_eq!(u32_pair.0, 0x1010); diff --git a/satrs-core/src/pool.rs b/satrs/src/pool.rs similarity index 99% rename from satrs-core/src/pool.rs rename to satrs/src/pool.rs index 5e7cb55..d17f565 100644 --- a/satrs-core/src/pool.rs +++ b/satrs/src/pool.rs @@ -10,7 +10,7 @@ //! # Example for the [StaticMemoryPool] //! //! ``` -//! use satrs_core::pool::{PoolProvider, StaticMemoryPool, StaticPoolConfig}; +//! use satrs::pool::{PoolProvider, StaticMemoryPool, StaticPoolConfig}; //! //! // 4 buckets of 4 bytes, 2 of 8 bytes and 1 of 16 bytes //! let pool_cfg = StaticPoolConfig::new(vec![(4, 4), (2, 8), (1, 16)], false); diff --git a/satrs-core/src/power.rs b/satrs/src/power.rs similarity index 100% rename from satrs-core/src/power.rs rename to satrs/src/power.rs diff --git a/satrs-core/src/pus/event.rs b/satrs/src/pus/event.rs similarity index 100% rename from satrs-core/src/pus/event.rs rename to satrs/src/pus/event.rs diff --git a/satrs-core/src/pus/event_man.rs b/satrs/src/pus/event_man.rs similarity index 100% rename from satrs-core/src/pus/event_man.rs rename to satrs/src/pus/event_man.rs diff --git a/satrs-core/src/pus/event_srv.rs b/satrs/src/pus/event_srv.rs similarity index 100% rename from satrs-core/src/pus/event_srv.rs rename to satrs/src/pus/event_srv.rs diff --git a/satrs-core/src/pus/hk.rs b/satrs/src/pus/hk.rs similarity index 100% rename from satrs-core/src/pus/hk.rs rename to satrs/src/pus/hk.rs diff --git a/satrs-core/src/pus/mod.rs b/satrs/src/pus/mod.rs similarity index 100% rename from satrs-core/src/pus/mod.rs rename to satrs/src/pus/mod.rs diff --git a/satrs-core/src/pus/mode.rs b/satrs/src/pus/mode.rs similarity index 100% rename from satrs-core/src/pus/mode.rs rename to satrs/src/pus/mode.rs diff --git a/satrs-core/src/pus/scheduler.rs b/satrs/src/pus/scheduler.rs similarity index 100% rename from satrs-core/src/pus/scheduler.rs rename to satrs/src/pus/scheduler.rs diff --git a/satrs-core/src/pus/scheduler_srv.rs b/satrs/src/pus/scheduler_srv.rs similarity index 100% rename from satrs-core/src/pus/scheduler_srv.rs rename to satrs/src/pus/scheduler_srv.rs diff --git a/satrs-core/src/pus/test.rs b/satrs/src/pus/test.rs similarity index 100% rename from satrs-core/src/pus/test.rs rename to satrs/src/pus/test.rs diff --git a/satrs-core/src/pus/verification.rs b/satrs/src/pus/verification.rs similarity index 99% rename from satrs-core/src/pus/verification.rs rename to satrs/src/pus/verification.rs index de3ce97..0cf6c24 100644 --- a/satrs-core/src/pus/verification.rs +++ b/satrs/src/pus/verification.rs @@ -15,11 +15,11 @@ //! ``` //! use std::sync::{Arc, mpsc, RwLock}; //! use std::time::Duration; -//! use satrs_core::pool::{PoolProviderWithGuards, StaticMemoryPool, StaticPoolConfig}; -//! use satrs_core::pus::verification::{VerificationReporterCfg, VerificationReporterWithSender}; -//! use satrs_core::seq_count::SeqCountProviderSimple; -//! use satrs_core::pus::MpscTmInSharedPoolSender; -//! use satrs_core::tmtc::tm_helper::SharedTmPool; +//! use satrs::pool::{PoolProviderWithGuards, StaticMemoryPool, StaticPoolConfig}; +//! use satrs::pus::verification::{VerificationReporterCfg, VerificationReporterWithSender}; +//! use satrs::seq_count::SeqCountProviderSimple; +//! use satrs::pus::MpscTmInSharedPoolSender; +//! use satrs::tmtc::tm_helper::SharedTmPool; //! use spacepackets::ecss::PusPacket; //! use spacepackets::SpHeader; //! use spacepackets::ecss::tc::{PusTcCreator, PusTcSecondaryHeader}; diff --git a/satrs-core/src/request.rs b/satrs/src/request.rs similarity index 100% rename from satrs-core/src/request.rs rename to satrs/src/request.rs diff --git a/satrs/src/res_code.rs b/satrs/src/res_code.rs new file mode 100644 index 0000000..6f7d1a9 --- /dev/null +++ b/satrs/src/res_code.rs @@ -0,0 +1 @@ +pub use satrs_shared::res_code::*; diff --git a/satrs-core/src/seq_count.rs b/satrs/src/seq_count.rs similarity index 100% rename from satrs-core/src/seq_count.rs rename to satrs/src/seq_count.rs diff --git a/satrs-core/src/tmtc/ccsds_distrib.rs b/satrs/src/tmtc/ccsds_distrib.rs similarity index 99% rename from satrs-core/src/tmtc/ccsds_distrib.rs rename to satrs/src/tmtc/ccsds_distrib.rs index ea9bf30..74707e4 100644 --- a/satrs-core/src/tmtc/ccsds_distrib.rs +++ b/satrs/src/tmtc/ccsds_distrib.rs @@ -18,8 +18,8 @@ //! # Example //! //! ```rust -//! use satrs_core::tmtc::ccsds_distrib::{CcsdsPacketHandler, CcsdsDistributor}; -//! use satrs_core::tmtc::{ReceivesTc, ReceivesTcCore}; +//! use satrs::tmtc::ccsds_distrib::{CcsdsPacketHandler, CcsdsDistributor}; +//! use satrs::tmtc::{ReceivesTc, ReceivesTcCore}; //! use spacepackets::{CcsdsPacket, SpHeader}; //! use spacepackets::ecss::WritablePusPacket; //! use spacepackets::ecss::tc::{PusTc, PusTcCreator}; diff --git a/satrs-core/src/tmtc/mod.rs b/satrs/src/tmtc/mod.rs similarity index 100% rename from satrs-core/src/tmtc/mod.rs rename to satrs/src/tmtc/mod.rs diff --git a/satrs-core/src/tmtc/pus_distrib.rs b/satrs/src/tmtc/pus_distrib.rs similarity index 98% rename from satrs-core/src/tmtc/pus_distrib.rs rename to satrs/src/tmtc/pus_distrib.rs index e4eefb1..9f3dc4f 100644 --- a/satrs-core/src/tmtc/pus_distrib.rs +++ b/satrs/src/tmtc/pus_distrib.rs @@ -19,8 +19,8 @@ //! //! ```rust //! use spacepackets::ecss::WritablePusPacket; -//! use satrs_core::tmtc::pus_distrib::{PusDistributor, PusServiceProvider}; -//! use satrs_core::tmtc::{ReceivesTc, ReceivesTcCore}; +//! use satrs::tmtc::pus_distrib::{PusDistributor, PusServiceProvider}; +//! use satrs::tmtc::{ReceivesTc, ReceivesTcCore}; //! use spacepackets::SpHeader; //! use spacepackets::ecss::tc::{PusTcCreator, PusTcReader}; //! struct ConcretePusHandler { diff --git a/satrs-core/src/tmtc/tm_helper.rs b/satrs/src/tmtc/tm_helper.rs similarity index 100% rename from satrs-core/src/tmtc/tm_helper.rs rename to satrs/src/tmtc/tm_helper.rs diff --git a/satrs-core/tests/hk_helpers.rs b/satrs/tests/hk_helpers.rs similarity index 100% rename from satrs-core/tests/hk_helpers.rs rename to satrs/tests/hk_helpers.rs diff --git a/satrs-core/tests/pools.rs b/satrs/tests/pools.rs similarity index 93% rename from satrs-core/tests/pools.rs rename to satrs/tests/pools.rs index 94272c0..f2baece 100644 --- a/satrs-core/tests/pools.rs +++ b/satrs/tests/pools.rs @@ -1,4 +1,4 @@ -use satrs_core::pool::{PoolGuard, PoolProvider, StaticMemoryPool, StaticPoolConfig, StoreAddr}; +use satrs::pool::{PoolGuard, PoolProvider, StaticMemoryPool, StaticPoolConfig, StoreAddr}; use std::ops::DerefMut; use std::sync::mpsc; use std::sync::mpsc::{Receiver, Sender}; diff --git a/satrs-core/tests/pus_autogen_events.rs b/satrs/tests/pus_autogen_events.rs similarity index 99% rename from satrs-core/tests/pus_autogen_events.rs rename to satrs/tests/pus_autogen_events.rs index eaec7e6..4aced1d 100644 --- a/satrs-core/tests/pus_autogen_events.rs +++ b/satrs/tests/pus_autogen_events.rs @@ -1,6 +1,6 @@ #![allow(dead_code, unused_imports)] -use satrs_core::events::{ +use satrs::events::{ EventU32, EventU32TypedSev, GenericEvent, HasSeverity, LargestEventRaw, LargestGroupIdRaw, Severity, SeverityInfo, SeverityLow, SeverityMedium, }; diff --git a/satrs-core/tests/pus_events.rs b/satrs/tests/pus_events.rs similarity index 94% rename from satrs-core/tests/pus_events.rs rename to satrs/tests/pus_events.rs index 743d275..dbd778c 100644 --- a/satrs-core/tests/pus_events.rs +++ b/satrs/tests/pus_events.rs @@ -1,13 +1,11 @@ -use satrs_core::event_man::{ +use satrs::event_man::{ EventManagerWithMpscQueue, MpscEventU32Receiver, MpscEventU32SendProvider, SendEventProvider, }; -use satrs_core::events::{EventU32, EventU32TypedSev, Severity, SeverityInfo}; -use satrs_core::params::U32Pair; -use satrs_core::params::{Params, ParamsHeapless, WritableToBeBytes}; -use satrs_core::pus::event_man::{ - DefaultPusMgmtBackendProvider, EventReporter, PusEventDispatcher, -}; -use satrs_core::pus::MpscTmAsVecSender; +use satrs::events::{EventU32, EventU32TypedSev, Severity, SeverityInfo}; +use satrs::params::U32Pair; +use satrs::params::{Params, ParamsHeapless, WritableToBeBytes}; +use satrs::pus::event_man::{DefaultPusMgmtBackendProvider, EventReporter, PusEventDispatcher}; +use satrs::pus::MpscTmAsVecSender; use spacepackets::ecss::tm::PusTmReader; use spacepackets::ecss::{PusError, PusPacket}; use std::sync::mpsc::{channel, SendError, TryRecvError}; diff --git a/satrs-core/tests/pus_verification.rs b/satrs/tests/pus_verification.rs similarity index 97% rename from satrs-core/tests/pus_verification.rs rename to satrs/tests/pus_verification.rs index 84a105c..bc52d6f 100644 --- a/satrs-core/tests/pus_verification.rs +++ b/satrs/tests/pus_verification.rs @@ -1,14 +1,12 @@ //#[cfg(feature = "crossbeam")] pub mod crossbeam_test { use hashbrown::HashMap; - use satrs_core::pool::{ - PoolProvider, PoolProviderWithGuards, StaticMemoryPool, StaticPoolConfig, - }; - use satrs_core::pus::verification::{ + use satrs::pool::{PoolProvider, PoolProviderWithGuards, StaticMemoryPool, StaticPoolConfig}; + use satrs::pus::verification::{ FailParams, RequestId, VerificationReporterCfg, VerificationReporterWithSender, }; - use satrs_core::pus::CrossbeamTmInStoreSender; - use satrs_core::tmtc::tm_helper::SharedTmPool; + use satrs::pus::CrossbeamTmInStoreSender; + use satrs::tmtc::tm_helper::SharedTmPool; use spacepackets::ecss::tc::{PusTcCreator, PusTcReader, PusTcSecondaryHeader}; use spacepackets::ecss::tm::PusTmReader; use spacepackets::ecss::{EcssEnumU16, EcssEnumU8, PusPacket, WritablePusPacket}; diff --git a/satrs-core/tests/tcp_servers.rs b/satrs/tests/tcp_servers.rs similarity index 99% rename from satrs-core/tests/tcp_servers.rs rename to satrs/tests/tcp_servers.rs index e5297c3..b960df7 100644 --- a/satrs-core/tests/tcp_servers.rs +++ b/satrs/tests/tcp_servers.rs @@ -22,7 +22,7 @@ use std::{ }; use hashbrown::HashSet; -use satrs_core::{ +use satrs::{ encoding::cobs::encode_packet_with_cobs, hal::std::tcp_server::{ServerConfig, TcpSpacepacketsServer, TcpTmtcInCobsServer}, tmtc::{ReceivesTcCore, TmPacketSourceCore},