startFirmwareOta 开始ota升级

startFirmwareOta ^6.8

开始ota升级

#请求参数

Prop Type Default Comment
mac String N/A 12位蓝牙Mac地址
name String N/A 蓝牙名称
source String N/A bin文件路径

#接口调用示例

const params = {
  mac: 'xxxx', //12位蓝牙Mac地址
  name: 'midea_xx_xxxx', //蓝牙名称
  source: 'xxx', //bin文件路径
}
this.$bridge
  .startFirmwareOta(params)
  .then(res => {
    this.$alert(res)
  })
  .catch(err => {
    this.$toast(err)
  })

#获取接口返回结果

this.$bridge
  .addEventListener('receiveSingleBlueOtaProcess', res=>console.log(res))

#返回参数

  • 成功时返回
Prop Type Default Description
messageType String N/A receiveSingleBlueOtaProcess
messageBody Object N/A
  • messageBody 对象属性
Prop Type Default Description
data Object N/A
name String N/A
mac String N/A
  • data 对象属性
Prop Type Default Description
process Number N/A 1,查询固件版本信息,2查询boot版信息,3:擦拭空间, 4:请求写入, 5:写数据(写数据进度看progress), 6:crc校验, 7:升级指令
status Number N/A 0:成功, -1:失败,或者其他的异常错误码
progress Number N/A 写bin文件进度,当process=5时使用
  • 失败时返回
posted on 2024-12-21 14:43  AtlasLapetos  阅读(9)  评论(0)    收藏  举报