[][src]Struct clyde_3g_eps_service::models::subsystem::Subsystem

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>>,
}

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

Methods

impl Subsystem[src]

pub fn new(eps: Box<dyn Clyde3gEps + Send>) -> EpsResult<Self>[src]

Create a new subsystem instance for the service to use

pub fn from_path(bus: &str) -> EpsResult<Self>[src]

Create the underlying EPS object and then create a new subsystem which will use it

pub fn get_motherboard_telemetry(&self, telem_type: Type) -> Result<f64, String>[src]

Get the requested telemetry item from the motherboard

pub fn get_daughterboard_telemetry(
    &self,
    telem_type: Type
) -> Result<f64, String>
[src]

Get the requested telemetry item from the daughterboard

pub fn get_reset_telemetry(&self, telem_type: Type) -> Result<Data, String>[src]

Get the specific type of reset counts

pub fn get_comms_watchdog_period(&self) -> Result<u8, String>[src]

Get the current watchdog period setting

pub fn get_version(&self) -> Result<VersionData, String>[src]

Get the system version information

pub fn get_board_status(&self) -> Result<BoardData, String>[src]

Get the current board status

pub fn get_last_eps_error(&self) -> Result<ErrorData, String>[src]

Get the last error the EPS encountered

pub fn get_power(&self) -> Result<GetPowerResponse, String>[src]

Get the current power state of the EPS

pub fn manual_reset(&self) -> Result<MutationResponse, String>[src]

Trigger a manual reset of the EPS

pub fn reset_watchdog(&self) -> Result<MutationResponse, String>[src]

Kick the I2C watchdog

pub fn set_watchdog_period(
    &self,
    period: u8
) -> Result<MutationResponse, String>
[src]

Set the I2C watchdog timeout period

pub fn raw_command(
    &self,
    command: u8,
    data: Vec<u8>
) -> Result<MutationResponse, String>
[src]

Pass raw command values through to the EPS

pub fn test_hardware(&self) -> Result<MutationResponse, String>[src]

Run hardware tests to check system health

pub fn set_last_mutation(&self, mutation: Mutations)[src]

Record the last mutation executed by the service

pub fn get_errors(&self) -> EpsResult<Vec<String>>[src]

Fetch all errors since the last time this function was called, then clear the errors storage

Trait Implementations

impl Clone for Subsystem[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Unpin for Subsystem

impl Sync for Subsystem

impl Send for Subsystem

impl UnwindSafe for Subsystem

impl RefUnwindSafe for Subsystem

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> UnsafeAny for T where
    T: Any

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,