Skip to content

Commit 1b851a5

Browse files
authored
moves things to zstack and adds more methods (#2)
* cleanup * log * async sleep * permit join * usb * test case * adding tests for parameters * device info * command status * device join * fix message response * never time out * correct timeout * adding device announce * on event should work * moves stuff to zstack * cleanup
1 parent 5f11fe5 commit 1b851a5

29 files changed

+1518
-369
lines changed

Cargo.lock

+186
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+11-7
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
serialport = {git = "https://github.com/serialport/serialport-rs", rev="18f5c2ab5e2b08d839fd6dd0d4c5624778da593b"}
8-
psila-data = {git = "https://github.com/blueluna/psila.git", rev = "9b87f44d3bad1ce04c8b4fae1e6e6819843db1cb", optional=true}
9-
ieee802154 = {version="0.6.1", optional=true}
10-
#pasts = {git = "https://github.com/ardaku/pasts", rev = "654db2358daddbf95543b5571a76d43daa1231bd"}
11-
futures = "0.3.3"
7+
serialport = {git = "https://github.com/serialport/serialport-rs", rev="18f5c2ab5e2b08d839fd6dd0d4c5624778da593b"}
8+
psila-data = {git = "https://github.com/blueluna/psila.git", rev = "9b87f44d3bad1ce04c8b4fae1e6e6819843db1cb", optional=true}
9+
ieee802154 = {version="0.6.1", optional=true}
10+
futures = {version="0.3.3", features=["thread-pool"]}
11+
log = {version = "0.4.22", default-features = false, optional = true}
12+
13+
[dev-dependencies]
14+
env_logger = { version = "0.11.5", default-features = false, features = ["auto-color"] }
1215

1316
[features]
14-
default = ["cc2531x", "psila"]
17+
default = ["cc2531x", "psila", "log"]
1518
psila = ["psila-data", "ieee802154"]
1619
cc2531x = []
17-
usbportinfo-interface = []
20+
usbportinfo-interface = []
21+
log = ["dep:log"]

examples/cc253x.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
//use pasts::Executor;
22
use futures::executor::block_on;
33
use rusty_zigbee_dongle::{
4-
cc253x::CC253X,
54
coordinator::{Coordinator, CoordinatorError, LedStatus},
5+
zstack::cc253x::CC253X,
66
};
77
use std::path::PathBuf;
88

99
fn main() {
10+
#[cfg(feature = "log")]
11+
env_logger::init();
12+
1013
let f = async {
1114
let cc2531 = CC253X::from_path(PathBuf::from("/dev/ttyACM0"), 115_200).unwrap();
1215

@@ -16,7 +19,8 @@ fn main() {
1619
Ok::<(), CoordinatorError>(())
1720
};
1821
let b = async {
19-
println!("version: {:?}", cc2531.version().await);
22+
let version = cc2531.version().await.unwrap();
23+
println!("version: {:?}", version);
2024
Ok::<(), CoordinatorError>(())
2125
};
2226
futures::try_join!(a, b)

0 commit comments

Comments
 (0)