Skip to Content
HardwareDevice APIfirmwareUpdateV2
On this page

firmwareUpdateV2

Firmware update (V2)

Protocol V1 firmware update flow. Supports downloading and updating Main firmware and BLE firmware. You must explicitly pass a platform.

// Select versions from verified release metadata for this device. declare const targetFirmwareVersion: number[]; const res = await HardwareSDK.firmwareUpdateV2(connectId, { platform: 'desktop', // 'native' | 'desktop' | 'ext' | 'web' | 'web-embed' updateType: 'firmware', // or 'ble' // Option A: version-based update (recommended) version: targetFirmwareVersion, // Option B: custom binary (use with caution) // binary: ArrayBuffer, // Optional flags forcedUpdateRes: false, isUpdateBootloader: false, }); if (!res.success) throw new Error(res.payload.error);

The example assumes the user has selected this device and approved the update. Resolve target versions from verified release metadata; do not hard-code a version copied from documentation.

Params

Optional common params

  • platform - required "native" | "desktop" | "ext" | "web" | "web-embed" execution environment
  • updateType - required 'firmware' | 'ble' update target (main firmware or BLE)
  • version - optional number[] target version as a 3‑part array; downloads official firmware for that version
  • binary - optional ArrayBuffer custom firmware binary; use with caution
  • forcedUpdateRes - optional boolean force updating resource package
  • isUpdateBootloader - optional boolean include Bootloader update

Result

{ success: true, payload: { // success indicator from lower layer } }

Error

{ success: false, payload: { error: string, // error message code?: string | number // error code } }
Last updated on