Linux – Programmatically removing all bluetooth devices on the Linux command line

bluetoothbluezhcilinux

I am able to scan for all available bluetooth devices with hcitool or with my C program.

I can pair the device using it's address with a simple-agent python script.

I would like to know if I can also remove the paired device using either hcitool, hciconfig or some kind of bluetooth command.

I know the information of detected devices for the hci0 controller is stored in /var/lib/bluetooth/XX:XX:XX:XX:XX:XX, where XX:XX:XX:XX:XX is the address of the hci controller.

This would be useful for testing pairing, connecting and disconnecting devices.

Best Answer

bluez-test-device remove XX:XX:XX:XX:XX:XX