From 406687d6d811b7c6ae9496c119b5cf436535a5c3 Mon Sep 17 00:00:00 2001 From: lkoester Date: Tue, 9 Apr 2024 11:32:40 +0200 Subject: [PATCH 1/4] added tmtc and interface directories --- src/interface/can.rs | 0 src/interface/mod.rs | 1 + src/interface/tcp.rs | 2 +- src/main.rs | 6 ++---- src/{ => tmtc}/ccsds.rs | 0 src/{tmtc.rs => tmtc/mod.rs} | 3 +++ src/{ => tmtc}/tm_funnel.rs | 0 7 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 src/interface/can.rs rename src/{ => tmtc}/ccsds.rs (100%) rename src/{tmtc.rs => tmtc/mod.rs} (98%) rename src/{ => tmtc}/tm_funnel.rs (100%) diff --git a/src/interface/can.rs b/src/interface/can.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/interface/mod.rs b/src/interface/mod.rs index f7a6a76..e2e5df7 100644 --- a/src/interface/mod.rs +++ b/src/interface/mod.rs @@ -1,2 +1,3 @@ pub mod tcp; pub mod udp; +pub mod can; diff --git a/src/interface/tcp.rs b/src/interface/tcp.rs index 04bb136..c78b3e7 100644 --- a/src/interface/tcp.rs +++ b/src/interface/tcp.rs @@ -11,7 +11,7 @@ use satrs::{ tmtc::{CcsdsDistributor, CcsdsError, ReceivesCcsdsTc, TmPacketSourceCore}, }; -use crate::ccsds::CcsdsReceiver; +use crate::tmtc::ccsds::CcsdsReceiver; #[derive(Default, Clone)] pub struct SyncTcpTmSource { diff --git a/src/main.rs b/src/main.rs index 60a36d5..d69c994 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ use satrs::{ use ops_sat_rs::config::tasks::FREQ_MS_PUS_STACK; use crate::{ - ccsds::CcsdsReceiver, + tmtc::ccsds::CcsdsReceiver, logger::setup_logger, interface::tcp::{SyncTcpTmSource, TcpTask}, tmtc::PusTcSourceProviderDynamic, @@ -26,15 +26,13 @@ use crate::pus::{PusReceiver, PusTcMpscRouter}; use crate::pus::stack::PusStack; use crate::pus::test::create_test_service_dynamic; use crate::requests::GenericRequestRouter; -use crate::tm_funnel::TmFunnelDynamic; +use crate::tmtc::tm_funnel::TmFunnelDynamic; use crate::tmtc::TcSourceTaskDynamic; -mod ccsds; mod logger; mod tmtc; mod requests; mod pus; -mod tm_funnel; mod interface; #[allow(dead_code)] diff --git a/src/ccsds.rs b/src/tmtc/ccsds.rs similarity index 100% rename from src/ccsds.rs rename to src/tmtc/ccsds.rs diff --git a/src/tmtc.rs b/src/tmtc/mod.rs similarity index 98% rename from src/tmtc.rs rename to src/tmtc/mod.rs index b9f1809..41dcaae 100644 --- a/src/tmtc.rs +++ b/src/tmtc/mod.rs @@ -10,6 +10,9 @@ use satrs::spacepackets::ecss::PusPacket; use crate::pus::PusReceiver; use thiserror::Error; +pub mod tm_funnel; +pub mod ccsds; + #[derive(Debug, Clone, PartialEq, Eq, Error)] pub enum MpscStoreAndSendError { #[error("Store error: {0}")] diff --git a/src/tm_funnel.rs b/src/tmtc/tm_funnel.rs similarity index 100% rename from src/tm_funnel.rs rename to src/tmtc/tm_funnel.rs From aac2ad206c0c983628f7c3ad07b6dea4c8f6f2d4 Mon Sep 17 00:00:00 2001 From: lkoester Date: Tue, 9 Apr 2024 11:34:02 +0200 Subject: [PATCH 2/4] typo in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 511b99a..a535f0b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This is the primary repository for the ESA OPS-SAT experiment. ## Pre-Requisites -- Containerization provider like [docker](https://www.docker.com/)or +- Containerization provider like [docker](https://www.docker.com/) or [podman](https://podman.io/) installed - [`cross`](https://github.com/cross-rs/cross) package installed From ef580e56344bbcafc023b7f0560855e8f280e60e Mon Sep 17 00:00:00 2001 From: lkoester Date: Tue, 9 Apr 2024 17:51:42 +0200 Subject: [PATCH 3/4] added empty can file --- src/interface/can.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/interface/can.rs b/src/interface/can.rs index e69de29..2971660 100644 --- a/src/interface/can.rs +++ b/src/interface/can.rs @@ -0,0 +1 @@ +/// This is a preliminary implementation of the necessary infrastructure to enable communication over OPS-SAT's internal CAN Bus. From 88d1956dbf4061a0748710f4da8663f2a39afe1c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 10 Apr 2024 12:51:15 +0200 Subject: [PATCH 4/4] cargo fmt + clippy --- src/interface/can.rs | 2 +- src/interface/mod.rs | 2 +- src/interface/udp.rs | 2 +- src/tmtc/mod.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/interface/can.rs b/src/interface/can.rs index 2971660..af12524 100644 --- a/src/interface/can.rs +++ b/src/interface/can.rs @@ -1 +1 @@ -/// This is a preliminary implementation of the necessary infrastructure to enable communication over OPS-SAT's internal CAN Bus. +//! This is a preliminary implementation of the necessary infrastructure to enable communication over OPS-SAT's internal CAN Bus. diff --git a/src/interface/mod.rs b/src/interface/mod.rs index e2e5df7..cc4703d 100644 --- a/src/interface/mod.rs +++ b/src/interface/mod.rs @@ -1,3 +1,3 @@ +pub mod can; pub mod tcp; pub mod udp; -pub mod can; diff --git a/src/interface/udp.rs b/src/interface/udp.rs index 5c45e9e..65193a9 100644 --- a/src/interface/udp.rs +++ b/src/interface/udp.rs @@ -82,6 +82,7 @@ mod tests { sync::{Arc, Mutex}, }; + use ops_sat_rs::config::{components, OBSW_SERVER_ADDR}; use satrs::{ spacepackets::{ ecss::{tc::PusTcCreator, WritablePusPacket}, @@ -89,7 +90,6 @@ mod tests { }, tmtc::ReceivesTcCore, }; - use ops_sat_rs::config::{components, OBSW_SERVER_ADDR}; use super::*; diff --git a/src/tmtc/mod.rs b/src/tmtc/mod.rs index 5ac0153..fc28a37 100644 --- a/src/tmtc/mod.rs +++ b/src/tmtc/mod.rs @@ -10,8 +10,8 @@ use satrs::{ use std::sync::mpsc::{self, SendError, Sender, TryRecvError}; use thiserror::Error; -pub mod tm_funnel; pub mod ccsds; +pub mod tm_funnel; #[derive(Debug, Clone, PartialEq, Eq, Error)] pub enum MpscStoreAndSendError {