BleTransport

class BleTransport(peripheral: Peripheral, address: String, parentContext: CoroutineContext = EmptyCoroutineContext) : RadioTransport(source)

BLE transport for Meshtastic radios using JuulLabs Kable.

Implements GATT framing: subscribes to fromnum notifications, drains fromradio until empty on each notification, writes to toradio with WriteWithoutResponse.

Strips/prepends the 4-byte stream header so the engine stays transport-agnostic. Single-collection frames; shutdown is idempotent and cannot be undone.

Parameters

peripheral

Kable peripheral pointing at the target radio.

address

stable platform-specific address for storage identity keying.

Constructors

Link copied to clipboard
constructor(peripheral: Peripheral, address: String, parentContext: CoroutineContext = EmptyCoroutineContext)

Properties

Link copied to clipboard
open override val identity: TransportIdentity
Link copied to clipboard
open override val state: StateFlow<TransportState>

Functions

Link copied to clipboard
open suspend override fun connect()
Link copied to clipboard
open suspend override fun disconnect()
Link copied to clipboard
open override fun frames(): Flow<Frame>

Cold flow over received frames. Single-collection only.

Link copied to clipboard
open suspend override fun send(frame: Frame)
Link copied to clipboard
fun shutdown()

Release internal coroutines and frame channel. Idempotent; does not close Peripheral.