OTA

OTA Manager

Header File

quick_dev/common/ota/ota_mngr.h

API List

API Name
OTA_Init
OTA_CurrentVersionGet
OTA_UpgradeBegin
OTA_WriteData
OTA_UpgradeFinish
OTA_UpgradeGiveUp
OTA_TriggerReboot

Functions


OTA_Init
  • Prototype
void OTA_Init(void);
  • Description

  OTA manager initiate function

  • Return

  None

  • Parameters

  None


OTA_CurrentVersionGet
  • Prototype
T_OplErr OTA_CurrentVersionGet(uint16_t *u16PrjId, uint16_t *u16ChipId, uint16_t *u16FwId);
  • Description

  Get current OTA version

  • Return

  Reference to opl_err

  • Parameters

  u16PrjId: current project ID

  u16ChipId: current chip ID

  u16FwId: current firmware version


OTA_UpgradeBegin
  • Prototype
T_OplErr OTA_UpgradeBegin(uint16_t *pu16SeqId, T_MwOtaFlashHeader *ptOtaHdr, T_OtaProcTimeoutIndCbFp tOtaProcTimeoutIndCb);
  • Description

  Begin OTA upgrade

  • Return

  Reference to opl_err

  • Parameters

  pu16SeqId: OTA sequence number

  ptOtaHdr:

  tOtaProcTimeoutIndCb:


OTA_WriteData
  • Prototype
T_OplErr OTA_WriteData(uint16_t u16SeqId, uint8_t *pu8Data, uint32_t u32DataLen);
  • Description

  Write OTA raw data function

  • Return

  Reference to opl_err

  • Parameters

  u16SeqId: OTA sequence number

  pu8Data: OTA raw data

  u32DataLen: OTA raw data lens


OTA_UpgradeFinish
  • Prototype
T_OplErr OTA_UpgradeFinish(uint16_t u16SeqId);
  • Description

  Finish OTA upgrade function, if OTA upgrade successfully

  • Return

  Reference to opl_err

  • Parameters

  u16SeqId: OTA sequence number


OTA_UpgradeGiveUp
  • Prototype
T_OplErr OTA_UpgradeGiveUp(uint16_t u16SeqId);
  • Description

  Give up OTA upgrade

  • Return

  Reference to opl_err

  • Parameters

  u16SeqId: OTA sequence number


OTA_TriggerReboot
  • Prototype
T_OplErr OTA_TriggerReboot(uint16_t u16Delay);
  • Description

  Reboot after OTA update successfully

  • Return

  Reference to opl_err

  • Parameters

  u16Delay: delay timer (ms) to trgger reboot