Struct bsec::Bsec [−][src]
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 init(bme: S, clock: B) -> Result<Self, Error<S::Error>>
[src]
Initialize the Bosch BSEC library and return a handle to interact with it.
pub fn update_subscription(
&mut self,
requests: &[SubscriptionRequest]
) -> Result<Vec<RequiredInput>, Error<S::Error>>
[src]
&mut self,
requests: &[SubscriptionRequest]
) -> Result<Vec<RequiredInput>, Error<S::Error>>
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]
Returns the timestamp when the next measurement has to be triggered.
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]
&mut self
) -> Result<Vec<Output>, Error<S::Error>>
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]
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]
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]
Get the current (raw) Bosch BSEC configuration.
pub fn set_configuration(
&mut self,
serialized_settings: &[u8]
) -> Result<(), Error<S::Error>>
[src]
&mut self,
serialized_settings: &[u8]
) -> Result<(), Error<S::Error>>
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]
&mut self,
sensor: OutputKind
) -> Result<(), Error<S::Error>>
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,
impl<S, C, B> RefUnwindSafe for Bsec<S, C, B> where
B: RefUnwindSafe,
C: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, C, B> UnwindSafe for Bsec<S, C, B> where
B: UnwindSafe,
C: UnwindSafe,
S: UnwindSafe,
impl<S, C, B> UnwindSafe for Bsec<S, C, B> where
B: UnwindSafe,
C: UnwindSafe,
S: UnwindSafe,