Closed Hamberthm closed 1 year ago
Í'm further investigating this issue.
First of all, my keyboard won't advertise an UUID, not even an appearence flag if not in pairing mode. As a result, the scan routine totally ignores it.
The solution to this is to manually recover the bonded devices addresses from the NVS and try to connect to them as a first step. If anyone can guide me on how to do this, I would be DEEPLY appreciated as I'm a noob on this and browsing/understanding the API takes me too much valuable time ;(
Thanks!!
EDIT: I've managed to reconnect using the esp_ble_get_bond_device_num()
and esp_ble_get_bond_device_list()
functions to recover the last bonded device from flash!! I'll be posting a pull request soon.
Well, I've successfully added the missing features. Check my fork and this commit
Hi and thanks for this amazing code!
I succesfully implemented it on my own project, a BT to PS/2 adapter.
The ESP can discover the keyboard, a Redragon Draconic, while it's in pairing mode and connect to it succesfully. However, if I cycle the power on wichever device, they wouldn't reconnect. I have to enter pairing mode again on the keyboard for it to work.
In main's code I have:
As you can see the line for the NVS flash erase is commented out,. However that doesn't seem to apply to BLE devices, as I have to do pairing each time.
Is it possible that BLE devices require the host (the ESP) to initiate a connection at all times? If that is the case, how would be the right way to implement it?
Thanks!