Package-level declarations

Types

Link copied to clipboard
class AndroidBluetoothRepository(context: Context, dispatchers: CoroutineDispatchers, processLifecycle: Lifecycle) : BluetoothRepository

Android implementation of BluetoothRepository.

Link copied to clipboard
data class BleCharacteristic(val uuid: Uuid)

Identifies a characteristic within a profiled BLE service.

Link copied to clipboard
interface BleConnection

Encapsulates a BLE connection to a BleDevice.

Link copied to clipboard

A factory for creating BleConnection instances.

Link copied to clipboard
sealed interface BleConnectionState

Represents the state of a BLE connection.

Link copied to clipboard
interface BleDevice

Represents a BLE device.

Link copied to clipboard
data class BleExceptionInfo(val isPermanent: Boolean, val gattStatus: Int? = null, val message: String)

Classification of a BLE-layer exception for the transport layer to act on.

Link copied to clipboard

Format for Kable's internal BLE log entries.

Link copied to clipboard
data class BleLoggingConfig(val level: BleLogLevel, val format: BleLogFormat = BleLogFormat.Compact)

Verbosity and formatting controls for Kable's internal BLE logging.

Link copied to clipboard

Verbosity for Kable's internal BLE logging. Wraps Logging.Level so callers and the Koin DI graph don't leak Kable types into modules that don't directly depend on Kable.

Link copied to clipboard
interface BleScanner

A scanner for BLE devices.

Link copied to clipboard
interface BleService

Represents a BLE service for commonMain.

Link copied to clipboard

Represents the type of write operation.

Link copied to clipboard

Repository responsible for Bluetooth availability and bonding.

Link copied to clipboard
data class BluetoothState(val hasPermissions: Boolean = false, val enabled: Boolean = false, val bondedDevices: List<BleDevice> = emptyList())

Represents the state of Bluetooth on the device.

Link copied to clipboard
sealed interface DisconnectReason

Platform-agnostic reason for a BLE disconnect.

Link copied to clipboard
class KableBleConnection(scope: CoroutineScope, loggingConfig: BleLoggingConfig) : BleConnection

BleConnection implementation using Kable for cross-platform BLE communication.

Link copied to clipboard
Link copied to clipboard
class KableBleService(peripheral: Peripheral, serviceUuid: Uuid) : BleService

BleService implementation backed by a Kable Peripheral for a specific GATT service.

Link copied to clipboard

MeshtasticRadioProfile implementation using Kable BLE characteristics.

Link copied to clipboard

Constants for Meshtastic Bluetooth LE interaction.

Link copied to clipboard
class MeshtasticBleDevice(val address: String, val name: String? = null, val advertisement: Advertisement? = null) : BleDevice

Unified BleDevice implementation for all BLE devices — scanned, bonded, or both.

Link copied to clipboard

A definition of the Meshtastic BLE Service profile.

Properties

Link copied to clipboard

Safe ATT payload length when MTU negotiation is unavailable (23-byte ATT MTU minus 3-byte header).

Functions

Link copied to clipboard

Inspects this Throwable and returns a BleExceptionInfo if it is a known Kable exception, or null if it is unrelated to the BLE layer.

Link copied to clipboard
suspend fun <T> retryBleOperation(count: Int = 3, delayMs: Long = 250, tag: String = "BLE", block: suspend () -> T): T

Retries a BLE operation with bounded exponential backoff and jitter.

Link copied to clipboard
fun State.toBleConnectionState(hasStartedConnecting: Boolean): BleConnectionState?

Maps Kable's State to Meshtastic's BleConnectionState.

Link copied to clipboard
fun State.Disconnected.Status?.toDisconnectReason(): DisconnectReason

Maps Kable's State.Disconnected.Status to DisconnectReason.