# setupBlueConnection ^6.8
建立蓝牙连接
# 请求参数
Prop | Type | Default | Comment |
---|---|---|---|
mac | String | N/A | 蓝牙mac地址 |
moduleType | String | N/A | (^7.3.0) 0代表单蓝牙模组,1,ble+wireless双模组。不传默认单蓝牙模组 |
applianceId | String | N/A | 设备id |
name | String | N/A | 蓝牙名称 |
token | String | N/A | 鉴权 长度32 |
# 接口调用示例
const params = {
name: 'midea_xx_xxxx', //蓝牙名称
token: 'xxxx', //鉴权 长度32
moduleType: '0', // (^7.3.0) 0代表单蓝牙模组,1,ble+wireless双模组。不传默认单蓝牙模组
mac: 'xxxx', //蓝牙mac地址
applianceId: 'xxx', //设备id
}
this.$bridge
.setupBlueConnection(params)
.then(res => {
this.$alert(res)
})
.catch(err => {
this.$toast(err)
})
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 返回参数
- 成功时返回
Prop | Type | Default | Description |
---|---|---|---|
errorCode | Number | N/A | 默认0,接收/校验成功 |
- 失败时返回
Prop | Type | Default | Description |
---|---|---|---|
errorCode | Number | N/A | -1:连接失败, -2:发现服务失败, -3:密钥协商失败, -4:token校验失败, -5:10s超时 |