How to start BLE advertising again after a disconnection from the central Android device
I am a student who is currently doing his bachelor thesis. My job is to control two microcontrollers (Nucleo-STM32F411RE) via Bluetooth (X-Nucleo-BNRG2A1) in order to transfer parameter values for a system. The idea was to connect the microcontrollers one after the other via Bluetooth and transfer the values of the parameters. The connection and the transfer of the values works very well. Unfortunately, I am unable to connect a microcontroller a second time. When I terminate a connection, the device no longer appears in the scanner list or a reconnection hangs. I took the measures to be observed when closing a connection (gatt diconnect, gatt close in the callback, etc.). If I press the black reset button and restart the program, the device can be found in the scanner list immediately. Does anyone have experience with it? There are a lot of posts on this topic. So my question is: Can something be installed on the microcontroller side that will return to the advertising state in the event of a disconnect? Since 2 out of 3 months of my time have already passed, it would be helpful if someone had a snippet of code that I could include.
