-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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-8662) #10107
Comments
Hi @lishuai199502 , The ESP32 HID device set the SDP attribute |
@boblane1 Thanks very much for your reply, I've tested the method your show me, and it works well. Now I wonder know, how to distinguish the disconnect mode. For example, I turned my phone bluetooth off, then I turn on, esp32 should re-connect, but when I disconnect bluetooth by click disconnect button, esp32 shouldn't re-connect to. |
It seems that the Bluetooth stack can't distinguish the difference between the two procedures that you mentioned. |
@boblane1 Hi,it's me again,Now I set ESP32 try to connect the last device after boot. But if the device is off, I want another device can connect ESP32. |
According to the Please try the following patch. |
@boblane1 BT_state_change.mp4I don't know what happened between my PC and my moudle. bt2.mp4I want my ESP32 BT also can work like this , could give me a little more help. |
Like what I said before,
so if you want to the HID Host to initiate the reconnect procedure, you can change the attribute result &= SDP_AddAttribute(handle, ATTR_ID_HID_RECONNECT_INITIATE, BOOLEAN_DESC_TYPE, 1, (uint8_t *)&bool_true); to result &= SDP_AddAttribute(handle, ATTR_ID_HID_RECONNECT_INITIATE, BOOLEAN_DESC_TYPE, 1, (uint8_t *)&bool_false); in the function of The following attach is |
Answers checklist.
General issue report
Hi,i just use classic bluetooth with the example,esp-idf-v4.4.2\examples\bluetooth\bluedroid\classic_bt\bt_hid_mouse_device,
when I connect my android phone or my pc, it works well, but when I off my phone, the bluetooth disconnect,
then I on my phone, it doesn't reconnect to esp32.
The same problem occurs in my PC,
I want to know how to deal with this.
The text was updated successfully, but these errors were encountered: