Skip to main content
Version: 2.x

Taro.stopBluetoothDevicesDiscovery(option)

停止搜寻附近的蓝牙外围设备。若已经找到需要的蓝牙设备并不需要继续搜索时,建议调用该接口停止蓝牙搜索。

参考文档

类型

(option?: Option) => Promise<Promised>

参数

Promised

参数类型说明
errMsgstring成功:ok,错误:详细信息

Option

参数类型必填说明
complete(res: BluetoothError) => void接口调用结束的回调函数(调用成功、失败都会执行)
fail(res: BluetoothError) => void接口调用失败的回调函数
success(res: BluetoothError) => void接口调用成功的回调函数

示例代码

Taro.stopBluetoothDevicesDiscovery({
success: function (res) {
console.log(res)
}
})

API 支持度

API微信小程序H5React Native
Taro.stopBluetoothDevicesDiscovery✔️