We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在调试安卓APP时,在使用uni.onBluetoothDeviceFound(CALLBACK) 监听寻找到新设备的事件时,第一次开启蓝牙模块监听时得到的蓝牙名称是正确的,在关闭蓝牙,再开启蓝牙模块,接着再监听寻找到新设备的事件时同一个蓝牙会得到2次相同名称的结果。再开启蓝牙模块,接着再监听寻找到新设备的事件时同一个蓝牙会得到3次相同的名称结果......N此,同一个蓝牙就会n次相同的结果。这样是不对的
调用蓝牙步骤: 1、uni.openBluetoothAdapter({}) //开启蓝牙设备 2、uni.getBluetoothAdapterState({}) //获取蓝牙状态 3、uni.startBluetoothDevicesDiscovery({}) //搜索蓝牙 4、uni.onBluetoothDeviceFound(function(devices) {} //监听蓝牙 5、console.log 蓝牙 //终端打印蓝牙名称,就是这里出错,按上面步骤,同一个蓝牙会打印多次 6、uni.stopBluetoothDevicesDiscovery({}) //关闭蓝牙搜索 7、uni.closeBluetoothAdapter({}) //关闭蓝牙设备
The text was updated successfully, but these errors were encountered:
BitApp.zip这是源码
Sorry, something went wrong.
8ee0d17
No branches or pull requests
在调试安卓APP时,在使用uni.onBluetoothDeviceFound(CALLBACK) 监听寻找到新设备的事件时,第一次开启蓝牙模块监听时得到的蓝牙名称是正确的,在关闭蓝牙,再开启蓝牙模块,接着再监听寻找到新设备的事件时同一个蓝牙会得到2次相同名称的结果。再开启蓝牙模块,接着再监听寻找到新设备的事件时同一个蓝牙会得到3次相同的名称结果......N此,同一个蓝牙就会n次相同的结果。这样是不对的
调用蓝牙步骤:
1、uni.openBluetoothAdapter({}) //开启蓝牙设备
2、uni.getBluetoothAdapterState({}) //获取蓝牙状态
3、uni.startBluetoothDevicesDiscovery({}) //搜索蓝牙
4、uni.onBluetoothDeviceFound(function(devices) {} //监听蓝牙
5、console.log 蓝牙 //终端打印蓝牙名称,就是这里出错,按上面步骤,同一个蓝牙会打印多次
6、uni.stopBluetoothDevicesDiscovery({}) //关闭蓝牙搜索
7、uni.closeBluetoothAdapter({}) //关闭蓝牙设备
The text was updated successfully, but these errors were encountered: