setupBlueConnection 根据蓝牙信息建立蓝牙连接
setupBlueConnection ^5.9.0
根据蓝牙信息建立蓝牙连接
提示:扫描到设备之后再建立蓝牙连接
#请求参数
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
param |
Object |
Y |
{} 属性: name:{ Type: String, Default: N/A, Type: String, Default: N/A, Description: 鉴权密钥(长度32) (可以从getDeviceInfo中读取deviceBtToken<) mac:{ Type: String, Default: N/A, Description: 蓝牙mac地址,((可以使用getDeviceInfo中返回的mac字段)) applianceId:{ Type: String, Default: N/A, Description: 设备id,(可以从getDeviceInfo中读取deviceId<) moduleType: |
请求参数 |
#接口调用示例
let param={
name:"midea_xx_xxxx", //蓝牙名称,从getDeviceInfo中读取ssid
token:"xxxx",//鉴权密钥 长度32,从getDeviceInfo中读取deviceBtToken,
mac:"xxxx"//蓝牙mac地址,从getDeviceInfo中读取mac
applianceId:"xxx"//设备id, getDeviceInfo中读取deviceId
}
this.$bridge
.setupBlueConnection(params)
.then(res => {
this.$alert(res)
})
.catch(err => {
this.$toast(err)
})
#返回参数
- 通过监听 receiveMessageFromApp 获取
- 失败时返回
| Prop | Type | Default | Description |
|---|---|---|---|
errorCode |
Number |
N/A |
请求失败错误码:-1连接失败 / -2发现服务失败 / -3密钥协商失败/ -4token校验失败 / -510s超时 |
TIP
该接口基于mSmart 协议,底层由singleBlueToothModule单蓝牙支持
浙公网安备 33010602011771号