1use ble_ledly::capability::color::*;
2use ble_ledly::communication_protocol::GenericRGB;
3use ble_ledly::device::LedDevice;
4use ble_ledly::device::{CharKind, UuidKind};
5use ble_ledly::Controller;
6
7use std::error::Error;
8
9#[tokio::main]
10async fn main() -> Result<(), Box<dyn Error>> {
11 let mut controller = Controller::<LedDevice>::new_with_prefix("QHM-").await?;
14
15 controller.connect().await?;
17
18 let protocol = GenericRGB::default();
20
21 controller.set_all_char(&CharKind::Write, &UuidKind::Uuid16(0xFFD9))?;
24
25 let first_light = controller.list().get(0).unwrap();
27 first_light.color(&protocol, 255, 0, 0).await?;
28
29 Ok(())
30}