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 authored and GitHub committed 2025-02-18 17:11:36 +01:00
1 parent 754dbe37cc
commit cd85a4dbf2
1 file changed
+8 -2
+8 -2
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"));