Programmatically removing all bluetooth devices on the Linux command line

user2570136 picture user2570136 · Jul 10, 2013 · Viewed 30.4k times · Source

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.

Answer

ashish picture ashish · Jul 11, 2013

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