bluetoothctl: use two calls to disconnect/remove device (#17593)

the previous method does not remove the pairing of the selected device,
user must remove the pairing manually by modifying filesystem.

change tested on real system (Lakka-RPi4.aarch64).
This commit is contained in:
Tomáš Kelemen 2025-02-18 17:11:36 +01:00 committed by GitHub
parent 754dbe37cc
commit cd85a4dbf2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -225,8 +225,14 @@ static bool bluetoothctl_remove_device(void *data, unsigned idx)
string_list_free(list);
snprintf(btctl->command, sizeof(btctl->command), "\
echo -e \"disconnect %s\\nremove %s\\n\" | bluetoothctl",
device, device);
bluetoothctl -- disconnect %s",
device);
pclose(popen(btctl->command, "r"));
snprintf(btctl->command, sizeof(btctl->command), "\
bluetoothctl -- remove %s",
device);
pclose(popen(btctl->command, "r"));