transferFirmware
abstract suspend fun transferFirmware(firmware: ByteArray, onProgress: suspend (Float) -> Unit): Result<Unit>(source)
Upload the firmware binary (.bin). onProgress is invoked with a value in [0.0, 1.0] after each protocol checkpoint (PRN window or end-of-image).
open suspend fun transferFirmware(firmware: ByteArray, onPhase: suspend (DfuUploadPhase) -> Unit, onProgress: suspend (Float) -> Unit): Result<Unit>(source)
As transferFirmware, additionally reporting coarse DfuUploadPhase transitions so the UI can explain a wait that produces no progress (Legacy DFU erases the whole application region before it accepts a single byte). Transports without a meaningful prepare step keep the default, which never reports a phase.