bluetoothLeScanner扫描时间有多长?
How long bluetoothLeScanner scan time?
我更改了代码
BluetoothAdapter.startLeScan
到
BluetoothLeScanner.startScan(callback)
所以,我认为扫描性能足够了,但我不知道 bluetoothLeScanner 扫描时间。
BluetoothAdapter.startLeScan
有变化的扫描时间。
请回答。
您需要使用处理程序停止扫描。使用此代码在 10 秒后停止扫描
BluetoothLeScanner.startScan(callback);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
BluetoothLeScanner.stopScan(callback);
}
}, 10000);
我更改了代码
BluetoothAdapter.startLeScan
到
BluetoothLeScanner.startScan(callback)
所以,我认为扫描性能足够了,但我不知道 bluetoothLeScanner 扫描时间。
BluetoothAdapter.startLeScan
有变化的扫描时间。
请回答。
您需要使用处理程序停止扫描。使用此代码在 10 秒后停止扫描
BluetoothLeScanner.startScan(callback);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
BluetoothLeScanner.stopScan(callback);
}
}, 10000);