蓝牙基础学习笔记


author: hjjdebug

date: 早期

descrip: 蓝牙基础


文章目录

  • [1. linux 怎样判断笔记本是否有蓝牙功能](#1. linux 怎样判断笔记本是否有蓝牙功能)
  • [2. 安装bluetooth 工具 bluez](#2. 安装bluetooth 工具 bluez)
    • [2.1 hciconfig HCI 设备配置工具](#2.1 hciconfig HCI 设备配置工具)
    • [2.2 hcitool ,HCI 设备管理工具](#2.2 hcitool ,HCI 设备管理工具)

早期学习蓝牙的一个笔记.(入门基础),留念.

1. linux 怎样判断笔记本是否有蓝牙功能

$ lsmod |grep -i blue

bluetooth 548864 9 btrtl,btintel,btbcm,ath3k,btusb,rfcomm

ecdh_generic 16384 1 bluetooth

说明有bluetooth 模块

$ lsusb

Bus 001 Device 006: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller

Bus 001 Device 007: ID 0cf3:0036 Atheros Communications, Inc.

Bus 001 Device 004: ID 0c45:670b Microdia

Bus 001 Device 003: ID 17ef:6025 Lenovo ThinkPad Travel Mouse

Bus 001 Device 002: ID 8087:8001 Intel Corp.

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 002 Device 002: ID 413c:2105 Dell Computer Corp. Model L100 Keyboard

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

对 ID 0cf3:0036 表示严重关切!

$ lsusb -d 0cf3:0036 看到了详细信息.

sudo lshw -C bus 或者 sudo lshw |grep usb 都能确认是否有蓝牙功能.

2. 安装bluetooth 工具 bluez

$sudo apt install bluez

于是hciconfig, hcitool, rfcommand 等命令均可使用


2.1 hciconfig HCI 设备配置工具


$ hciconfig -h // 一堆使用帮助信息,可以打开,关闭,复位hcix设备,以及改变名称,开启关闭广播,查询状态等操作.

$ hciconfig 或 hciconfig -a

hci0: Type: Primary Bus: USB

BD Address: 4C:BB:58:5D:D1:1D ACL MTU: 1022:8 SCO MTU: 183:5

UP RUNNING

RX bytes:144891 acl:7105 sco:0 events:7380 errors:0

TX bytes:157287 acl:7106 sco:0 commands:82 errors:0

$ hciconfig hci0 name

hci0: Type: Primary Bus: USB

BD Address: 4C:BB:58:5D:D1:1D ACL MTU: 1022:8 SCO MTU: 183:5

Name: 'Bluetooth USB Host Controller'


2.2 hcitool ,HCI 设备管理工具


$ hcitool -h

$ hcitool dev

Devices:

hci0 4C:BB:58:5D:D1:1D

$ hcitool scan

Scanning ...

00:9E:C8:63:59:D7 客厅的小米盒子

$ hcitool

其它工具: bluetoothctl bluetoothd bluetooth-sendto

与调试有关, 功力不够,下次再叙!

相关推荐
你怎么知道我是队长2 天前
经典蓝牙(Classic Bluetooth / BR/EDR)--- 核心协议层5 --- 经典蓝牙(BR/EDR)电缆替代协议层核心机制详解
bluetooth
你怎么知道我是队长7 天前
经典蓝牙(Classic Bluetooth / BR/EDR)--- 核心协议层1 --- 经典蓝牙(BR/EDR)物理层核心机制详解
bluetooth
K成长日志9 天前
BLE链路层空口包--数据物理信道PDU
网络·物联网·网络协议·嵌入式·蓝牙·iot·ble
byte轻骑兵9 天前
如何定制BlueZ编译:开启/关闭BLE/音频模块的编译参数配置
linux·arm开发·蓝牙·bluez·电脑蓝牙
byte轻骑兵10 天前
蓝牙PBP公共广播协议:解锁LE Audio的公共音频新生态
音视频·蓝牙·蓝牙耳机·le audio·低功耗蓝牙音频
byte轻骑兵16 天前
BlueZ源码编译环境配置全指南:Linux桌面原生编译 + 嵌入式ARM交叉编译 + 定制裁剪与调试实战
linux·arm开发·蓝牙·bluez·电脑蓝牙
piaoyiren18 天前
基于 STM32F103 蓝牙遥控云台超声波避障小车
stm32·单片机·嵌入式硬件·蓝牙·超声波测距·直流电机
K成长日志22 天前
BLE链路层空口包--LE Uncoded PHY
物联网·嵌入式·蓝牙·iot·ble·无线·通信
TengTaiTech1 个月前
打破ANC的“静默牢笼”:基于QCC3095实现主动降噪与侧音共存的音频方案
蓝牙·qcc·混音
奔跑吧 android1 个月前
【Bluetooth-SIG】【CoreV6.2】【Vol3 Part G】【GATT】【零】【GATT 逐句逐段学习计划 2】
ble·bluetooth·att·gatt·core_v6.2·sig