Skip to main content

Crate anker_solix

Crate anker_solix 

Source
Expand description

anker_solix — a lightweight library for monitoring and controlling Anker SOLIX portable power stations over Bluetooth LE, with no cloud or app.

The heavy lifting lives in device::Device: it discovers a station, performs the fixed ECDH handshake, and then exchanges AES-128-CBC encrypted telemetry and control packets.

use anker_solix::Device;
use std::time::Duration;

let mut dev = Device::find_and_connect("C1000", 5).await?;
let t = dev.next_telemetry(Duration::from_secs(10)).await?;
println!("battery: {:?}%", t.battery_percentage);
dev.set_ac(true).await?;

Re-exports§

pub use device::scan;
pub use device::Device;
pub use device::Discovered;
pub use error::AnkerError;
pub use error::Result;
pub use model::Brightness;
pub use model::Model;
pub use model::Port;
pub use model::PortStatus;
pub use model::Telemetry;

Modules§

crypto
Cryptography for the SOLIX BLE session.
device
Async BLE session with a SOLIX power station: discovery, the ECDH negotiation handshake, encrypted command transmission and telemetry receive.
error
model
Model detection, telemetry decoding and control commands for SOLIX portable power stations.
protocol
Wire protocol for Anker SOLIX BLE: packet framing, TLV parameter parsing, fragment reassembly and the fixed negotiation handshake constants.