4

Android Lollipop introduced a new way to scan for BLE peripherals, via BluetoothLeScanner.

From what I read, the new scanning API solved an issue that happened with the old scanning API (BluetoothAdapter.startLeScan(UUID[],LeScanCallback)) where on some devices the callback (onLeScan) was called only once per peripheral, even if the peripheral keeps advertising.

This issue is handled on iOS with the CBCentralManagerScanOptionAllowDuplicatesKey option, that allows you to choose whether you want to detect only new peripherals or keep getting advertisements from previously-found peripherals.

Is there a similar option in the new Android Lollipop API? i.e. decide that you want the callback to be called only for new peripherals (new MAC addresses) and not called twice for the same peripheral.

I know that it could easily be implemented by saving a list\set of all the MAC addresses that were previously received - but this way does not take advantage of hardware optimizations.

Oren
  • 2,647
  • 3
  • 22
  • 37
  • Nope. I don't believe this feature exists in Android. – Oren Jun 12 '15 at 10:24
  • Did u check with new API-21. They said there are some frequency app can set while ask for scanning. – CoDe Jun 13 '15 at 07:55
  • Do you mean the Low-Power, Balanced and Low-Latency modes? I don't think it has anything to do with my question - the same device will still be detected multiple times (but probably in a different frequency). – Oren Jun 14 '15 at 08:10
  • In may case...I wanted to get duplicate packet for some functional purpose..but there are some ROM in market which don't allow duplicate packet to application layer. Check Here: http://stackoverflow.com/a/20196114/2624806 .. Now you saying ".. same device will still be detected multiple times" but how and how I can check it at app layer..Any suggestion ? – CoDe Jun 15 '15 at 04:57

0 Answers0