Major refactoring and update of PUS module
This commit is contained in:
.gitignoreREADME.mdcoverage.py
misc
satrs-example
satrs-mib
satrs-shared
satrs
CHANGELOG.mdCargo.tomlrelease-checklist.md
src
action.rs
cfdp
encoding
event_man.rsevents.rshal
hk.rslib.rsmode.rsmode_tree.rsobjects.rsparams.rspool.rspus
action.rsevent.rsevent_man.rsevent_srv.rshk.rsmod.rsmode.rsscheduler.rsscheduler_srv.rstest.rsverification.rs
queue.rsrequest.rsseq_count.rstime.rstmtc
tests
37
satrs/src/mode_tree.rs
Normal file
37
satrs/src/mode_tree.rs
Normal file
@ -0,0 +1,37 @@
|
||||
use alloc::vec::Vec;
|
||||
use hashbrown::HashMap;
|
||||
|
||||
use crate::{
|
||||
mode::{Mode, ModeAndSubmode, Submode},
|
||||
ComponentId,
|
||||
};
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
pub enum TableEntryType {
|
||||
/// Target table containing information of the expected children modes for given mode.
|
||||
Target,
|
||||
/// Sequence table which contains information about how to reach a target table, including
|
||||
/// the order of the sequences.
|
||||
Sequence,
|
||||
}
|
||||
|
||||
pub struct ModeTableEntry {
|
||||
/// Name of respective table entry.
|
||||
pub name: &'static str,
|
||||
/// Target channel ID.
|
||||
pub channel_id: ComponentId,
|
||||
pub mode_submode: ModeAndSubmode,
|
||||
pub allowed_submode_mask: Option<Submode>,
|
||||
pub check_success: bool,
|
||||
}
|
||||
|
||||
pub struct ModeTableMapValue {
|
||||
/// Name for a given mode table entry.
|
||||
pub name: &'static str,
|
||||
pub entries: Vec<ModeTableEntry>,
|
||||
}
|
||||
|
||||
pub type ModeTable = HashMap<Mode, ModeTableMapValue>;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {}
|
Reference in New Issue
Block a user