I'm using BluetoothLeScanner
to scan for BLE devices, which I start using:
startScan(null, settings.getScanSettings(), scanCallback);
Every once in a while, a call to startScan()
does not discover any BLE device, even though some devices are actually advertizing (They are discovered using nRF Connect app).
When this happens, the next call to stopScan()
and startScan()
does discover devices.
I know that since Android 7, the number of start and stop scans is restricted to 5 times in a window of 30 seconds. However, I've noticed the problem occurs also if no stopScan()
/startScan()
has not been called for more than 30 secs.
Has anyone experienced such issue ? Could it be something else my app is doing while starting the scanner that could the scanning to fail ?
I have this problem using Android 10 and lower versions.
question from:https://stackoverflow.com/questions/65941190/android-why-is-bluetoothlescanner-sometimes-not-discovering-any-ble-device