Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.24 KB

README.md

File metadata and controls

42 lines (28 loc) · 1.24 KB

deconz-sp

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.

⚠️ Work in progress, library is not finalized. Do not use in production. ⚠️

Build

cargo build
cargo test

Example

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

Built With