1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! High-level BLE communication library.
//!
//! The goal of this library is to provide an easy-to-use interface
//! for communicating with BLE devices, that satisfies most use cases.
//!
//! ## Usage
//!
//! Here is an example on how to find a device with battery level characteristic and read
//! a value from that characteristic:
//!
//! ```rust,no_run
//! use bleasy::common::characteristics::BATTERY_LEVEL;
//! use bleasy::{Error, ScanConfig, Scanner};
//! use futures::StreamExt;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Error> {
//! pretty_env_logger::init();
//!
//! // Create a filter for devices that have battery level characteristic
//! let config = ScanConfig::default()
//! .filter_by_characteristics(|uuids| uuids.contains(&BATTERY_LEVEL))
//! .stop_after_first_match();
//!
//! // Start scanning for devices
//! let mut scanner = Scanner::new().await?;
//! scanner.start(config).await?;
//!
//! // Take the first discovered device
//! let device = scanner.device_stream().next().await.unwrap();
//! println!("{:?}", device);
//!
//! // Read the battery level
//! let battery_level = device.characteristic(BATTERY_LEVEL).await?.unwrap();
//! println!("Battery level: {:?}", battery_level.read().await?);
//!
//! Ok(())
//! }
//!```
pub use ;
pub use Characteristic;
pub use Device;
pub use ;
pub use Service;