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
//! # awear
//!
//! Rust client library for [AWEAR](https://www.awear.us) EEG devices over Bluetooth Low Energy.
//!
//! Handles BLE scanning, connection, HMAC-SHA256 challenge-response authentication,
//! LUCA protocol parsing, and real-time EEG data streaming via an async event channel.
//!
//! ## Quick Start
//!
//! ```no_run
//! use awear::prelude::*;
//!
//! #[tokio::main]
//! async fn main() -> anyhow::Result<()> {
//! let client = AwearClient::new(AwearClientConfig::default());
//! let (mut rx, handle) = client.connect().await?;
//! handle.start().await?;
//! while let Some(event) = rx.recv().await {
//! match event {
//! AwearEvent::Eeg(r) => println!("EEG: {} samples", r.samples.len()),
//! AwearEvent::Battery(b) => println!("Battery: {}%", b),
//! _ => {}
//! }
//! }
//! Ok(())
//! }
//! ```