Bluetooth Operations

The following table describes the Bluetooth operations.
Table 1. Bluetooth Operations
Operation Details
Check Bluetooth device status
# hciconfig
hci0: Type: BR/EDR Bus: UART
BD Address: 43:30:B1:00:00:00 ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING
RX bytes:1011 acl:0 sco:0 events:39 errors:0
TX bytes:208 acl:0 sco:0 commands:39 errors:0
Scan Bluetooth devices
# hcitool scan 
Scanning ...
00:22:43:A0:A7:0A n/a
00:10:60:56:56:7B hhhh
00:1A:6B:85:F3:67 n/a
00:22:43:A0:A7:48 AmUrO
00:1F:E1:E1:A1:8F GEMTEK-8AE51F68
Use the Bluetoothctl tool
bluetoothctl
[bluetooth]# agent on
[bluetooth]# default-agent
[bluetooth]# scan on
[bluetooth]# devices
[bluetooth]# pair XX:XX:XX:XX:XX:XX
[bluetooth]# trust XX:XX:XX:XX:XX:XX
[bluetooth]# connect XX:XX:XX:XX:XX:XX
[bluetooth]# scan off
Commands:
  • agent on: Register the agent for paring requests.
  • default-agent: Set as the default agent.
  • scan on: Start scanning for devices.
  • devices: List discovered devices.
  • pair <addr>: Pair with a device.
  • trust <addr>: Trust a paired device.
  • connect <addr>: Connect to a paired device.
  • scan off: Stop scanning.