蓝牙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 bluetooth
sudo service bluetooth stop
rfkill unblock bluetooth
bluetoothd -n -d - 启动bluetoothd
蓝牙bluez命令的更多相关文章
- Linux 下蓝牙bluez分析及使用 (1)
蓝牙耳机的使用 由于Linux下蓝牙使用不及Windows下直观,致使使用时会出现一些小问题.虽然是小问题,但是由于普通的操作都具有顺序性,前面的中断了,后面的哪怕再简单,也无法继续了.正好近期工作与 ...
- 蓝牙bluez学习(1) Stack Architecture
Bluez支持的features Core Specification 4.2 (GAP, L2CAP, RFCOMM, SDP, GATT) Classic Bluetooth (BR/EDR) B ...
- 【转】Android bluetooth介绍(二): android blueZ蓝牙代码架构及其uart 到rfcomm流程
原文网址:http://blog.sina.com.cn/s/blog_602c72c50102uzoj.html 关键词:蓝牙blueZ UART HCI_UART H4 HCI L2CAP ...
- 树莓派开发笔记(十一):蓝牙的使用,BlueZ协议(双树莓探测rssi并通过蓝牙互传获取的rssi信号强度)
若该文为原创文章,转载请注明原文出处本文章博客地址:https://blog.csdn.net/qq21497936/article/details/110940484长期持续带来更多项目与技术分享, ...
- 【转】Android bluetooth介绍(三): 蓝牙扫描(scan)设备分析
原文网址:http://blog.csdn.net/xubin341719/article/details/38584469 关键词:蓝牙blueZ A2DP.SINK.sink_connect.s ...
- Android bluetooth介绍(三): 蓝牙扫描(scan)设备分析
关键词:蓝牙blueZ A2DP.SINK.sink_connect.sink_disconnect.sink_suspend.sink_resume.sink_is_connected.sink_ ...
- Android bluetooth介绍(两): android 蓝牙源架构和uart 至rfcomm过程
关键词:蓝牙blueZ UART HCI_UART H4 HCI L2CAP RFCOMM 版本号:基于android4.2先前版本 bluez内核:linux/linux3.08系统:an ...
- Android开发——蓝牙
---恢复内容开始--- 前言 孤芳自赏,一揽芳华: 人情冷暖,自在人心: 登高远眺,望步止前: 喜笑言开,欺人骗己. 上篇文章介绍了基本的蓝牙使用,书写的demo也不是很完善,希望各位大神能够改正. ...
- nRF Connect SDK(NCS)/Zephyr固件升级详解 – 重点讲述MCUboot和蓝牙空中升级
如何在nRF Connect SDK(NCS)中实现蓝牙空中升级?MCUboot和B0两个Bootloader有什么区别?MCUboot升级使用的image格式是怎么样的?什么是SMP协议?CBOR编 ...
随机推荐
- HRNet + Object Contextual Representation
文章内容来自CCF-CV走进高校报告会中MSRA王井东老师的报告"Learning high-resolution and object-contextual representations ...
- Sts 授权直传阿里云 OSS-.net core实现
前言 磁盘怎么又满了?赶紧 快 打电话给运维扩容扩容扩容!这个问题已经是我入职新公司两个月来,第 3 次听到了.经过一通了解,事情原来是这样的.虽然我们使用了阿里云的 OSS 对象存储服务,但是为了不 ...
- sscanf,sprintf(思修课的收获)
转载的,就是做个笔记 sprintf函数原型为 int sprintf(char *str, const char *format, ...).作用是格式化字符串,具体功能如下所示: (1)将数字变量 ...
- Debug HashMap
目录 1,HashMap面试必问 2,Debug源码的心得体会 3,JDK 1.7 3.1 用debug分析一个元素是如何加入到HashMap中的[jdk1.7] 3.2 用debug分析HashMa ...
- NameNode中的高可用方案
NN中元数据的可靠性是可以保证的,但是其可用性并不高,因为Namenode是单节点的,所以一旦这个节点不能工作,那么整个hdfs都不能工作,但是由于SecondaryNameNode的机制,所以,即便 ...
- JVM系列之:JIT中的Virtual Call接口
目录 简介 最常用的接口List 多个List的调用 不一样的List调用 总结 简介 上一篇文章我们讲解了Virtual Call的定义并举例分析了Virtual Call在父类和子类中的优化. J ...
- python8.4景区买票
from threading import Threadimport threadinglock=threading.Lock()num=100#定义买票方法def sale(name): lock. ...
- python3.1for循环及应用
#给定范围,进行循环for i in range (0,5): print(i) #对序列进行遍历list1=[1,2,3,4,5]for i in list1: print(i+1) #对元组进行遍 ...
- (转)海思平台HI35XX系列内存设置
海思平台的内存分为两部分,一部分给系统使用,另外的一部分给多媒体使用.可以通过cat /proc/meminfo查看系统内存和cat /proc/media-mem 查看多媒体内存使用情况. /pro ...
- Python高性能HTTP客户端库requests的使用
Python中有许多HTTP客户端.使用最广泛且最容易的是requests. 持续连接 很多人学习python,不知道从何学起.很多人学习python,掌握了基本语法过后,不知道在哪里寻找案例上手.很 ...