startBlueScan 开始扫描蓝牙
startBlueScan ^5.9.0
开始扫描蓝牙
建议:扫描到设备之后再建立蓝牙连接
#请求参数
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
param |
Object |
Y |
{} 属性: name:{ Type: String, Default: N/A, Description: 蓝牙名称 (可以使用getDeviceInfo中返回的ssid字段) } mac:{ Type: String, Default: N/A, Description: 蓝牙mac地址((可以使用getDeviceInfo中返回的mac字段)) } duration: |
请求参数 |
#接口调用示例
参数支持2种方式:
eg1:ssid过滤,支持发现一个设备
let param={
name:"midea_xx_xxxx",
duration: 10//自定义数值
}
eg2:mac过滤,支持发现一个设备
let param={
mac:"xxxxxxxxxxxx",
duration: 10//自定义数值
}
this.$bridge
.startBlueScan(params)
.then(res => {
this.$alert(res)
})
.catch(err => {
this.$toast(err)
})
#返回参数
- 通过监听 receiveMessageFromApp 获取
- 成功时返回
| Prop | Type | Default | Description |
|---|---|---|---|
messageType |
String |
singleBlueScanResult |
H5用来判断消息类型 |
messageBody |
Object |
{} 属性: name: 属性: mac: 属性: moduleType: 属性: authStatus: |
APP传递的JSON对象 |
TIP
该接口基于mSmart 协议,底层由singleBlueToothModule单蓝牙支持
浙公网安备 33010602011771号