Package-level declarations

Types

Link copied to clipboard
class BleOtaTimings(val connectionTimeout: Duration = 15.seconds, val subscriptionSettle: Duration = 500.milliseconds, val erasingTimeout: Duration = 60.seconds, val ackTimeout: Duration = 10.seconds, val verificationTimeout: Duration = 10.seconds, val rebootDelay: Duration = 5.seconds, val cacheRefreshReconnectDelay: Duration = 1.seconds)

Timings for the ESP32 unified OTA protocol over BLE.

Link copied to clipboard
class BleOtaTransport(scanner: BleScanner, connectionFactory: BleConnectionFactory, address: String, dispatcher: CoroutineDispatcher, timings: FirmwareUpdateTimings = FirmwareUpdateTimings()) : UnifiedOtaProtocol

BLE transport implementation for ESP32 Unified OTA protocol using Kable.

Link copied to clipboard
class BleScanTimings(val retryCount: Int = 3, val retryDelay: Duration = 2.seconds, val timeout: Duration = 10.seconds)

Scan retry shape for finding a device in its update mode.

Link copied to clipboard
Link copied to clipboard
class DfuSessionTimings(val gattReleaseDelay: Duration = 1_500.milliseconds, val rebootWait: Duration = 3.seconds, val connectAttempts: Int = 4, val connectRetryDelay: Duration = 2.seconds, val detectScanTimeout: Duration = 8.seconds, val sessionRetryDelay: Duration = 2.seconds, val resetPrimeRebootWait: Duration = 4.seconds, val bootloaderSwapTimeout: Duration = 6.minutes, val bootloaderSwapFirstScanDelay: Duration = 30.seconds, val preStartBudget: Duration = PRE_START_BUDGET, val legacySessionAttempts: Int = LEGACY_SESSION_ATTEMPTS, val limitedSessionAttempts: Int = LIMITED_SESSION_ATTEMPTS, val maxLegacyStaleResets: Int = MAX_LEGACY_STALE_RESETS)

Timings and attempt budgets for a whole nRF52 DFU run across reboots, detection and retries.

Link copied to clipboard
class DfuTransportTimings(val connectTimeout: Duration = 15.seconds, val commandTimeout: Duration = 30.seconds, val subscriptionSettle: Duration = 500.milliseconds, val streamTimeout: Duration = 15.minutes)

Timings both DFU transports share.

Link copied to clipboard
class Esp32OtaTimings(val preflightTimeout: Duration = 5.seconds, val transportRetryDelay: Duration = 2.seconds, val bleConnectAttempts: Int = 5, val wifiConnectAttempts: Int = 10, val wifiReadinessDelay: Duration = 8.seconds, val gattReleaseDelay: Duration = 1.seconds)

Timings for an ESP32 OTA run around the transport: entry confirmation, link release and retries.

Link copied to clipboard
Link copied to clipboard
class Esp32OtaUpdateHandler(meshLink: MeshLink, firmwareUpdateStatusRepository: FirmwareUpdateStatusRepository, environment: Esp32OtaUpdateEnvironment, bleScanner: BleScanner, bleConnectionFactory: BleConnectionFactory, dispatchers: CoroutineDispatchers, timings: FirmwareUpdateTimings = FirmwareUpdateTimings())

KMP handler for ESP32 firmware updates using the Unified OTA protocol. Supports both BLE and WiFi/TCP transports via UnifiedOtaProtocol. The caller obtains the firmware image.

Link copied to clipboard

KMP utility functions for firmware hash calculation.

Link copied to clipboard

A failed firmware update over the ESP32 unified OTA protocol or Nordic DFU.

Link copied to clipboard
class FirmwareUpdateTimings(val scan: BleScanTimings = BleScanTimings(), val dfu: DfuTransportTimings = DfuTransportTimings(), val secureDfu: SecureDfuTimings = SecureDfuTimings(), val legacyDfu: LegacyDfuTimings = LegacyDfuTimings(), val dfuSession: DfuSessionTimings = DfuSessionTimings(), val bleOta: BleOtaTimings = BleOtaTimings(), val esp32Ota: Esp32OtaTimings = Esp32OtaTimings())

Every timeout, delay and attempt budget the BLE firmware update engine uses, grouped by the component that reads it.

Link copied to clipboard
class LegacyDfuTimings(val resetWriteTimeout: Duration = 1.seconds, val startResponseTimeout: Duration = 90.seconds, val validateTimeout: Duration = 60.seconds, val disReadTimeout: Duration = 5.seconds)
Link copied to clipboard
interface MeshLink

What a firmware update needs from the app's mesh connection to the radio.

Link copied to clipboard
sealed class OtaCommand

Commands supported by the ESP32 Unified OTA protocol. All commands are text-based and terminated with '\n'.

Link copied to clipboard
sealed class OtaHandshakeStatus

Status updates during the OTA handshake.

Link copied to clipboard

Exception thrown during OTA protocol operations.

Link copied to clipboard
sealed class OtaResponse

Responses from the ESP32 Unified OTA protocol.

Link copied to clipboard
class SecureDfuTimings(val buttonlessResponseTimeout: Duration = 3.seconds, val triggerTimeout: Duration = 5.seconds, val retryDelay: Duration = 2.seconds, val firstChunkDelay: Duration = 400.milliseconds, val objectRetryCount: Int = 3)
Link copied to clipboard
class ThroughputTracker(windowSize: Int = 10, timeSource: TimeSource = TimeSource.Monotonic)

Sliding window throughput tracker to calculate current transfer speed in bytes per second. Adapted from kmp-ble's DfuProgress throughput tracking.

Link copied to clipboard

Interface for ESP32 Unified OTA protocol implementation. Supports both BLE and WiFi/TCP transports.

Link copied to clipboard
class WifiOtaTransport(deviceIpAddress: String, port: Int = DEFAULT_PORT) : UnifiedOtaProtocol

WiFi/TCP transport implementation for ESP32 Unified OTA protocol.