question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add status to BleDisconnectedException

See original GitHub issue

Summary

The status param of onConnectionStateChange provides useful information even when new state is disconnected, since it holds the reason for disconnection, if supplied by the remote peer.

From Bluetooth Core Specification v5.0, Vol 2, Part E:

7.1.6  Disconnect Command

Command Parameters:

Reason: 
  Size: 1 octet

Value:
  0x05, 0x13-0x15, 0x1A, 0x29, 0x3B

Description:
  Authentication Failure error code (0x05), 
  Other End Terminated Connection error codes (0x13-0x15), 
  Unsupported Remote Feature error code (0x1A), 
  Pairing with Unit Key Not Supported error code (0x29),
  Unacceptable Connection Parameters error code (0x3B).

I believe it is also possible to get status 0x8 (Supervision Timeout), 0x3e (Connection Establish Timeout), and 0x16 (Connection Terminated By Local Host) in a disconnect callback, when it is triggered by the local host stack.

Library version

1.4.0

Preconditions

Connection state change event indicating a disconnect with a non-zero status. Relevant code is at RxBleGattCallback.java#L76.

Actual result

BleDisconnectedException without a status value.

Expected result

BleDisconnectedException with a status value.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
hoanglm4commented, Nov 6, 2017

I think BleDisconnectedException with a status value is great.

1reaction
RobLewiscommented, Nov 2, 2017

Possibly irrelevant comment @ThunderThrash: I’m struggling right now with error 0x81, which is reportedly a “generic Bluetooth error”, i.e., seems to have no diagnostic value whatever. Enlightenment appreciated!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add status to BleDisconnectedException · Issue #282 - GitHub
I would like to know if new BleDisconnectedException can return the status 0x81 (GATT internal error) and 0x85 (GATT error) after closing this ......
Read more >
RxBLELibraries/RxAndroidBle - Gitter
BleDisconnectedException : Disconnected from FF:B3:F6:00:81:50 with status 8 ... the notify part must work in background, so I've made a custom Service !...
Read more >
BleDisconnectedException: Disconnected from MAC='XX:XX ...
I'm working on an application that uses your framework and I faced into the next issue after my phone connected with ble device...
Read more >
com.polidea.rxandroidble2.exceptions ... - ProgramCreek.com
This page shows Java code examples of com.polidea.rxandroidble2.exceptions.BleDisconnectedException.
Read more >
android.bluetooth.BluetoothGatt.getDevice java code examples
getDevice()); mBLEDatas.add(d); return d; } ... else { DebugLogger.e(TAG, "onMtuChanged error: " + status + ", mtu: " + mtu); onError(gatt.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found