最近做项目遇到需使用树莓派连接低功耗蓝牙的功能,终于找到一个适合Ubuntu系统的蓝牙连接工具:bluetoothctl。
首先,确保树莓派安装有bluetoothctl,具体安装步骤可参照以下链接:https://mcuoneclipse.com/2016/12/19/tutorial-ble-pairing-the-raspberry-pi-3-model-b-with-hexiwear/
确保树莓派bluetoothctl安装完成后,启动:
pi@raspberrypi: ~bluetoothctl
Waiting to connect to bluetoothd...
启动完成,输入help可以看到所有的命令
[bluetooth]# help
Available commands:
list List available controllers
show [ctrl] Controller information
select <ctrl> Select default controller
devices List available devices
paired-devices List paired devices
power <on/off> Set controller power
pairable <on/off> Set controller pairable mode
discoverable <on/off> Set controller discoverable mode
agent <on/off/capability> Enable/disable agent with given capability
d