This commit is contained in:
parent
d4a122e462
commit
e426a7cef1
@ -1,5 +1,6 @@
|
||||
use crate::requests::{ActionRequest, Request, RequestWithToken};
|
||||
use crate::requests::{Request, RequestWithToken};
|
||||
use log::{error, warn};
|
||||
use satrs::action::ActionRequest;
|
||||
use satrs::pool::{SharedStaticMemoryPool, StoreAddr};
|
||||
use satrs::pus::verification::{
|
||||
FailParams, TcStateAccepted, VerificationReporterWithSender, VerificationToken,
|
||||
@ -129,7 +130,7 @@ impl<TcInMemConverter: EcssTcInMemConverter> PusService8ActionHandler<TcInMemCon
|
||||
sender
|
||||
.send(RequestWithToken::new(
|
||||
target_id,
|
||||
Request::Action(ActionRequest::CmdWithU32Id((
|
||||
Request::Action(ActionRequest::ActionIdAndVecData((
|
||||
action_id,
|
||||
Vec::from(&user_data[8..]),
|
||||
))),
|
||||
|
@ -1,16 +1,10 @@
|
||||
use derive_new::new;
|
||||
use satrs::action::ActionRequest;
|
||||
use satrs::hk::HkRequest;
|
||||
use satrs::mode::ModeRequest;
|
||||
use satrs::pus::verification::{TcStateAccepted, VerificationToken};
|
||||
use satrs_example::TargetIdWithApid;
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[derive(Clone, Eq, PartialEq, Debug)]
|
||||
pub enum ActionRequest {
|
||||
CmdWithU32Id((u32, Vec<u8>)),
|
||||
CmdWithStringId((String, Vec<u8>)),
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[derive(Clone, Eq, PartialEq, Debug)]
|
||||
#[non_exhaustive]
|
||||
|
21
satrs/src/action.rs
Normal file
21
satrs/src/action.rs
Normal file
@ -0,0 +1,21 @@
|
||||
use crate::{pool::StoreAddr, tmtc::TargetId};
|
||||
|
||||
pub type ActionId = u32;
|
||||
|
||||
#[derive(Clone, Eq, PartialEq, Debug)]
|
||||
pub enum ActionRequest {
|
||||
ActionIdAndStoreData((ActionId, StoreAddr)),
|
||||
ActionIdAndVecData((ActionId, alloc::vec::Vec<u8>)),
|
||||
StringIdAndVecData((alloc::string::String, alloc::vec::Vec<u8>)),
|
||||
StringIdAndStoreData((alloc::string::String, StoreAddr)),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct TargetedActionRequest {
|
||||
target: TargetId,
|
||||
hk_request: ActionRequest,
|
||||
}
|
||||
|
||||
pub trait ActionRequestProvider {
|
||||
fn route_action_request(&self, targeted_request: TargetedActionRequest);
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
use crate::tmtc::TargetId;
|
||||
|
||||
pub type CollectionIntervalFactor = u32;
|
||||
pub type UniqueId = u32;
|
||||
|
||||
@ -11,6 +13,10 @@ pub enum HkRequest {
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
pub struct TargetedHkRequest {
|
||||
target: u32,
|
||||
target: TargetId,
|
||||
hk_request: HkRequest,
|
||||
}
|
||||
|
||||
pub trait HkRequestProvider {
|
||||
fn route_hk_request(&self, targeted_request: TargetedHkRequest);
|
||||
}
|
||||
|
@ -22,6 +22,8 @@ extern crate downcast_rs;
|
||||
#[cfg(any(feature = "std", test))]
|
||||
extern crate std;
|
||||
|
||||
#[cfg(feature = "alloc")]
|
||||
pub mod action;
|
||||
#[cfg(feature = "alloc")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "alloc")))]
|
||||
pub mod cfdp;
|
||||
|
@ -47,12 +47,12 @@ impl ModeAndSubmode {
|
||||
}
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
pub struct ModeCommand {
|
||||
pub struct TargetedModeCommand {
|
||||
pub address: TargetId,
|
||||
pub mode_submode: ModeAndSubmode,
|
||||
}
|
||||
|
||||
impl ModeCommand {
|
||||
impl TargetedModeCommand {
|
||||
pub const fn new(address: TargetId, mode_submode: ModeAndSubmode) -> Self {
|
||||
Self {
|
||||
address,
|
||||
|
@ -1 +1,3 @@
|
||||
|
||||
pub trait RequestRouter {
|
||||
//fn route_request(&self, request: Request);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user