-
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
Failed to read newly loaded characteristics after services changed #692
Comments
When loading custom firmware to my bluetooth device which has all the services and characteristics exposed solves the issue. I am able to interact with all the services and characteristics so it excludes the bonding / encryption of the characteristics to be the issue. |
I do not have access to any peripheral that behaves like you described. You could also share how you have modelled your interaction with the peripheral. I do not expect invalid handle exception if you used |
Hello @dariuszseweryn I have a RxBleManager class which holds the RxBleClient, a BehaviorRelay which exposes the ble connection and ble device, and contains all the api calls the app uses. Pseudo code for connection procedure in the connection module:
RxBleManager Code Snippets
Then later inside the app I try to read certain characteristics using either of the convenience methods I defined but all of them returns the errors mentioned.
I will run the tests again and produce the logs shortly. Thank you for the quick answer! |
To read using the |
@dariuszseweryn I compiled a small test project to show the issue I am facing. The code I am running is:
And the logs from the session are:
You can clearly see the new service "fee0" after it has been unlocked. However when trying to read using the connection I get an error. It happens at this line:
Do you happen to have a CC2640 or CC2642 launchpad from Texas Instruments? If so I have an example application with this behaviour I can send over. |
I managed to solve the issue by storing the characteristics discovered by the custom gatt refresh operation and use this for BLE interactions. Will use this as a workaround now. |
Describe the bug
I am having issues reading encrypted characteristics for a bonded bluetooth device.
When connecting to the device it is only advertising 2 services but by writing to one of the exposed characteristics, it sends a Services Changed Indication and loads the remaining Characteristics.
The phone recognises the services changed indication and the remaining services and characteristics are discoverable using the discoverServices() method.
However, when reading the newly loaded characteristics after successful discovery I either get:
or:
errors.
I thought this was due to something wrong going on with the discovery and I used the suggestion here: #453 (comment)
to refresh cache. However I am still unable to read the characteristics that are loaded during connection. But this time I get another error:
even though discoverServices() shows that it has discovered the characteristics I am trying to read.
If I connect to the device via my app and then go into LightBlue BLE app, I can browse all services and characteristics and read them successfully.
Please let me know what kind of logs would be helpful or suggestions for steps I should try to overcome this issue.
To Reproduce
Expected behavior
Able to read newly loaded characteristics
Smartphone (please complete the following information):
Logs from the application when bug occurs (this will greatly help in quick understanding the problem)
To turn on logs use:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: