pub trait RainFallDriver<'a> {
    // Required methods
    fn set_client(&self, client: &'a dyn RainFallClient);
    fn read_rainfall(&self, hours: usize) -> Result<(), ErrorCode>;
}Expand description
A basic interface for a rain fall sensor
Required Methods§
fn set_client(&self, client: &'a dyn RainFallClient)
Sourcefn read_rainfall(&self, hours: usize) -> Result<(), ErrorCode>
 
fn read_rainfall(&self, hours: usize) -> Result<(), ErrorCode>
Read the rain fall value from a sensor. The value is returned
via the RainFallClient callback.
- hours: the number of hours of rainfall to report. 1 to 24 hours are valid values (if supported by the hardware).
This function might return the following errors:
- BUSY: Indicates that the hardware is busy with an existing operation or initialisation/calibration.
- NOSUPPORT: Indicates that the value of- hoursis not supported.