Got issue when `setCharacteristicNotification()` run into an infinite loop
See original GitHub issueDescribe the bug I have tried to fix issue related to ble connection. I have 2 test devices, 1 of them has a special firmware (it will disconnect right after having connected) and the purpose of this is to test the edge case when user just stay in the boundary between connect and disconnect.
To Reproduce Connect 2 devices on app
- 1 device has normal firmware
- another device has special firmware to connect and disconnect continuously
- run the app after around 10 mins and look at behaviour of 2 devices:
- the normal device firmware act normal and has a stable connection
- the special device firmware act has expected (connect and disconnect), after 10 mins, it just stuck in a limbo state. And there is a log
D/BluetoothGatt: setCharacteristicNotification() - uuid: e2fa0108-b177-4e96-a550-4a47e40adcb7 enable: false
running in a forever loop
Expected behavior
Expect to see the special firmware connect/disconnect continuously and not being in a stuck state. Also handle case setCharacteristicNotification()
forever loop
Smartphone (please complete the following information):
- Samsung S21
- Library version: 1.15.0
**Logs from the application when bug occurs:
BluetoothGatt: setCharacteristicNotification() - uuid: e2fa0108-b177-4e96-a550-4a47e40adcb7 enable: false
Additional context This is being logged forever
Thank you for taking a look 😄
Issue Analytics
- State:
- Created a year ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
RxAndroidBle state machine setup notification produce infinite ...
In your case this .doOnNext() will get called for each successful notification setup after a connection is established.
Read more >The Ultimate Guide to Android Bluetooth Low Energy
Learn about the basics of Android BLE, get an overview of important glossary terms, and real world examples to better develop Android apps....
Read more >if getDescriptor()=null ,can't setCharacteristicNotification #66
my device notification characteristic descriptor is null,so I can't use rxandroidble to set notification. in rxandroidble code : private ...
Read more >BLE Treadmill Controller - Project Guidance - Arduino Forum
I want to connect to bluetooth and run in my own game. ... This is the Arduino main loop function. void loop() {...
Read more >nativescript-bluetooth - Bountysource
I have no issue building or running apps I've created with NS. ... connect, grab some data and disconnect from the BLE device...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Actually we used wrong
retryWhen
while observingsetupNotification
on specificuuid
. So when device is disconnected, we still try to setupNotification, and it leads to unexpected loop 😃 The implementation forBleSessionManager
works fine. FYI.Thank you for sharing. I close this issue.