pub struct Subsystem {
pub eps: Arc<Mutex<Box<dyn Clyde3gEps + Send>>>,
pub last_mutation: Arc<RwLock<Mutations>>,
pub errors: Arc<RwLock<Vec<String>>>,
pub watchdog_handle: Arc<Mutex<JoinHandle<()>>>,
pub checksum: Arc<Mutex<Checksum>>,
}
Expand description
Main structure for controlling and accessing system resources
Fields
eps: Arc<Mutex<Box<dyn Clyde3gEps + Send>>>
Underlying EPS object
last_mutation: Arc<RwLock<Mutations>>
Last mutation executed
errors: Arc<RwLock<Vec<String>>>
Errors accumulated over all queries and mutations
watchdog_handle: Arc<Mutex<JoinHandle<()>>>
Watchdog kicking thread handle
checksum: Arc<Mutex<Checksum>>
Last known checksum of EPS ROM
Implementations
sourceimpl Subsystem
impl Subsystem
sourcepub fn new(eps: Box<dyn Clyde3gEps + Send>) -> EpsResult<Self>
pub fn new(eps: Box<dyn Clyde3gEps + Send>) -> EpsResult<Self>
Create a new subsystem instance for the service to use
sourcepub fn from_path(bus: &str) -> EpsResult<Self>
pub fn from_path(bus: &str) -> EpsResult<Self>
Create the underlying EPS object and then create a new subsystem which will use it
sourcepub fn get_motherboard_telemetry(&self, telem_type: Type) -> Result<f64, String>
pub fn get_motherboard_telemetry(&self, telem_type: Type) -> Result<f64, String>
Get the requested telemetry item from the motherboard
sourcepub fn get_daughterboard_telemetry(
&self,
telem_type: Type
) -> Result<f64, String>
pub fn get_daughterboard_telemetry(
&self,
telem_type: Type
) -> Result<f64, String>
Get the requested telemetry item from the daughterboard
sourcepub fn get_reset_telemetry(&self, telem_type: Type) -> Result<Data, String>
pub fn get_reset_telemetry(&self, telem_type: Type) -> Result<Data, String>
Get the specific type of reset counts
sourcepub fn get_comms_watchdog_period(&self) -> Result<u8, String>
pub fn get_comms_watchdog_period(&self) -> Result<u8, String>
Get the current watchdog period setting
sourcepub fn get_version(&self) -> Result<VersionData, String>
pub fn get_version(&self) -> Result<VersionData, String>
Get the system version information
sourcepub fn get_board_status(&self) -> Result<BoardData, String>
pub fn get_board_status(&self) -> Result<BoardData, String>
Get the current board status
sourcepub fn get_last_eps_error(&self) -> Result<ErrorData, String>
pub fn get_last_eps_error(&self) -> Result<ErrorData, String>
Get the last error the EPS encountered
sourcepub fn get_power(&self) -> Result<GetPowerResponse, String>
pub fn get_power(&self) -> Result<GetPowerResponse, String>
Get the current power state of the EPS
sourcepub fn manual_reset(&self) -> Result<MutationResponse, String>
pub fn manual_reset(&self) -> Result<MutationResponse, String>
Trigger a manual reset of the EPS
sourcepub fn reset_watchdog(&self) -> Result<MutationResponse, String>
pub fn reset_watchdog(&self) -> Result<MutationResponse, String>
Kick the I2C watchdog
sourcepub fn set_watchdog_period(&self, period: u8) -> Result<MutationResponse, String>
pub fn set_watchdog_period(&self, period: u8) -> Result<MutationResponse, String>
Set the I2C watchdog timeout period
sourcepub fn raw_command(
&self,
command: u8,
data: Vec<u8>
) -> Result<MutationResponse, String>
pub fn raw_command(
&self,
command: u8,
data: Vec<u8>
) -> Result<MutationResponse, String>
Pass raw command values through to the EPS
sourcepub fn test_hardware(&self) -> Result<MutationResponse, String>
pub fn test_hardware(&self) -> Result<MutationResponse, String>
Run hardware tests to check system health
sourcepub fn set_last_mutation(&self, mutation: Mutations)
pub fn set_last_mutation(&self, mutation: Mutations)
Record the last mutation executed by the service
sourcepub fn get_errors(&self) -> EpsResult<Vec<String>>
pub fn get_errors(&self) -> EpsResult<Vec<String>>
Fetch all errors since the last time this function was called, then clear the errors storage
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Subsystem
impl Send for Subsystem
impl Sync for Subsystem
impl Unpin for Subsystem
impl UnwindSafe for Subsystem
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more