4ntoine February 2016

How to fix Android BLE SCAN_FAILED_FEATURE_UNSUPPORTED on Nexus 5?

I'm having this onScanFailed error code on some devices (LG to be more detailed) when discovering BLE devices on android. The code works as expected on another devices. How can i fix it?

I use BLE API 21+ and the following code to discover:

ScanSettings scanSettings = new ScanSettings.Builder()
            .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
            .setReportDelay(discoveryDelay)
            .build();

Here are the full sources: https://github.com/4ntoine/protobuf-ble-rpc/blob/hi-p/android/client/src/main/java/com/googlecode/protobuf/blerpc/BleRpcConnectionFactory.java#L362

Answers


BayssMekanique February 2016

Some devices do not support all of the features of the new LE API. The features are hardware specific and up to the manufacturer to enable. The best approach is to check for the supported feature before building the filter and settings.

bluetoothAdapter.isOffloadedFilteringSupported();

bluetoothAdapter.isOffloadedScanBatchingSupported();

I haven't found any issues with issuing filters when OffloadedFiltering isn't supported.

If OffloadedScanBatching isn't supported, then you should not set a report delay. Attempting to set a report delay of anything other than 0 will result in an error.

Post Status

Asked in February 2016
Viewed 3,757 times
Voted 10
Answered 1 times

Search




Leave an answer