more events

This commit is contained in:
Robin Mueller
2026-09-22 11:48:40 +02:00
parent 2a7b3796ec
commit 8d36fd3761
11 changed files with 329 additions and 13 deletions
+15
View File
@@ -58,6 +58,21 @@ pub struct SensorData {
pub z: f32,
}
#[derive(serde::Serialize, serde::Deserialize, Clone, Copy, Debug)]
pub enum Event {
/// The SPI fault counter exceeded its threshold, the component was marked faulty and
/// commanded off.
SpiFaultThresholdExceeded,
/// A commanded or autonomous mode transition completed.
ModeChanged(crate::DeviceMode),
}
impl crate::Message for Event {
fn message_type(&self) -> crate::MessageType {
crate::MessageType::Event
}
}
pub mod response {
use crate::{DeviceMode, Message, acs::mgm::SensorData};
@@ -136,3 +136,15 @@ pub mod response {
}
}
}
#[derive(serde::Serialize, serde::Deserialize, Clone, Copy, Debug)]
pub enum Event {
/// A commanded or autonomous mode transition completed.
ModeChanged(Mode),
}
impl crate::Message for Event {
fn message_type(&self) -> crate::MessageType {
crate::MessageType::Event
}
}
+1
View File
@@ -10,6 +10,7 @@ pub mod acs;
pub mod ccsds;
pub mod control;
pub mod pcdu;
pub mod tmtc;
#[derive(
Debug,
+12
View File
@@ -56,6 +56,18 @@ pub enum SwitchStateBinary {
On = 1,
}
#[derive(serde::Serialize, serde::Deserialize, Clone, Copy, Debug)]
pub enum Event {
/// Sending a request to the PCDU over the serial/simulator link failed.
SerialCommError,
}
impl crate::Message for Event {
fn message_type(&self) -> crate::MessageType {
crate::MessageType::Event
}
}
pub type SwitchMapBinary = HashMap<SwitchId, SwitchStateBinary>;
pub struct SwitchMapBinaryWrapper(pub SwitchMapBinary);
+17
View File
@@ -0,0 +1,17 @@
use crate::{ComponentId, Message};
#[derive(serde::Serialize, serde::Deserialize, Clone, Copy, Debug)]
pub enum Event {
/// A received CCSDS packet failed CRC or basic format validation.
InvalidTcPacket,
/// The CCSDS packet was valid, but its embedded TC header could not be decoded.
InvalidTcHeader,
/// The TC header decoded fine, but no handler is registered for its target ID.
UnknownTargetId(ComponentId),
}
impl Message for Event {
fn message_type(&self) -> crate::MessageType {
crate::MessageType::Event
}
}