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.

Got issue when `setCharacteristicNotification()` run into an infinite loop

See original GitHub issue

Describe 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:
  1. the normal device firmware act normal and has a stable connection
  2. 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:closed
  • Created a year ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lng-dawncommented, Jun 29, 2022

Actually we used wrong retryWhen while observing setupNotification on specific uuid. So when device is disconnected, we still try to setupNotification, and it leads to unexpected loop 😃 The implementation for BleSessionManager works fine. FYI.

0reactions
dariuszseweryncommented, Jun 29, 2022

Thank you for sharing. I close this issue.

Read more comments on GitHub >

github_iconTop 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 >

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