A tokio-based Rust library that implements deCONZ Serial Protocol to interact with deCONZ devices.
Based on Serial Protocol specifications, tested with the ConBee USB gateway.
cargo build
cargo test
See example/src/main.rs
for a working example.
deconz_sp::Client
wraps the communication with the device.
The Tokio runtime must be started to use the client.
tokio::run(futures::lazy(|| {
let (client, notifications) = deconz_sp::Client::new("/dev/tty.usbserial-DM00ZSS9")
.expect("Cannot initialize deCONZ client");
// ...
}))
deconz_sp::Client::new
returns a tuple (Client, Stream<Item = IncomingPayload>)
where Client
is used to send requests to device, and Stream
is the stream of unsolicited received messages.
Run the example:
RUST_LOG=deconz_sp=TRACE cargo run
- tokio asynchronous run-time
- tokio_serial and mio_serial for serial I/O