Skip to content
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

classic bluetooth hid device doesn't reconnect (IDFGH-12680) #13671

Open
3 tasks done
aromprg opened this issue Apr 22, 2024 · 2 comments
Open
3 tasks done

classic bluetooth hid device doesn't reconnect (IDFGH-12680) #13671

aromprg opened this issue Apr 22, 2024 · 2 comments
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally

Comments

@aromprg
Copy link

aromprg commented Apr 22, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Hello!
I'm use classic Bluetooth with the esp-idf\examples\bluetooth\bluedroid\classic_bt\bt_hid_mouse_device. In my case after successfully pairing with android-phone, esp_mouse has saved the host BD_ADDR in nvs, and then after break Bluetooth connection (phone disable bt), esp power off/on, it needs to reconnect to the host automatically. As found on #10107 I should call esp_bt_hid_device_connect() for this (I'm create reconnect task with 3000ms delay). This work fine with IDF v5.0.2, but now I upgrade to v5.2.1. After this commit esp_mouse will never be able to connect to the host after the first failed attempt.

I (3260) app_main: init end
I (3260) main_task: Returned from app_main()
E (6240) BT_BTC: btc_hd_connect: busy now, status:3, try later!
E (6240) esp_bt_hidd_cb: open failed!
W (8390) BT_HIDD: hidd_l2cif_connect_cfm: connection failed, now disconnect
W (8390) BT_HIDD: hidd_conn_disconnect: already disconnected
W (8390) BT_HCI: hcif conn complete: hdl 0xfff, st 0x4
I (8400) esp_bt_gap_cb: event: 16
E (9240) BT_BTC: btc_hd_connect: busy now, status:3, try later!
E (9240) esp_bt_hidd_cb: open failed!
E (12240) BT_BTC: btc_hd_connect: busy now, status:3, try later!
E (12240) esp_bt_hidd_cb: open failed!
E (15240) BT_BTC: btc_hd_connect: busy now, status:3, try later!
E (15240) esp_bt_hidd_cb: open failed!

In components/bt/host/bluedroid/btc/profile/std/hid/btc_hd.c btc_hd_cb.status remains in the BTC_HD_CONNECTING state forever, without being reset if the connection fails.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Apr 22, 2024
@github-actions github-actions bot changed the title classic bluetooth hid device doesn't reconnect classic bluetooth hid device doesn't reconnect (IDFGH-12680) Apr 22, 2024
@boblane1
Copy link
Collaborator

@aromprg Thanks for your reporting. Please try the following patch to see if the issue has been solved.

test.zip

@aromprg
Copy link
Author

aromprg commented Apr 23, 2024

This patch fixes the reconnection issue. Everything works as expected. Thank you!

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Opened Issue is new labels Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

3 participants