# Rust Remote for ISLabTech UPW Sensor
Rust client library to communicate with the [ISLabTech UPW Sensor](https://gitlab.com/islabtech/upw-sensor)
## Examples
Examples can be found in the [examples directory](https://gitlab.com/islabtech/upw-sensor/remote-rs/-/tree/main/examples). Try out the [**Getting Started**](https://gitlab.com/islabtech/upw-sensor/remote-rs/-/blob/main/examples/0100%20getting%20started.rs) example.
```rust
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](https://www.apache.org/licenses/LICENSE-2.0) license.