BlueMicro_HID_Arduino_Library icon indicating copy to clipboard operation
BlueMicro_HID_Arduino_Library copied to clipboard

Add multiple BLE profiles to enable Switching between computers

Open jpconstantineau opened this issue 3 years ago • 1 comments

In order to be able to use my device with multiple computers/phones, I want to quickly change the profile and the pairing keys will be kept in order for me not to have to re-pair with the computer every time.

This functionality is currently implemented in the BlueMicro_BLE firmware with the Adafruit BSP.

Note that implementation requires a few functions to be added. Also note that saving to flash is needed to remember the last profile being used. This will require a bit more work than just copy/pasting the code as the profile needs to be saved to the flash file system and reloaded on startup.

jpconstantineau avatar Jul 29 '22 22:07 jpconstantineau

I just did a release that added code as a start to resolve this issue. Let me know if it works. Arduino should pull it in a few hours.

To test it, one should set 0 for connecting to device 0 and set it to 1 to connect to device 1. Since this is done with the constructor, it's done in the setup function. As such, the setup function should read the state of a switch and select the profile according to the state of the switch.

Once this tests out, more complex functions like loading from flash could be used to load which profile to use and save to flash within the loop and call a reboot to restart the device. Since these persistent save/load depends on the CPU type, I don't want to hardcode things that are specific to the nrf52 in this library.

jpconstantineau avatar Jul 29 '22 23:07 jpconstantineau