bluetooth lowenergy - How to fix Android BLE SCAN_FAILED_FEATURE_UNSUPPORTED on Nexus 5? -


i'm having onscanfailed error code on devices (lg more detailed) when discovering ble devices on android. code works expected on devices. how can fix it?

i use ble api 21+ , following code discover:

scansettings scansettings = new scansettings.builder()             .setscanmode(scansettings.scan_mode_low_latency)             .setreportdelay(discoverydelay)             .build(); 

here full sources: https://github.com/4ntoine/protobuf-ble-rpc/blob/hi-p/android/client/src/main/java/com/googlecode/protobuf/blerpc/blerpcconnectionfactory.java#l362

some devices not support of features of new le api. features hardware specific , manufacturer enable. best approach check supported feature before building filter , settings.

bluetoothadapter.isoffloadedfilteringsupported();  bluetoothadapter.isoffloadedscanbatchingsupported(); 

i haven't found issues issuing filters when offloadedfiltering isn't supported.

if offloadedscanbatching isn't supported, should not set report delay. attempting set report delay of other 0 result in error.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -