0

I am trying to scan for a specific BLE advertisement based on UUID. I came up with the below code but the scan does not return any result.

final UUID[] comm_UUID = {UUID.fromString("0000b81d-0000-1000-8000-00805f9b34fb")};
mBluetoothAdapter.startLeScan(comm_UUID, mLeScanCallback);

I tried scanning without the filter mBluetoothAdapter.startLeScan(mLeScanCallback); and it is working just fine, but callback reports all BLE advertisements in the vicinity.

Am I performing the scan incorrectly?

Pool
  • 91
  • 8
  • So when you scan without filtering, can you see device with that UUID - `0000b81d-0000-1000-8000-00805f9b34fb` ? – Divers Jul 21 '16 at 09:35
  • Yes! I can also see all the nearby low energy devices due to the absence of filter(which is not desired). – Pool Jul 21 '16 at 09:52
  • Are you sure that you see device with that UUID? Did you check it with debugger? – Divers Jul 21 '16 at 10:19
  • Yes i'm sure. I checked it in debugger and printed the list of devices on screen as well. – Pool Jul 21 '16 at 10:42
  • a similar problem un-answered http://stackoverflow.com/questions/30256110/android-bluetoothadapter-startlescan-filter-by-uuid – Pool Jul 21 '16 at 10:42
  • cant it be your case - http://stackoverflow.com/a/18899320/632516 ? – Divers Jul 21 '16 at 12:20

0 Answers0