From 8a6b56fd96e990cf53934128092dda2932038a98 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 3 Apr 2024 18:28:04 +0200 Subject: [PATCH] update for spacepackets changes --- satrs-example/src/acs/mgm.rs | 2 +- satrs-example/src/bin/simpleclient.rs | 2 +- satrs-example/src/pus/mode.rs | 9 ++------- satrs/src/pus/event.rs | 2 +- satrs/src/pus/verification.rs | 2 +- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/satrs-example/src/acs/mgm.rs b/satrs-example/src/acs/mgm.rs index e399f81..ab03a76 100644 --- a/satrs-example/src/acs/mgm.rs +++ b/satrs-example/src/acs/mgm.rs @@ -153,7 +153,7 @@ impl hk::Subservice::TmHkPacket as u8, 0, 0, - Some(self.stamp_helper.stamp()), + self.stamp_helper.stamp(), ); let mgm_snapshot = *self.shared_mgm_set.lock().unwrap(); // Use binary serialization here. We want the data to be tightly packed. diff --git a/satrs-example/src/bin/simpleclient.rs b/satrs-example/src/bin/simpleclient.rs index 04281ca..2d015d0 100644 --- a/satrs-example/src/bin/simpleclient.rs +++ b/satrs-example/src/bin/simpleclient.rs @@ -13,7 +13,7 @@ fn main() { let mut buf = [0; 32]; let addr = SocketAddr::new(IpAddr::V4(OBSW_SERVER_ADDR), SERVER_PORT); let mut sph = SpHeader::tc_unseg(0x02, 0, 0).unwrap(); - let pus_tc = PusTcCreator::new_simple(&mut sph, 17, 1, None, true); + let pus_tc = PusTcCreator::new_simple(&mut sph, 17, 1, &[], true); let client = UdpSocket::bind("127.0.0.1:7302").expect("Connecting to UDP server failed"); let tc_req_id = RequestId::new(&pus_tc); println!("Packing and sending PUS ping command TC[17,1] with request ID {tc_req_id}"); diff --git a/satrs-example/src/pus/mode.rs b/satrs-example/src/pus/mode.rs index 587604d..bb535b9 100644 --- a/satrs-example/src/pus/mode.rs +++ b/satrs-example/src/pus/mode.rs @@ -80,13 +80,8 @@ impl PusReplyHandler for ModeReplyHandler { let req_id = verification::RequestId::from(reply.request_id()); let mut sp_header = SpHeader::tm_unseg(req_id.packet_id().apid(), 0, 0) .expect("generating SP header failed"); - let sec_header = PusTmSecondaryHeader::new( - 200, - Subservice::TmModeReply as u8, - 0, - 0, - Some(time_stamp), - ); + let sec_header = + PusTmSecondaryHeader::new(200, Subservice::TmModeReply as u8, 0, 0, time_stamp); let pus_tm = PusTmCreator::new(&mut sp_header, sec_header, &source_data, true); tm_sender.send_tm(self.owner_id, PusTmVariant::Direct(pus_tm))?; verification_handler.completion_success(tm_sender, started_token, time_stamp)?; diff --git a/satrs/src/pus/event.rs b/satrs/src/pus/event.rs index 0462101..c360f5c 100644 --- a/satrs/src/pus/event.rs +++ b/satrs/src/pus/event.rs @@ -115,7 +115,7 @@ impl EventReportCreator { source_buffer_large_enough(src_data_buf.len(), src_data_len)?; let mut sp_header = SpHeader::tm_unseg(self.apid, 0, 0).unwrap(); let sec_header = - PusTmSecondaryHeader::new(5, subservice.into(), 0, self.dest_id, Some(time_stamp)); + PusTmSecondaryHeader::new(5, subservice.into(), 0, self.dest_id, time_stamp); let mut current_idx = 0; event_id.write_to_be_bytes(&mut src_data_buf[0..event_id.size()])?; current_idx += event_id.size(); diff --git a/satrs/src/pus/verification.rs b/satrs/src/pus/verification.rs index 0678e68..27194ea 100644 --- a/satrs/src/pus/verification.rs +++ b/satrs/src/pus/verification.rs @@ -868,7 +868,7 @@ impl VerificationReportCreator { source_data_len: usize, ) -> PusTmCreator<'time, 'src_data> { let tm_sec_header = - PusTmSecondaryHeader::new(1, subservice, msg_counter, self.dest_id, Some(time_stamp)); + PusTmSecondaryHeader::new(1, subservice, msg_counter, self.dest_id, time_stamp); PusTmCreator::new( sp_header, tm_sec_header,