Skip to content

Commit cd85a4d

Browse files
authored
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).
1 parent 754dbe3 commit cd85a4d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

bluetooth/drivers/bluetoothctl.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,14 @@ static bool bluetoothctl_remove_device(void *data, unsigned idx)
225225
string_list_free(list);
226226

227227
snprintf(btctl->command, sizeof(btctl->command), "\
228-
echo -e \"disconnect %s\\nremove %s\\n\" | bluetoothctl",
229-
device, device);
228+
bluetoothctl -- disconnect %s",
229+
device);
230+
231+
pclose(popen(btctl->command, "r"));
232+
233+
snprintf(btctl->command, sizeof(btctl->command), "\
234+
bluetoothctl -- remove %s",
235+
device);
230236

231237
pclose(popen(btctl->command, "r"));
232238

0 commit comments

Comments
 (0)