蓝牙bluez命令 |
您所在的位置:网站首页 › 蓝牙pbap什么意思 › 蓝牙bluez命令 |
记录一下自己平时调试蓝牙的命令,后续学习到再添加
sdptool命令: sdptool add SP - 添加SPP: sdptool add --channel=1 DID SP DUN LAN FAX OPUSH FTP HS HF SAP NAP GN PANU HID CIP CTP A2SRC A2SNK SYNCML NOKID PCSUITE SR1 sdptool brower local - 查看适配器提供的功能
bluetoothctl 命令: bluetoothctl scan on 扫描bluetoothctl agent on 代理bluetoothctl default-agent 默认代理bluetoothctl trust xx:xx:xx:xx:CF:F0 信任bluetoothctl pair xx:xx:xx:xx:CF:F0 配对
命令行进入: bluetoothctl 查看:default-agent 注册agent:agent on 扫描:scan on 停止扫描:scan off 找到要配对的蓝牙:pair xx:xx:xx:xx:xx:xx 添加信任:trust xx:xx:xx:xx:xx:xx 连接:connect xx:xx:xx:xx:xx:xx 设置蓝牙可被发现状态:discoverable yes
rfcomm命令: mknod /dev/rfcomm0 c 216 0 ---216是RFCOMM设备号 rfcomm bind 0 xx:xx:xx:xx:CF:F0 绑定设备 rfcomm connect 0 xx:xx:xx:xx:CF:F0 1连接设备 rfcomm show 0 查看设备状态 cat >/dev/rfcomm0 写数据 rfcomm release 0 解绑
rfcomm watch /dev/rfcomm0 3 /sbin/agetty rfcomm0 linux 115200 --没用过
hciconfig命令: hciconfig hci0 piscan 可使设备既可见hciconfig -a 查看hci详细信息hciconfig hci0 sspmode disable #关闭简易配对模式 enable为使能简易配对hciconfig hci0 sspmode #查看简易配对模式状态 hciconfig hci0 up hciconfig hci0 down
hciattach命令: hciattach /dev/ttyACM1 any
linux蓝牙配置文件: Bluetoothd保存的对端设备的信息:/var/lib/bluetooth/ bluetooth配置:/etc/bluetooth/ /usr/lib/systemd/system/bluetooth.service /sys/class/bluetooth/ dbus中系统总线的配置/etc/dbus-1/system.d/bluetooth.conf
bluetooth service和bluetoothd进程: service --status-all | grep blue -查看是否存在bluetooth service ps -ef|grep blue -查看是否存在bluetoothd进程 service bluetooth start -开启bluetooth service service bluetooth stop -停止bluetooth service
停止bluetoothd进程方法:rfkill block bluetoothsudo service bluetooth stoprfkill unblock bluetooth bluetoothd -n -d - 启动bluetoothd
|
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |