Skip to content

Bluetooth Low Energy scan failed with error code: -99 #19

Closed
@trietlam

Description

@trietlam

Prerequisites

  • Put an X between the brackets on this line if you have done all of the following:
    • My beacons have Estimote Monitoring enabled (Check it in the Estimote Cloud, or via app)
    • My Android device/devices supports BLE and has Android OS version >= 5.0.0
    • My Android device/devices have bluetooth enabled
    • My app has Location Permissions granted

Basic information

Estimote SDK version: [Paste here the SDK version that you are using (like 0.1.0-alpha.6)]
com.estimote:proximity-sdk:0.2.0

Android devices affected: [Paste here your Android device model/models that you are having problems with.]
Samsung Galaxy Tab A6

Android OS version affected: [Android OS version (ex. Oreo 8.0.0)]

  • Android version 5.1.1
    Android security patch level: 1 Sept 2016

  • [Updated] I also got similar error on Samsung Galaxy S4 (Android 5.0.1)

Beacon hardware version: [Paste here your beacons hardware version (you can check that in Estimote Cloud).]
G1.12

Description

App crash with fatal exception when using estimote-proximity android sdk.
Same code works on Samsung Galaxy Tab A with Android version 5.1.1 security patch level 2015-12-01

Expected behavior: [What you expect to happen]
Should receive callback for withOnPacketFoundAction

Actual behavior: [What actually happens]
App crash with Fatal exception

Additional information

Here my code snippet

    if(SystemRequirementsChecker.checkWithDefaultDialogs(getCurrentActivity())) {
      scanner = new EstimoteBluetoothScannerFactory(reactContext).getSimpleScanner();
      scanHandler = scanner.estimoteTelemetryFrameBScan()
              .withLowLatencyPowerMode()
              .withOnPacketFoundAction(new Function1<EstimoteTelemetryFrameB, Unit>() {
                @Override
                public Unit invoke(EstimoteTelemetryFrameB tlm) {
                  Log.i("Estimote", "Estimote telemetry id: " + tlm.getShortId() + ", temp: " + tlm.getTemperatureInCelsiusDegrees());

                  return null;
                }
              })
              .withOnScanErrorAction(new Function1<Throwable, Unit>() {
                @Override
                public Unit invoke(Throwable throwable) {
                  Log.e("Estimote", "onScanError", throwable);
                  hasError = true;
                  return null;
                }
              })
              .withTimeout(60, TimeUnit.SECONDS)
              .start();
    }

And here is stack trace

02-01 13:35:06.515 4690-4690/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                 Process: com.estimotetrackback, PID: 4690
                                                 io.reactivex.exceptions.UndeliverableException: java.lang.Exception: Bluetooth Low Energy scan failed with error code: -99
                                                     at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:349)
                                                     at io.reactivex.internal.operators.observable.ObservableCreate$CreateEmitter.onError(ObservableCreate.java:74)
                                                     at com.estimote.scanning_sdk.packet_provider.scanner.PostLollipopEstimoteScanner$scan$1$callback$1.onScanFailed(PostLollipopEstimoteScanner.kt:27)
                                                     at android.bluetooth.le.BluetoothLeScanner$1.run(BluetoothLeScanner.java:442)
                                                     at android.os.Handler.handleCallback(Handler.java:739)
                                                     at android.os.Handler.dispatchMessage(Handler.java:95)
                                                     at android.os.Looper.loop(Looper.java:145)
                                                     at android.app.ActivityThread.main(ActivityThread.java:6939)
                                                     at java.lang.reflect.Method.invoke(Native Method)
                                                     at java.lang.reflect.Method.invoke(Method.java:372)
                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
                                                  Caused by: java.lang.Exception: Bluetooth Low Energy scan failed with error code: -99
                                                     at com.estimote.scanning_sdk.packet_provider.scanner.PostLollipopEstimoteScanner$scan$1$callback$1.onScanFailed(PostLollipopEstimoteScanner.kt:27) 
                                                     at android.bluetooth.le.BluetoothLeScanner$1.run(BluetoothLeScanner.java:442) 
                                                     at android.os.Handler.handleCallback(Handler.java:739) 
                                                     at android.os.Handler.dispatchMessage(Handler.java:95) 
                                                     at android.os.Looper.loop(Looper.java:145) 
                                                     at android.app.ActivityThread.main(ActivityThread.java:6939) 
                                                     at java.lang.reflect.Method.invoke(Native Method) 
                                                     at java.lang.reflect.Method.invoke(Method.java:372) 
                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) 
                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

Not sure I'm doing anything wrong because I could not find example in Java.
Any help would be appreciated :)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions