Prevent a particular device from reconnecting to a server #880
-
Hi What would be the best method to prevent a server from automatically connecting to a device? Example: A NimBLE gamepad device as server connected to a previously connected computer automatically connects back to it after restart This is usually the desired outcome, but what if you'd like to connect the gamepad to another device, without removing the pairing from the computer. I've tried, on a button press, Are any of deleteAllBonds(), deleteBond(), deleteClient() close to what i may want? Suggestions? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
There really isn't much you can do to prevent the original device from connecting. The act of advertising will tell it your device is looking for connections and it will want to connect since it's bonded. |
Beta Was this translation helpful? Give feedback.
-
Thanks. I will try removing the delay from there Interestingly, in another part of the code, it would only work stably by adding a delay With the serial output during debugging, it worked great without delay, but when I got rid of it, it failed after a few seconds, but adding a delay sorted it Even with a 10ms delay it worked well, but no delay failed after a couple of seconds
|
Beta Was this translation helpful? Give feedback.
Ended up solving it
lemmingDev/ESP32-BLE-Gamepad@57d0ae6