From e9681b9dbbe70b5228a7ceaa2a4b404980b07cfa Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 11 Jul 2023 00:45:59 +0200 Subject: [PATCH] move APID to lib --- satrs-example/src/ccsds.rs | 3 ++- satrs-example/src/lib.rs | 2 ++ satrs-example/src/main.rs | 6 ++++-- satrs-example/src/tmtc.rs | 2 -- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/satrs-example/src/ccsds.rs b/satrs-example/src/ccsds.rs index 1a5bb76..ef361f2 100644 --- a/satrs-example/src/ccsds.rs +++ b/satrs-example/src/ccsds.rs @@ -1,6 +1,7 @@ -use crate::tmtc::{MpscStoreAndSendError, PusTcSource, PUS_APID}; +use crate::tmtc::{MpscStoreAndSendError, PusTcSource}; use satrs_core::spacepackets::{CcsdsPacket, SpHeader}; use satrs_core::tmtc::{CcsdsPacketHandler, ReceivesCcsdsTc}; +use satrs_example::PUS_APID; pub struct CcsdsReceiver { pub tc_source: PusTcSource, diff --git a/satrs-example/src/lib.rs b/satrs-example/src/lib.rs index 31fb63d..ed2d226 100644 --- a/satrs-example/src/lib.rs +++ b/satrs-example/src/lib.rs @@ -6,6 +6,8 @@ use std::net::Ipv4Addr; use satrs_mib::res_code::{ResultU16, ResultU16Info}; use satrs_mib::resultcode; +pub const PUS_APID: u16 = 0x02; + #[derive(Copy, Clone, PartialEq, Eq, Debug, TryFromPrimitive, IntoPrimitive)] #[repr(u8)] pub enum CustomPusServiceId { diff --git a/satrs-example/src/main.rs b/satrs-example/src/main.rs index 8944320..cd2bfd5 100644 --- a/satrs-example/src/main.rs +++ b/satrs-example/src/main.rs @@ -16,7 +16,7 @@ use crate::pus::scheduler::Pus11Wrapper; use crate::pus::test::Service17CustomWrapper; use crate::pus::PusTcMpscRouter; use crate::requests::{Request, RequestWithToken}; -use crate::tmtc::{core_tmtc_task, PusTcSource, TcArgs, TcStore, TmArgs, TmFunnel, PUS_APID}; +use crate::tmtc::{core_tmtc_task, PusTcSource, TcArgs, TcStore, TmArgs, TmFunnel}; use satrs_core::event_man::{ EventManagerWithMpscQueue, MpscEventReceiver, MpscEventU32SendProvider, SendEventProvider, }; @@ -45,7 +45,9 @@ use satrs_core::spacepackets::{ use satrs_core::tmtc::tm_helper::SharedTmStore; use satrs_core::tmtc::{AddressableId, TargetId}; use satrs_core::ChannelId; -use satrs_example::{RequestTargetId, TcReceiverId, TmSenderId, OBSW_SERVER_ADDR, SERVER_PORT}; +use satrs_example::{ + RequestTargetId, TcReceiverId, TmSenderId, OBSW_SERVER_ADDR, PUS_APID, SERVER_PORT, +}; use std::collections::HashMap; use std::net::{IpAddr, SocketAddr}; use std::sync::mpsc::{channel, TryRecvError}; diff --git a/satrs-example/src/tmtc.rs b/satrs-example/src/tmtc.rs index 0f7a91e..188a59d 100644 --- a/satrs-example/src/tmtc.rs +++ b/satrs-example/src/tmtc.rs @@ -17,8 +17,6 @@ use satrs_core::spacepackets::SpHeader; use satrs_core::tmtc::tm_helper::SharedTmStore; use satrs_core::tmtc::{CcsdsDistributor, CcsdsError, ReceivesCcsdsTc}; -pub const PUS_APID: u16 = 0x02; - pub struct TmArgs { pub tm_store: SharedTmStore, pub tm_sink_sender: Sender,