more events
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ pub mod acs;
|
||||
pub mod ccsds;
|
||||
pub mod control;
|
||||
pub mod pcdu;
|
||||
pub mod tmtc;
|
||||
|
||||
#[derive(
|
||||
Debug,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user