androidbluetooth-lowenergyandroid-4.3-jelly-beangatt

startLeScan with 128 bit UUIDs doesn't work on native Android BLE implementation


I am having trouble using startLeScan( new UUID[]{ MY_DESIRED_128_BIT_SERVICE_UUID }, callback ) on the new introduced BLE API of Android 4.3 on my Nexus 4.

The callback just doesn't get called. I still can see incoming packages in the log:

08-02 15:48:57.985: I/bt-hci(1051): btu_ble_process_adv_pkt
08-02 15:48:58.636: I/bt-hci(1051): BLE HCI(id=62) event = 0x02)

If I don't use the parameter to filter for UUIDs it works. We are using a manufacturer specific 128bit UUID for device of our company.

Now, our device offers more services than I am providing in the array. But that shouldn't be the problem.

Is anyone facing the same problem? Any solutions?

Edit

There are several problems related to scanning, this question only discusses one: If you also have some issue with scanning, read this comment first. Also keep in mind, that my device imposes a 16bit and a 128bit UUID. Most of you guys use 16bit UUIDs provided by the BLE standard like Heart rate or Speed and Cadence.


Solution

  • This is a reported bug at least in Android 4.3 JWR66Y:

    My setting: My device offers 2 UUIDs on advertising (1 16bit and 1 128bit) and 4 UUIDs on service discovery (1 128bit and 3 16bit).

    Even if it gets fixed, I warn everybody against using the filter option provided by Android. For backward compatibility and since it's broken on Samsung Galaxy S3 with Android 4.3