BleOtaTransport

class BleOtaTransport(scanner: BleScanner, connectionFactory: BleConnectionFactory, address: String, dispatcher: CoroutineDispatcher) : UnifiedOtaProtocol(source)

BLE transport implementation for ESP32 Unified OTA protocol using Kable.

Constructors

Link copied to clipboard
constructor(scanner: BleScanner, connectionFactory: BleConnectionFactory, address: String, dispatcher: CoroutineDispatcher)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend override fun close()

Close the connection and cleanup resources.

Link copied to clipboard
open suspend override fun connect(): Result<Unit>

Connect to the device and discover OTA service/establish connection.

Link copied to clipboard
open suspend override fun startOta(sizeBytes: Long, sha256Hash: String, onHandshakeStatus: suspend (OtaHandshakeStatus) -> Unit = {}): Result<Unit>

Start OTA update process.

Link copied to clipboard
open suspend override fun streamFirmware(data: ByteArray, chunkSize: Int, onProgress: suspend (Float) -> Unit): Result<Unit>

Stream firmware binary data to the device.