Skip to content

Commit

Permalink
bluetoothctl: use two calls to disconnect/remove device (#17593)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
ToKe79 authored Feb 18, 2025
1 parent 754dbe3 commit cd85a4d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bluetooth/drivers/bluetoothctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"));

Expand Down

0 comments on commit cd85a4d

Please sign in to comment.