Список доступных команд для управления bluetooth
1 |
bluetoothctl help |
Подключение нового устройства
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
$ bluetoothctl [bluetooth]# scan on Discovery started [CHG] Controller 00:10:20:30:40:50 Discovering: yes ... [NEW] Device 10:20:30:40:50:60 My device ... [bluetooth]# pair 10:20:30:40:50:60 Attempting to pair with 10:20:30:40:50:60 [CHG] Device 10:20:30:40:50:60 Connected: yes [CHG] Device 10:20:30:40:50:60 UUIDs: 00002233-0000-0000-0000-0000549e3568 ... [CHG] Device 10:20:30:40:50:60 ServicesResolved: yes [CHG] Device 10:20:30:40:50:60 Paired: yes Pairing successful [CHG] Device 10:20:30:40:50:60 ServicesResolved: no [CHG] Device 10:20:30:40:50:60 Connected: no ... [bluetooth]# connect 10:20:30:40:50:60 Attempting to connect to 10:20:30:40:50:60 [CHG] Device 10:20:30:40:50:60 Connected: yes Connection successful [CHG] Device 10:20:30:40:50:60 ServicesResolved: yes ... |
Список устройств
1 2 3 4 |
$ bluetoothctl devices Device 10:20:30:40:50:61 HP-345 Device 10:20:30:40:50:62 Redmi Device 10:20:30:40:50:60 My device |
Подключиться к устройству
1 |
$ bluetoothctl connect 10:20:30:40:50:60 |
Отключиться
1 |
$ bluetoothctl disconnect 10:20:30:40:50:60 |