spike_prime

Crates.iospike_prime
lib.rsspike_prime
version1.1.1
created_at2025-07-20 14:02:50.95907+00
updated_at2025-07-21 02:05:11.322882+00
descriptionWrapper around the SPIKE Prime communication protocol.
homepage
repositoryhttps://github.com/DDAN-17/spike-prime
max_upload_size
id1761080
size94,167
DDAN (DDAN-17)

documentation

https://docs.rs/spike-prime

README

spike-prime

spike-prime is a library wrapping the SPIKE Prime BLE GATT protocol. If you run into any issues, or have an issue with the crate, feel free to open a GitHub issue, and I'll respond as soon as I can.

To use it, first create an Adapter using btleplug:

use spike_prime::prelude::*;

let manager = Manager::new().await?;
let adapter = manager.adapters().await?.drain(..).next().unwrap();

Then, receive a SpikePrime device:

let device = SpikePrime::scan_first(&adapter).await?;

You can also use SpikePrime::scan() to get a stream of devices:

let mut stream = SpikePrime::scan(&adapter).await?;
stream.next().await;
let device = stream.next().await.unwrap();

After you have the device, connect to it:

let connection = device.connect().await?;

Then, you can use the built-in functions to communicate with the device, or you can use SpikeConnection::send_message to send custom messages.

Commit count: 0

cargo fmt