このページの内容
firmwareUpdateV3
ファームウェア更新 (V3)
OneKey Pro 用の Protocol V1 更新フロー。必要に応じて Bootloader、メインファームウェア、BLE ファームウェア、リソースパッケージを 1 つのフローで更新できます。
- デバイス: OneKey Pro (Protocol V1) のみ
- 起動要件: Boot バージョン ≥ 4.8.0
- Pro 2 / Neo: 次を使用: firmwareUpdateV4
// Select versions from verified release metadata for this device.
declare const targetFirmwareVersion: number[];
declare const targetBleVersion: number[];
declare const targetBootloaderVersion: number[];
const res = await HardwareSDK.firmwareUpdateV3(connectId, {
platform: 'desktop', // 'native' | 'desktop' | 'ext' | 'web' | 'web-embed'
// Option A: specify versions (pick any subset)
firmwareVersion: targetFirmwareVersion,
bleVersion: targetBleVersion,
bootloaderVersion: targetBootloaderVersion,
// Option B: custom binaries (as needed)
// firmwareBinary: ArrayBuffer,
// bleBinary: ArrayBuffer,
// bootloaderBinary: ArrayBuffer,
// resourceBinary: ArrayBuffer,
// Optional: force updating resource package
forcedUpdateRes: false,
});
if (!res.success) throw new Error(res.payload.error);この例は、ユーザーがデバイスを選択して更新を承認済みであることを前提とします。対象バージョンは検証済みリリースメタデータから取得し、ドキュメントからコピーしたバージョンをハードコードしないでください。
パラメーター
platform- 必須"native" | "desktop" | "ext" | "web" | "web-embed"実行環境firmwareVersion- 任意number[]対象のメインファームウェアバージョンfirmwareBinary- 任意ArrayBufferカスタムメインファームウェアbleVersion- 任意number[]対象の BLE ファームウェアバージョンbleBinary- 任意ArrayBufferカスタム BLE ファームウェアbootloaderVersion- 任意number[]対象の Bootloader バージョンbootloaderBinary- 任意ArrayBufferカスタム BootloaderresourceBinary- 任意ArrayBufferリソースパッケージのバイナリforcedUpdateRes- 任意booleanリソースパッケージの更新を強制
結果
{
success: true,
payload: {
bleVersion: string,
firmwareVersion: string,
bootloaderVersion: string,
}
}エラー
{
success: false,
payload: {
error: string, // error message
code?: string | number // error code
}
}最終更新日