startFirmwareOta 开始ota升级
startFirmwareOta ^5.9.0
开始ota升级
#请求参数
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
param |
Object |
Y |
{} 属性: name: mac: source: |
请求参数 |
#接口调用示例
let param={
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)
})
#返回参数
- 通过监听 receiveMessageFromApp 获取
- 成功时返回
| Prop | Type | Default | Description |
|---|---|---|---|
messageType |
String |
receiveSingleBlueOtaProcess |
H5用来判断消息类型 |
messageBody |
Object |
{}附表1 |
APP传递的JSON对象 |
- 附表1:messageBody返回参数
| Prop | Type | Value | Description |
|---|---|---|---|
name |
String |
Y |
N/A |
mac |
String |
Y |
N/A |
data |
Object |
{} 属性: status:{ Type: Number, Default: N/A, Description: 0成功 / -1失败/其他(状态码) } process:{ Type: Number, Default: N/A, Description: 1查询固件版本信息 / 2查询boot版信息 / 3擦拭空间 / 4请求写入 / 5写数据(写数据进度看progress) / 6crc校验 / 7升级指令(进程名) } progress:{ Type: Number, Default: N/A, Description: 写bin文件进度(当process=5时使用) } |
全状态数据 |
TIP
该接口基于mSmart 协议,底层由singleBlueToothModule单蓝牙支持
浙公网安备 33010602011771号