From f960f244153ba98aba13c195475d7431066257b8 Mon Sep 17 00:00:00 2001 From: lkoester Date: Wed, 17 Apr 2024 10:38:40 +0200 Subject: [PATCH] removed pus tm handler generic for camera handler --- src/handlers/camera.rs | 23 ++++++++++++----------- src/interface/mod.rs | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/handlers/camera.rs b/src/handlers/camera.rs index f0aec9a..efa26f1 100644 --- a/src/handlers/camera.rs +++ b/src/handlers/camera.rs @@ -24,14 +24,15 @@ /// v Y /// /// see also https://opssat1.esoc.esa.int/dmsf/files/6/view + use crate::requests::CompositeRequest; use derive_new::new; use log::debug; use ops_sat_rs::TimeStampHelper; use satrs::action::{ActionRequest, ActionRequestVariant}; use satrs::hk::HkRequest; -use satrs::pus::EcssTmSender; use satrs::request::{GenericMessage, MessageMetadata, UniqueApidTargetId}; +use satrs::tmtc::PacketAsVec; use serde::{Deserialize, Serialize}; use std::io::Error; use std::process::Command; @@ -137,20 +138,18 @@ impl CameraPictureParameters { #[allow(dead_code)] #[derive(new)] -pub struct IMS100BatchHandler { +pub struct IMS100BatchHandler { id: UniqueApidTargetId, // mode_interface: MpscModeLeafInterface, composite_request_receiver: mpsc::Receiver>, // hk_reply_sender: mpsc::Sender>, - tm_sender: TmSender, + tm_sender: mpsc::Sender, stamp_helper: TimeStampHelper, } #[allow(non_snake_case)] #[allow(dead_code)] -impl - IMS100BatchHandler -{ +impl IMS100BatchHandler { pub fn periodic_operation(&mut self) { self.stamp_helper.update_from_now(); // Handle requests. @@ -174,7 +173,11 @@ impl } } - pub fn handle_hk_request(&mut self, _requestor_info: &MessageMetadata, _hk_request: &HkRequest) { + pub fn handle_hk_request( + &mut self, + _requestor_info: &MessageMetadata, + _hk_request: &HkRequest, + ) { // TODO add hk to opssat } @@ -202,12 +205,10 @@ impl )); } ActionRequestVariant::VecData(data) => { - let param: serde_json::Result= + let param: serde_json::Result = serde_json::from_slice(data.as_slice()); match param { - Ok(param) => { - param - } + Ok(param) => param, Err(_) => { return Err(Error::other("Unable to deserialize parameters")); } diff --git a/src/interface/mod.rs b/src/interface/mod.rs index 1b57a4f..6b6038c 100644 --- a/src/interface/mod.rs +++ b/src/interface/mod.rs @@ -33,4 +33,4 @@ impl SpacePacketValidator for SimpleSpValidator { } SpValidity::Skip } -} \ No newline at end of file +}