Struct bsec::Bsec [−][src]
Expand description
Handle to encapsulates the Bosch BSEC library and related state.
Implementations
impl<S: BmeSensor, C: Clock, B: Borrow<C>> Bsec<S, C, B>
[src]
impl<S: BmeSensor, C: Clock, B: Borrow<C>> Bsec<S, C, B>
[src]pub fn update_subscription(
&mut self,
requests: &[SubscriptionRequest]
) -> Result<Vec<RequiredInput>, Error<S::Error>>
[src]
pub fn update_subscription(
&mut self,
requests: &[SubscriptionRequest]
) -> Result<Vec<RequiredInput>, Error<S::Error>>
[src]Change subscription to virtual sensor outputs.
requests
: Configuration of virtual sensors and their sample rates to subscribe to.
Returns a vector describing physical sensor and sampling rates required as input to the BSEC algorithm.
pub fn next_measurement(&self) -> i64
[src]
pub fn next_measurement(&self) -> i64
[src]Returns the timestamp when the next measurement has to be triggered.
pub fn start_next_measurement(&mut self) -> Result<Duration, Error<S::Error>>
[src]
pub fn start_next_measurement(&mut self) -> Result<Duration, Error<S::Error>>
[src]Trigger the next measurement.
Returns the duration until the measurement becomes available. Call
Self::process_last_measurement
after the duration has passed.
pub fn process_last_measurement(
&mut self
) -> Result<Vec<Output>, Error<S::Error>>
[src]
pub fn process_last_measurement(
&mut self
) -> Result<Vec<Output>, Error<S::Error>>
[src]Process the last triggered measurement.
Call this method after the duration returned from a call to
Self::start_next_measurement
has passed.
Returns a vector of virtual sensor outputs calculated by the Bosch BSEC library.
pub fn get_state(&self) -> Result<Vec<u8>, Error<S::Error>>
[src]
pub fn get_state(&self) -> Result<Vec<u8>, Error<S::Error>>
[src]Get the current raw Bosch BSEC state, e.g. to persist it before shutdown.
pub fn set_state(&mut self, state: &[u8]) -> Result<(), Error<S::Error>>
[src]
pub fn set_state(&mut self, state: &[u8]) -> Result<(), Error<S::Error>>
[src]Set the raw Bosch BSEC state, e.g. to restore persisted state after shutdown.
pub fn get_configuration(&self) -> Result<Vec<u8>, Error<S::Error>>
[src]
pub fn get_configuration(&self) -> Result<Vec<u8>, Error<S::Error>>
[src]Get the current (raw) Bosch BSEC configuration.
pub fn set_configuration(
&mut self,
serialized_settings: &[u8]
) -> Result<(), Error<S::Error>>
[src]
pub fn set_configuration(
&mut self,
serialized_settings: &[u8]
) -> Result<(), Error<S::Error>>
[src]Set the (raw) Bosch BSEC configuration.
Your copy of the Bosch BSEC library should contain several different configuration files. See the Bosch BSEC documentation for more information.
pub fn reset_output(
&mut self,
sensor: OutputKind
) -> Result<(), Error<S::Error>>
[src]
pub fn reset_output(
&mut self,
sensor: OutputKind
) -> Result<(), Error<S::Error>>
[src]See documentation of bsec_reset_output
in the Bosch BSEC
documentation.
Trait Implementations
Auto Trait Implementations
impl<S, C, B> RefUnwindSafe for Bsec<S, C, B> where
B: RefUnwindSafe,
C: RefUnwindSafe,
S: RefUnwindSafe,
B: RefUnwindSafe,
C: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, C, B> Send for Bsec<S, C, B> where
B: Send,
C: Send,
S: Send,
B: Send,
C: Send,
S: Send,
impl<S, C, B> Sync for Bsec<S, C, B> where
B: Sync,
C: Sync,
S: Sync,
B: Sync,
C: Sync,
S: Sync,
impl<S, C, B> Unpin for Bsec<S, C, B> where
B: Unpin,
C: Unpin,
S: Unpin,
B: Unpin,
C: Unpin,
S: Unpin,
impl<S, C, B> UnwindSafe for Bsec<S, C, B> where
B: UnwindSafe,
C: UnwindSafe,
S: UnwindSafe,
B: UnwindSafe,
C: UnwindSafe,
S: UnwindSafe,