From 622dfb2089af207dccb3c7ebd7512d3768958bcd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 10 Jan 2023 17:16:57 +0100 Subject: [PATCH] use re-export in example now --- Cargo.lock | 20 ++++---------------- satrs-core/src/pus/verification.rs | 5 ++++- satrs-example/Cargo.toml | 4 ---- satrs-example/src/bin/simpleclient.rs | 8 ++++---- satrs-example/src/ccsds.rs | 2 +- satrs-example/src/main.rs | 10 ++++++---- satrs-example/src/pus.rs | 9 ++++----- satrs-example/src/tmtc.rs | 5 +---- 8 files changed, 24 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8acb69c..3aec592 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -552,7 +552,7 @@ checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" [[package]] name = "satrs-core" -version = "0.1.0" +version = "0.1.0-pre0" dependencies = [ "bus", "crossbeam-channel", @@ -568,7 +568,7 @@ dependencies = [ "postcard", "serde", "serde_json", - "spacepackets 0.4.0 (git+https://egit.irs.uni-stuttgart.de/rust/spacepackets.git)", + "spacepackets 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "zerocopy", ] @@ -581,7 +581,6 @@ dependencies = [ "delegate", "satrs-core", "satrs-mib", - "spacepackets 0.4.0 (git+https://egit.irs.uni-stuttgart.de/rust/spacepackets.git?branch=all_features)", "zerocopy", ] @@ -699,19 +698,8 @@ dependencies = [ [[package]] name = "spacepackets" version = "0.4.0" -source = "git+https://egit.irs.uni-stuttgart.de/rust/spacepackets.git?branch=all_features#03b94fbcde150af685837241a096d6b04f1f5b29" -dependencies = [ - "chrono", - "crc", - "delegate", - "num-traits", - "zerocopy", -] - -[[package]] -name = "spacepackets" -version = "0.4.0" -source = "git+https://egit.irs.uni-stuttgart.de/rust/spacepackets.git#481de83fdb657b8de299b63f1b504299d5e85e31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9199251260fa674673a195bbe68703ba8d7ac0875d97df05cd4b5618218da054" dependencies = [ "chrono", "crc", diff --git a/satrs-core/src/pus/verification.rs b/satrs-core/src/pus/verification.rs index 1481eae..c694294 100644 --- a/satrs-core/src/pus/verification.rs +++ b/satrs-core/src/pus/verification.rs @@ -192,7 +192,10 @@ impl RequestId { /// If a verification operation fails, the passed token will be returned as well. This allows /// re-trying the operation at a later point. #[derive(Debug, Clone)] -pub struct VerificationOrSendErrorWithToken(pub EcssTmErrorWithSend, pub VerificationToken); +pub struct VerificationOrSendErrorWithToken( + pub EcssTmErrorWithSend, + pub VerificationToken, +); #[derive(Debug, Clone)] pub struct VerificationErrorWithToken(pub EcssTmError, pub VerificationToken); diff --git a/satrs-example/Cargo.toml b/satrs-example/Cargo.toml index 70013c4..8bde559 100644 --- a/satrs-example/Cargo.toml +++ b/satrs-example/Cargo.toml @@ -11,10 +11,6 @@ delegate = "0.8" zerocopy = "0.6" csv = "1" -[dependencies.spacepackets] -git = "https://egit.irs.uni-stuttgart.de/rust/spacepackets.git" -branch = "all_features" - [dependencies.satrs-core] path = "../satrs-core" diff --git a/satrs-example/src/bin/simpleclient.rs b/satrs-example/src/bin/simpleclient.rs index 5b4f99a..e431eb5 100644 --- a/satrs-example/src/bin/simpleclient.rs +++ b/satrs-example/src/bin/simpleclient.rs @@ -1,9 +1,9 @@ use satrs_core::pus::verification::RequestId; +use satrs_core::{ + spacepackets::ecss::PusPacket, spacepackets::tc::PusTc, spacepackets::tm::PusTm, + spacepackets::SpHeader, +}; use satrs_example::{OBSW_SERVER_ADDR, SERVER_PORT}; -use spacepackets::ecss::PusPacket; -use spacepackets::tc::PusTc; -use spacepackets::tm::PusTm; -use spacepackets::SpHeader; use std::net::{IpAddr, SocketAddr, UdpSocket}; use std::time::Duration; diff --git a/satrs-example/src/ccsds.rs b/satrs-example/src/ccsds.rs index 75c4ae8..1a5bb76 100644 --- a/satrs-example/src/ccsds.rs +++ b/satrs-example/src/ccsds.rs @@ -1,6 +1,6 @@ use crate::tmtc::{MpscStoreAndSendError, PusTcSource, PUS_APID}; +use satrs_core::spacepackets::{CcsdsPacket, SpHeader}; use satrs_core::tmtc::{CcsdsPacketHandler, ReceivesCcsdsTc}; -use spacepackets::{CcsdsPacket, SpHeader}; pub struct CcsdsReceiver { pub tc_source: PusTcSource, diff --git a/satrs-example/src/main.rs b/satrs-example/src/main.rs index fb8fae8..4cd7a0f 100644 --- a/satrs-example/src/main.rs +++ b/satrs-example/src/main.rs @@ -24,11 +24,13 @@ use satrs_core::pus::verification::{ }; use satrs_core::pus::{EcssTmErrorWithSend, EcssTmSenderCore}; use satrs_core::seq_count::SeqCountProviderSimple; +use satrs_core::spacepackets::{ + time::cds::TimeProvider, + time::TimeWriter, + tm::{PusTm, PusTmSecondaryHeader}, + SequenceFlags, SpHeader, +}; use satrs_example::{RequestTargetId, OBSW_SERVER_ADDR, SERVER_PORT}; -use spacepackets::time::cds::TimeProvider; -use spacepackets::time::TimeWriter; -use spacepackets::tm::{PusTm, PusTmSecondaryHeader}; -use spacepackets::{SequenceFlags, SpHeader}; use std::collections::HashMap; use std::net::{IpAddr, SocketAddr}; use std::sync::mpsc::{channel, TryRecvError}; diff --git a/satrs-example/src/pus.rs b/satrs-example/src/pus.rs index c7e1e40..79b5c61 100644 --- a/satrs-example/src/pus.rs +++ b/satrs-example/src/pus.rs @@ -12,12 +12,11 @@ use satrs_core::pus::verification::{ use satrs_core::res_code::ResultU16; use satrs_core::tmtc::tm_helper::PusTmWithCdsShortHelper; use satrs_core::tmtc::{AddressableId, PusServiceProvider}; +use satrs_core::{ + spacepackets::ecss::PusPacket, spacepackets::tc::PusTc, spacepackets::time::cds::TimeProvider, + spacepackets::time::TimeWriter, spacepackets::SpHeader, +}; use satrs_example::{hk_err, tmtc_err}; -use spacepackets::ecss::PusPacket; -use spacepackets::tc::PusTc; -use spacepackets::time::cds::TimeProvider; -use spacepackets::time::TimeWriter; -use spacepackets::SpHeader; use std::collections::HashMap; use std::sync::mpsc::Sender; diff --git a/satrs-example/src/tmtc.rs b/satrs-example/src/tmtc.rs index 32546cc..4314deb 100644 --- a/satrs-example/src/tmtc.rs +++ b/satrs-example/src/tmtc.rs @@ -15,13 +15,10 @@ use crate::requests::RequestWithToken; use satrs_core::pool::{SharedPool, StoreAddr, StoreError}; use satrs_core::pus::event_man::EventRequestWithToken; use satrs_core::pus::verification::StdVerifReporterWithSender; +use satrs_core::spacepackets::{ecss::PusPacket, tc::PusTc, tm::PusTm, SpHeader}; use satrs_core::tmtc::{ CcsdsDistributor, CcsdsError, PusServiceProvider, ReceivesCcsdsTc, ReceivesEcssPusTc, }; -use spacepackets::ecss::PusPacket; -use spacepackets::tc::PusTc; -use spacepackets::tm::PusTm; -use spacepackets::SpHeader; pub const PUS_APID: u16 = 0x02;