# connectBluetooth ^7.6
连接蓝牙设备
# 请求参数
Prop | Type | Value |
---|---|---|
mac | String | "xxxx"//蓝牙mac地址(ios是uuid) |
moduleType | Number | 0;//ms |
# 参数代码示例
let params = {
mac: 'xxxx',
moduleType:0
}
1
2
3
4
5
6
2
3
4
5
6
# 接口调用示例
this.$bridge
.startBluetoothDiscovery()
.then(res => {
params.deviceId = res.deviceId
this.$bridge
.connectBluetooth(params)
.then(res => {
this.$alert(res)
})
.catch(err => {
this.$toast(err)
})
})
.catch(err => {
this.$toast(err)
})
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 返回参数
- 成功时返回
# 返回示例
callback:{
errorCode:0 //连接成功
}
callbackFail:{
errorCode:1,
errorMsg:"失败原因描述"
}
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10