bluetoothctl: add / modify pairing steps (#13818)

due to some changes in bluez / bluetoothctl, `pairable on` is required
in order to create a `[LinkKey]` section in the configuration file for
the connected device. if this section is missing, the device / gamepad
will not pair after being disconnect and has to be repaired again.
This commit is contained in:
Tomáš Kelemen 2022-04-03 19:29:03 +02:00 committed by GitHub
parent f353898a9d
commit b2b2425203
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -170,8 +170,7 @@ static bool bluetoothctl_connect_device(void *data, unsigned idx)
string_list_free(list);
snprintf(btctl->command, sizeof(btctl->command), "\
bluetoothctl -- trust %s",
device);
bluetoothctl -- pairable on");
pclose(popen(btctl->command, "r"));
@ -181,6 +180,12 @@ static bool bluetoothctl_connect_device(void *data, unsigned idx)
pclose(popen(btctl->command, "r"));
snprintf(btctl->command, sizeof(btctl->command), "\
bluetoothctl -- trust %s",
device);
pclose(popen(btctl->command, "r"));
snprintf(btctl->command, sizeof(btctl->command), "\
bluetoothctl -- connect %s",
device);