蓝牙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编 ...
随机推荐
- Java 并发队列 BlockingQueue
BlockingQueue 开篇先介绍下 BlockingQueue 这个接口的规则,后面再看其实现. 首先,最基本的来说, BlockingQueue 是一个先进先出的队列(Queue),为什么说是 ...
- 安装phpldapadmin
关闭防火墙 [root@ldapmaster2 ~]# systemctl disable firewall [root@ldapmaster2 ~]# systemctl stop firewall ...
- Spring Boot 集成 WebSocket 实现服务端推送消息到客户端
假设有这样一个场景:服务端的资源经常在更新,客户端需要尽量及时地了解到这些更新发生后展示给用户,如果是 HTTP 1.1,通常会开启 ajax 请求询问服务端是否有更新,通过定时器反复轮询服务端响应的 ...
- SQLyog无操作一段时间后重新操作会卡死问题(解决办法)
这种是因为一段时间不操作后,服务器将空闲连接丢弃了,而客户端(sqlyog)不知道,导致长时间无响应,而超时之后,sqlyog 使用了新的连接,所以又可以顺畅操作了. 将会话空闲时间默认改为自定义,填 ...
- 探讨Netty获取并检查Websocket握手请求的两种方式
在使用Netty开发Websocket服务时,通常需要解析来自客户端请求的URL.Headers等等相关内容,并做相关检查或处理.本文将讨论两种实现方法. 方法一:基于HandshakeComplet ...
- Linux下利用docker搭建elasticsearch(单节点)
1. 拉取镜像 #elasticsearch 6.x和7.x版本有很多不一样需要确认 docker pull docker.elastic.co/elasticsearch/elasticsearch ...
- 畅购商城(二):分布式文件系统FastDFS
好好学习,天天向上 本文已收录至我的Github仓库DayDayUP:github.com/RobodLee/DayDayUP,欢迎Star,更多文章请前往:目录导航 畅购商城(一):环境搭建 畅购商 ...
- 测试驱动开发学习笔记(UTDD)
title: 测试驱动开发学习笔记(UTDD) date: 2020-08-01 23:59:17 tags: [2020, 学习一门技能, TDD, DevOps] What TDD(Test-Dr ...
- 简单的 vector
#pragma once #include <memory.h> #include <stdlib.h> #include <iostream> using std ...
- Linux常用命令之cp、mv、rm、cat、more、head、tail、ln命令讲解
上一章节中,我们了解到了Linux系统的最基础的几个文件处理命令,核心的是ls命令,在今天这章中,我们来继续学习Linux对于文件操作相关的一些命令,比如复制.移动.删除.查看等命令. 1.cp 命令 ...