Module kmp-ble
Kotlin Multiplatform BLE library providing a coroutine-based API for Bluetooth Low Energy communication across Android, iOS, and JVM.
Core capabilities
-
BLE scanning with Flow-based advertisement streams
-
Connection lifecycle management with typed state machines
-
GATT read/write/notify operations with structured concurrency
-
Per-peripheral serial execution via
limitedParallelism(1)dispatcher
Getting started
Add the dependency to your KMP module:
commonMain.dependencies {
implementation("com.atruedev:kmp-ble:<version>")
}
All modules:
Performance measurement and telemetry utilities for kmp-ble.
Linux backend for kmp-ble on the JVM. Talks to BlueZ over the system D-Bus and registers itself through ServiceLoader, so the portable Scanner { }, Advertisement.toPeripheral(), BluetoothAdapter(), GattServer { }, and Advertiser() factories use it on Linux.
Format-agnostic codec layer for typed serialization and deserialization of BLE characteristic data.
Device Firmware Update (DFU) and Over-The-Air (OTA) update support for kmp-ble. Start with com.atruedev.kmpble.dfu.DfuController to perform firmware updates over BLE. Supports Nordic Secure DFU v2, MCUboot SMP, Espressif ESP OTA, L2CAP-based OTA, observable progress tracking, and resumable transfers across Android and iOS.
macOS (Apple silicon) backend for kmp-ble on the JVM. Drives CoreBluetooth through a bundled Objective-C shim loaded over JNI and registers itself through ServiceLoader, so the portable factories use it on macOS arm64.
STATUS: EXPERIMENTAL -- NOT PART OF THE 1.0 SCOPE
Type-safe BLE GATT profile definitions and characteristic parsers.
Curated OEM device quirks database for Android BLE.