Expand description
§Windows BLE GATT Server
A simple, ergonomic BLE GATT server library for Windows using WinRT APIs.
§Features
- Create BLE GATT services with multiple read/notify characteristics
- Automatic adapter discovery and selection
- Async/await support with Tokio
- Simple data broadcast via notifications
§Example
use ble_windows_server::WindowsBLEGattServer;
use uuid::Uuid;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let service_uuid = Uuid::parse_str("12345678-1234-5678-1234-567812345678")?;
let char_uuid = Uuid::from_u128(service_uuid.as_u128() + 1);
let mut server = WindowsBLEGattServer::new("MyDevice".into(), service_uuid);
server.add_characteristic("message", char_uuid, "A message");
server.start().await?;
server.notify("message", b"Hello BLE!").await?;
Ok(())
}Structs§
- Adapter
Info - SRS-003: Bluetooth adapter information.
- Uuid
- A Universally Unique Identifier (UUID).
- WindowsBLE
Gatt Server - SRS-006: Windows BLE GATT Server.
Enums§
- BleError
- SRS-001: Unified error type for all BLE operations.
Functions§
- list_
adapters - SRS-004: Enumerate all Bluetooth adapters on the system.
- list_
radios - SRS-005: List all Bluetooth radios (debug utility).
Type Aliases§
- Result
- SRS-002: Standard Result type alias for the library.