EspOtaTransport

class EspOtaTransport(peripheral: Peripheral, config: DfuTransportConfig.EspOta, commandTimeout: Duration) : DfuTransport

Espressif ESP-IDF OTA transport.

Commands are sent to the OTA control characteristic (write with response), firmware data is written to the OTA data characteristic (write without response for throughput). Notifications on the control characteristic deliver command responses.

Constructors

Link copied to clipboard
constructor(peripheral: Peripheral, config: DfuTransportConfig.EspOta, commandTimeout: Duration)

Properties

Link copied to clipboard
open override val mtu: Int

Maximum payload size per write, in bytes.

Link copied to clipboard
open override val notifications: Flow<ByteArray>

Incoming notifications from the DFU Control Point characteristic.

Functions

Link copied to clipboard
open override fun close()

Release transport resources synchronously.

Link copied to clipboard
open suspend override fun sendCommand(data: ByteArray): ByteArray

Write a command to the DFU Control Point and wait for the response notification.

Link copied to clipboard

Send a command where the device is expected to disconnect or reboot before responding (e.g. reset commands).

Link copied to clipboard
open suspend override fun sendData(data: ByteArray)

Write firmware data to the peripheral.