# stopBluetoothDiscovery ^7.6

结束扫描附近蓝牙设备

# 请求参数

  • N/A

# 接口调用示例


      this.$bridge
        .stopBluetoothDiscovery()
        .then(res => {    
          this.$alert(res)
        })
        .catch(err => {
          this.$toast(err)
        })

1
2
3
4
5
6
7
8
9
10

# 返回参数

  • 当扫描结束(停止或超时)时,APP通知插件结果:

# 返回示例

// 设备状态推送,返回数据格式:
{ 
    messageType: "bluetoothScanStop",
    messageBody: {} 
}

const globalEvent = weex.requireModule('globalEvent')
 
export default {
.....   
created() {
    // 监听设备状态推送
    globalEvent.addEventListener('receiveMessageFromApp', (response) => {
        // 业务逻辑
        let { messageType, messageBody } = response
        if (messageType == 'bluetoothScanStop'){
            console.log(messageBody)
        }
    })
}
.....
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Last Updated: 6/16/2021, 2:02:29 PM