#sensor #lab #automation #api-bindings #remote-control #upw #ultra-pure-water

islabtech-upw-sensor-v1

Rust client library for remote control of the ISLabTech UPW Sensor v1

4 releases

0.1.4 May 28, 2024
0.1.3 May 25, 2024
0.1.1 May 22, 2024
0.1.0 May 22, 2024

#309 in Asynchronous

Download history 372/week @ 2024-05-21 132/week @ 2024-05-28 2/week @ 2024-06-04 2/week @ 2024-06-11

508 downloads per month

Apache-2.0

29KB
551 lines

Rust Remote for ISLabTech UPW Sensor

Rust client library to communicate with the ISLabTech UPW Sensor

Examples

Examples can be found in the examples directory. Try out the Getting Started example.

use islabtech_upw_sensor_v1::{connect_via_network_on_port, Device, Error};
use tokio; // use `await` in main function
use std::{thread::sleep, time::Duration};

#[tokio::main]
async fn main() -> Result<(), Error> {
    let sensor = connect_via_network_on_port(
        "192.168.1.123".parse().unwrap(),
        80.into(),          // port (defaults to 80)
        Default::default(), // TLS
    );
    loop {
        let measurement = sensor.latest_measurement().await?;
        println!("measurement: {measurement:?}");
        sleep(Duration::from_secs(1))
    }
}

License

This project is licensed under the Apache 2 license.

Dependencies

~5–19MB
~245K SLoC