Skip to content

Commit

Permalink
Merge pull request #9
Browse files Browse the repository at this point in the history
Rewrite to newer versions of dependencies and tokio
  • Loading branch information
aklajnert authored Feb 12, 2022
2 parents 4c6901e + 099d627 commit 7bc45e4
Show file tree
Hide file tree
Showing 3 changed files with 187 additions and 142 deletions.
11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "idasen"
version = "0.1.4"
version = "0.2.0"
authors = ["Andrzej Klajnert <[email protected]>"]
edition = "2018"
license = "MIT"
Expand All @@ -15,8 +15,9 @@ exclude = [".github/workflows",]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
btleplug = "0.7.2"
btleplug = "0.9.1"
indicatif = "0.16.2"
thiserror = "1.0.30"
tokio = "1.16.1"
tokio-stream = "0.1.8"
uuid = "0.8.2"
failure = "0.1.8"
failure_derive = "0.1.8"
indicatif = "0.15.0"
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use idasen::{get_instance, Idasen, Device};

// instantiate the struct, this will attempt to connect to the desk
// and discover its characteristics
let desk: Idasen<impl Device> = get_instance()?;
let desk: Idasen<impl Device> = get_instance().await?;

// alternatively, if there's more than one desk you can get the
// correct one by it's mac address
Expand All @@ -21,15 +21,15 @@ let desk: Idasen<impl Device> = get_instance()?;
// let desk = get_instance_by_mac("EC:86:F6:44:D3:31")?;

// move desk up and down
desk.up();
desk.down();
desk.up().await;
desk.down().await;

// stop desk from moving
desk.stop();
desk.stop().await;

// move desk to desired position:
// minimum: 6200 (62cm), maximum: 12700 (1.27m)
desk.move_to(7400);
desk.move_to(7400).await;

// get the position as an integer (10 = 1mm)
println!("Position: {}", desk.position()?);
Expand Down
Loading

0 comments on commit 7bc45e4

Please sign in to comment.