-
Notifications
You must be signed in to change notification settings - Fork 583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add status to BleDisconnectedException #282
Comments
Sorry for my English... |
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! |
I think BleDisconnectedException with a status value is great. |
Just to achieve a bit of "closure" with my previous comment: the "generic Bluetooth error" 0x81 turned out to be that I was attempting to enable notifications when I should have been using indications (or vice versa, forget which). Wouldn't it be swell if there were explicit causes given like this? Even something like "unsupported operation" would be better than "generic error"! |
I should have clarified that the above error was in some Android-native (non-RxAndroidBle) code I inherited. Rewriting it now with Rx. What a difference! |
@Cierpliwy Looks like this is the one we were talking about. Mentioning just to remember about it. |
- Added GATT status to description mapping Fixes #282
- Added GATT status to description mapping Fixes #282
- Added GATT status to description mapping Fixes #282
- Added GATT status code to a BleDisconnectException - Added GATT status to description mapping Fixes #282
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:
I believe it is also possible to get status
0x8 (Supervision Timeout)
,0x3e (Connection Establish Timeout)
, and0x16 (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.The text was updated successfully, but these errors were encountered: