Pairing a device
In order to form a connection, a Bluetooth device needs to be paired with another Bluetooth device.
Enter pair [ID] where [ID] is the unique Bluetooth device identifier shown in the above command.
[bluetooth]# pair [ID]
For example, if we want to connect to the first device in the above screenshot, the command will be
[bluetooth]# pair D4:8A:39:3E:3C:F5
Thus we have successfully paired and connected to a Bluetooth device on Linux via CLI. Some of the trivial commands you may need are listed below.
Command | Used to |
---|---|
list | List available controllers |
devices | List available devices |
paired-devices | List paired devices |
cancel-pairing [dev] | Cancel pairing with the device |
discoverable <on/off> | Set controller discoverable mode |
disconnect [dev] | Disconnect device |
exit | Quit program |
Connecting To Bluetooth Devices Via CLI
The Bluetooth wireless technology is a worldwide specification for a small-form-factor, low-cost radio solution that provides links between mobile computers, mobile phones, and other portable handheld devices. You’ll find Bluetooth connectivity in smartphones, smartwatches, wireless earphones, etc.
In this article, we’ll be learning how to connect to a Bluetooth Device via CLI on Linux.