Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
in this patch I propose an "auto-connection" option for bluetooth devices.
Theoretically the auto-connection of Paired and Trusted devices is done without any intervention by the user.
Some resources on this subject as a reminder:
https://wiki.archlinux.org/title/Bluetooth#Auto_power-on_after_boot
https://wiki.archlinux.org/title/Bluetooth_headset#Setting_up_auto_connection
https://wiki.archlinux.org/title/bluetooth#Audio
https://askubuntu.com/questions/589885/automatically-switch-sound-output-device-to-bluetooth-headset-force-to-a2dp-pr
However on some hardware (computer or devices), the connection is not done, or succeeded with a high failure rate.
Personally on an AsusK75 and speakers "Creative T12 Wireless", the success rate is about 2/10 when I press the association button on the speakers.
Also, if the speakers are turned on before the computer, the computer has no chance to connect to them.
Many people have these problems and rely on solutions like this one:
https://github.com/jrouleau/bluetooth-autoconnect/blob/master/bluetooth-autoconnect
=> basically a script that lists trusted devices at regular intervals and initiates a blind connection.
It is important to mention that the implementation under Windows is radically different from the one under GNU/Linux because the devices are instantly hooked in all situations. This behavior is similar to what the above mentioned script offers.
So I have added the autoconnect option for any device that has been added manually.
It works similarly to the "standby" option already present.
The search interval is currently 30 seconds (this is probably too long and open to discussion).