[X] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
[X] 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 https://github.com/espressif/esp-idf/issues/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!
Answers checklist.
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 https://github.com/espressif/esp-idf/issues/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.
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.