WifiOtaTransport

class WifiOtaTransport(deviceIpAddress: String, port: Int = DEFAULT_PORT) : UnifiedOtaProtocol(source)

WiFi/TCP transport implementation for ESP32 Unified OTA protocol.

Uses UDP for device discovery on port 3232, then establishes TCP connection for OTA commands and firmware streaming.

Unlike BLE, WiFi transport:

  • Uses synchronous TCP (no manual ACK waiting)

  • Supports larger chunk sizes (up to 1024 bytes)

  • Generally faster transfer speeds

Constructors

Link copied to clipboard
constructor(deviceIpAddress: String, port: Int = DEFAULT_PORT)

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 via TCP.

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.