sat-rs/satrs/src/hk.rs

41 lines
939 B
Rust
Raw Normal View History

use crate::ComponentId;
2023-02-13 09:20:00 +01:00
pub type CollectionIntervalFactor = u32;
/// Unique Identifier for a certain housekeeping dataset.
2023-02-27 11:51:48 +01:00
pub type UniqueId = u32;
2023-02-13 09:20:00 +01:00
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct HkRequest {
pub unique_id: UniqueId,
pub variant: HkRequestVariant,
}
impl HkRequest {
pub fn new(unique_id: UniqueId, variant: HkRequestVariant) -> Self {
Self { unique_id, variant }
}
}
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum HkRequestVariant {
OneShot,
EnablePeriodic,
DisablePeriodic,
ModifyCollectionInterval(CollectionIntervalFactor),
2023-02-27 11:51:48 +01:00
}
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct TargetedHkRequest {
pub target_id: ComponentId,
pub hk_request: HkRequestVariant,
}
impl TargetedHkRequest {
pub fn new(target_id: ComponentId, hk_request: HkRequestVariant) -> Self {
Self {
target_id,
hk_request,
}
}
}