pub struct SensorWiring {
pub part: Part,
pub bus: Option<String>,
pub address: Option<u8>,
pub serial: Option<String>,
pub readings: Vec<f32>,
pub offset: f32,
pub scale: f32,
}Expand description
The part that takes the readings, and where it is.
In a wiring file it is the sensor object:
{ "part": "bme280", "bus": "/dev/i2c-1", "address": "0x76" }Fields§
§part: PartThe part.
bus: Option<String>The I2C bus the part is on, such as /dev/i2c-1, or sim for the part’s simulated
twin, which answers with one fixed measurement.
address: Option<u8>The part’s I2C address, when it is not the part’s usual one.
serial: Option<String>A DS18B20’s 1-Wire serial, such as 28-0316a2795cff, as the kernel names its folder.
readings: Vec<f32>The readings a replay part plays back in turn, in the unit the profile reads.
offset: f32Added to each reading after it is in the profile’s unit, to correct a probe that reads high or low.
scale: f32Multiplied into each reading before the offset is added.
Trait Implementations§
Source§impl Clone for SensorWiring
impl Clone for SensorWiring
Source§fn clone(&self) -> SensorWiring
fn clone(&self) -> SensorWiring
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SensorWiring
impl Debug for SensorWiring
Source§impl<'de> Deserialize<'de> for SensorWiring
impl<'de> Deserialize<'de> for SensorWiring
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SensorWiring
impl PartialEq for SensorWiring
Source§impl Serialize for SensorWiring
impl Serialize for SensorWiring
impl StructuralPartialEq for SensorWiring
Auto Trait Implementations§
impl Freeze for SensorWiring
impl RefUnwindSafe for SensorWiring
impl Send for SensorWiring
impl Sync for SensorWiring
impl Unpin for SensorWiring
impl UnsafeUnpin for SensorWiring
impl UnwindSafe for SensorWiring
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more