Android bluetoothadapter.startLeScan, filter by UUID

I want to scan a BLE device using a method startLeScan(UUID[] serviceUuids, LeScanCallback callback)

, now I have a UUID, this is a 16 bit value for example 00000000-0000-1000-8000-00805F9B34FB

.

How can I use UUID in a method startLeScan

, I write like this:

UUID[] uuid = new UUID[1]; uuid[0] = UUID.fromString("00000000-0000-1000-8000-00805F9B34FB");
mBluetoothAdapter.startLeScan(uuid, mLeScanCallback);

      

But finally, I can't scan anything. How can I solve this problem.

+3


source to share





All Articles