pub trait MoistureDriver<'a> {
// Required methods
fn set_client(&self, client: &'a dyn MoistureClient);
fn read_moisture(&self) -> Result<(), ErrorCode>;
}
Expand description
A basic interface for a moisture sensor
Required Methods§
fn set_client(&self, client: &'a dyn MoistureClient)
Sourcefn read_moisture(&self) -> Result<(), ErrorCode>
fn read_moisture(&self) -> Result<(), ErrorCode>
Read the moisture value from a sensor. The value is returned
via the MoistureClient
callback.
This function might return the following errors:
BUSY
: Indicates that the hardware is busy with an existing operation or initialisation/calibration.NOSUPPORT
: Indicates that this data type isn’t supported.