Hello, I need to make a keyboard, it can connect to multiple hosts, and can pair and bind functions, after it reset can quickly connect to the host。
Hello, I need to make a keyboard, it can connect to multiple hosts, and can pair and bind functions, after it reset can quickly connect to the host。
Yes, I don't know how to quickly switch to another host.
How to disconnect the current connection and quickly connect to another host?
How do you want to disconnect?
However, you can take a look at sd_ble_gap_disconnect().
Best regards,
Joakim
No, there are three devices in the whitelist, and I need to switch connections by pressing the button
Ok.
I would say that I stand by my previous answer.
You can make a call to sd_ble_gap_disconnect() on a button press. This call initiates the disconnection procedure, and its completion will be communicated to the application with a BLE_GAP_EVT_DISCONNECTED event.
When you receive the BLE_GAP_EVT_DISCONNECTED event, you can choose what the next action will be. In your case, I would suggest to start advertising with whitelist in order to connect to one of the other devices.
Note:
When asking a question - In order for us to help you the best way possible, it is beneficial for us to have as much information about what the issue is, what you are trying to achieve and what you've already tried.
Adding a detailed description about what you want to do with your application, which SDK version, SD version, which device etc. is information that would be very helpful to us when included in your question.
Best regards,
Joakim