You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When my device is just on the edge of range and ultimately probably won't establish a reliable connection I get this error stack from the Android-BLE-Library:
04-12 16:53:03.586 8991-9590/org.sralab.emgimu W/BluetoothGatt: Unhandled exception in callback
java.lang.NullPointerException: Attempt to invoke virtual method 'android.bluetooth.BluetoothDevice android.bluetooth.BluetoothGatt.getDevice()' on a null object reference
at no.nordicsemi.android.ble.BleManager$BleManagerGattCallback.onDeviceReady(BleManager.java:1276)
at no.nordicsemi.android.ble.BleManager$BleManagerGattCallback.nextRequest(BleManager.java:1734)
at no.nordicsemi.android.ble.BleManager$BleManagerGattCallback.nextRequest(BleManager.java:1834)
at no.nordicsemi.android.ble.BleManager$BleManagerGattCallback.nextRequest(BleManager.java:1834)
at no.nordicsemi.android.ble.BleManager$BleManagerGattCallback.onCharacteristicRead(BleManager.java:1550)
at android.bluetooth.BluetoothGatt$1$6.run(BluetoothGatt.java:364)
at android.bluetooth.BluetoothGatt.runOrQueueCallback(BluetoothGatt.java:725)
at android.bluetooth.BluetoothGatt.-wrap0(Unknown Source:0)
at android.bluetooth.BluetoothGatt$1.onCharacteristicRead(BluetoothGatt.java:358)
at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:124)
at android.os.Binder.execTransact(Binder.java:697)
In my case I get a link loss callback so I close the BleManager. This sets the GattCallback to null. It seems like when the BleManager is in this state, it should not attempt to go through the initialization requests.
The text was updated successfully, but these errors were encountered:
As an aside this is me probably using this slightly improperly. I realized that with autoConnect true I should let it fail to reconnect and then close out the connection. Still it probably should be safe for this behavior.
Note my "workaround" a.k.a. using it correctly probably, is to call disconnect() before close(). This is even when onDeviceConnected / onDeviceReady never fired -- just onDeviceConnecting.
When my device is just on the edge of range and ultimately probably won't establish a reliable connection I get this error stack from the Android-BLE-Library:
In my case I get a link loss callback so I close the BleManager. This sets the GattCallback to null. It seems like when the BleManager is in this state, it should not attempt to go through the initialization requests.
The text was updated successfully, but these errors were encountered: