startOtaUpdate static method

Future<bool> startOtaUpdate(
  1. Uint8List fileBytes, {
  2. bool reset = false,
})

Start OTA firmware update process.

  • fileBytes: Raw bytes of the DFU file to upload
  • reset: Whether to reset the device after update (default: false)

Returns true if update started successfully, false otherwise.

Implementation

static Future<bool> startOtaUpdate(
  Uint8List fileBytes, {
  bool reset = false,
}) async {
  final ok = await _method.invokeMethod<bool>('startOtaUpdate', {
    'file': fileBytes,
    'reset': reset,
  });
  return ok ?? false;
}