BleRadioTransport

class BleRadioTransport(scope: CoroutineScope, scanner: BleScanner, bluetoothRepository: BluetoothRepository, connectionFactory: BleConnectionFactory, callback: RadioTransportCallback, address: String) : RadioTransport(source)

A RadioTransport implementation for BLE devices using the common BLE abstractions (which are powered by Kable).

This class handles the high-level connection lifecycle for Meshtastic radios over BLE, including:

  • Bonding and discovery.

  • Automatic reconnection logic.

  • MTU and connection parameter monitoring.

  • Routing raw byte packets between the radio and RadioTransportCallback.

Parameters

scope

The coroutine scope to use for launching coroutines.

scanner

The BLE scanner.

bluetoothRepository

The Bluetooth repository.

connectionFactory

The BLE connection factory.

callback

The RadioTransportCallback to use for handling radio events.

address

The BLE address of the device to connect to.

Constructors

Link copied to clipboard
constructor(scope: CoroutineScope, scanner: BleScanner, bluetoothRepository: BluetoothRepository, connectionFactory: BleConnectionFactory, callback: RadioTransportCallback, address: String)

Functions

Link copied to clipboard
open suspend override fun close()

Closes the connection to the device.

Link copied to clipboard
open override fun handleSendToRadio(p: ByteArray)

Sends a packet to the radio with retry support.

Link copied to clipboard
open override fun keepAlive()
Link copied to clipboard
open override fun start()