Skip to main content

Firmware Update V2

V2 Flow

firmwareUpdateV2 Used to perform main firmware or Bluetooth firmware upgrade. Applications need to explicitly pass in platform and specify whether the update target is the main firmware or the BLE firmware. Updating with official version numbers is the usual path; use custom binaries only in controlled environments.

const opResult = await ukeySdk.firmwareUpdateV2(connectId, {
platform: "desktop", // choose from 'native' | 'desktop' | 'ext' | 'web' | 'web-embed'
updateType: "firmware", // you can also switch this to 'ble'
// Method A: update by version number (preferred)
version: [1, 0, 0],
// Path B: pass custom binaries directly (use with caution)
// binary: ArrayBuffer, // 也可以直接传二进制内容
// Additional update switches
forcedUpdateRes: false,
isUpdateBootloader: false,
});

Input Fields

Reusable request options

  • platform - "native" | "desktop" | "ext" | "web" | "web-embed"; runtime environment for the update flow.
  • updateType - 'firmware' | 'ble'; selects whether the main firmware or Bluetooth firmware is updated.
  • version - number[]; target three-part version. When provided, the matching official firmware package is downloaded.
  • binary - ArrayBuffer; custom firmware payload for controlled scenarios only.
  • forcedUpdateRes - boolean; refresh the resource package even when it would normally be skipped.
  • isUpdateBootloader - boolean; include the bootloader stage in the V2 update flow.

Result

{
success: true,
payload: {
// Note: Success ID returned by the bottom layer
}
}

Errors

{
success: false,
payload: {
error: string, // Error message text
code: number // Error code value
}
}