DfuTransport

Abstraction over the BLE link used to send DFU commands and data.

Built-in implementations:

  • GattDfuTransport — uses DFU Control Point and DFU Packet characteristics

  • L2capDfuTransport — L2CAP CoC channel for higher throughput (commands via GATT)

  • SmpTransport — single SMP characteristic with response reassembly (MCUboot)

  • EspOtaTransport — dual-characteristic OTA control/data (Espressif ESP-IDF)

Implement this interface to support custom transport mechanisms.

See also

Inheritors

Properties

Link copied to clipboard
abstract val mtu: Int

Maximum payload size per write, in bytes.

Link copied to clipboard
abstract val notifications: Flow<ByteArray>

Incoming notifications from the DFU Control Point characteristic.

Functions

Link copied to clipboard
abstract override fun close()

Release transport resources synchronously.

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

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

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

Write firmware data to the peripheral.