| Crates.io | spike_prime |
| lib.rs | spike_prime |
| version | 1.1.1 |
| created_at | 2025-07-20 14:02:50.95907+00 |
| updated_at | 2025-07-21 02:05:11.322882+00 |
| description | Wrapper around the SPIKE Prime communication protocol. |
| homepage | |
| repository | https://github.com/DDAN-17/spike-prime |
| max_upload_size | |
| id | 1761080 |
| size | 94,167 |
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.