HarmonyOS Native SDK
OTA
Check for Update

Check for Firmware Updates

The current Harmony SDK performs upgrades over BLE OTA. Before checking, the advertisement must declare OTA support, the device must have a cloud Device ID, and current hardware and software versions must be readable.

checkUpdate

import {
  GizCheckUpdateResultInfo,
  GizOTAFirmwareType,
} from '@gizwits/smart-sdk';
 
const update: GizCheckUpdateResultInfo = await device.bleCapability.checkUpdate(
  device,
  GizOTAFirmwareType.MCU
);
 
const hasUpdate: boolean = update.downloadUrl.length > 0;

MODULE identifies communication-module firmware and MCU identifies device MCU firmware. Update ArkUI from the result or exception when no release is available, device data is incomplete, or the request fails.