firmwareUpdate
Firmware update
Update stm32 firmware / Bluetooth firmware version. Firmware upgrades are supported in two ways:
Use the firmware upgrade resource on the OneKey server and simply pass in the version number.
Use the user-specified binary data to upgrade the firmware. Use this method with caution; incorrect data can result in hardware data loss.
const response = await HardwareSDK.firmwareUpdate(connectId, params);
Params
updateType
— required'firmware' | 'ble'
firmware upgrade typebinary
— optionalArrayBuffer
firmware binary data when you upgrade with a custom fileversion
— optionalArray
specifying the firmware version number will match the version information in the resource list provided by OneKey
Example
const response = await HardwareSDK.firmwareUpdate(connectId, {
updateType: 'firmware',
version: [2, 10, 0]
});
Result
{
success: true,
payload: {
message: string
}
}
Error
{
success: false,
payload: {
error: string, // error message
code: number // error code
}
}
Last updated
Was this helpful?