Hi everyone, I am using the BLEkeyboard library with an ESP32, and have a momentary button disable or enable Bluetooth on an ESP32. This is working well with a boolean toggle function.
Currently, btStop(); does a fine job in starting Bluetooth, but unfortunately, neither btStart(); or bleKeyboard.begin(); seems to reconnect Bluetooth to my device (iOS).
I currently have it so that my entire program resets which accomplishes the result I am looking for, but is a bit messy. Any ideas on what command or set of commands will reconnect Bluetooth after a btStop(); command is issued?
Good catch, here's the updated code, (I had it working before, but had to scrap it, so I re-wrote it incorrectly for the example) -- should be correct now.
I will note that even if all there was in the loop section was the following (below), it would still not start up the Bluetooth again, which makes me think the ESP32 needs more instructions to restart the Bluetooth service once stopped...