03-09-2021, 07:33 PM
I don't think the code is set up to reconnect automatically to a bluetooth device if you turn it off and then back on. That would require re-scanning for all bluetooth devices which would draw power in the background if the device is not immediately found. If I had to try to automatically reconnect, that would mean that I would never stop trying to scan for it in the background, consuming a lot of power over time if the device is not found. I don't think that is the best way to handle this. I'm relying on Google's library to let me know when the device is disconnected, but apparently that is not being reported if you turn the device off (or maybe it takes a while before that is reported through their library). I think the only way to properly handle this is to pop up a dialog when the bluetooth connection breaks with the MIDI device and ask if the user wants to attempt to reconnect. If they say yes, it will scan and try to look for it. Google's interface does not notify me when the scan is complete, so the user will have to tap cancel if the device isn't found and they don't want to wait any longer for the scan. This also depends on whether the lost connection is reported, so I'll have to investigate this further to understand how long it typically takes or if it isn't really working the way it should. For now, you will just have to manually rescan for the device if you break the connection. I know that's tedious, but there is no easy option for me to reestablish bluetooth connections that doesn't have consequences.
Mike
Mike