我正在尝试了解蓝牙堆栈。在许多博客中,他们提到了一个名为bccmd的工具。但是当我下载包bluez并编译它时,我没有找到它。它似乎在工具文件夹中。有人能告诉我这个包或其他包中是否有替代品吗?
VL-80
Asked:
2022-03-10 12:41:38 +0800 CST
根据 Bluez API 文档(设备 API),该Connect()
方法的返回表示一个或多个配置文件的成功连接:
无效连接()
(跳过)
如果成功连接了至少一个配置文件,则此方法将指示成功。
同时还有一个Connected
属性,描述为:
布尔连接 [只读]
指示远程设备当前是否已连接。PropertiesChanged 信号指示此状态的更改。
在实践中,方法的返回和通知属性设置Connect()
的信号的到达似乎相隔几秒钟。PropertiesChanged
Connected
true
运行 bluetoothctl 时:
[bluetooth]# connect XX:XX:XX:XX:XX:XX
Attempting to connect to XX:XX:XX:XX:XX:XX
[CHG] Device XX:XX:XX:XX:XX:XX Connected: yes
Connection successful
在 D-Bus 上捕获了以下消息:
方法调用时间=1646854334.904791 发件人=:1.521 -> 目的地=org.bluez 串行=50 路径=/org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX;接口=org.bluez.Device1;成员=连接 信号时间=1646854336.902736 发件人=:1.128 -> 目的地=(空目的地)串行=10521 路径=/org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX;接口=org.freedesktop.DBus.Properties;成员=属性已更改 字符串“org.bluez.Device1” 大批 [ 字典条目( 字符串“已连接” 变体布尔真 ) ] 大批 [ ] 方法返回时间=1646854339.349113 发件人=:1.128 -> 目的地=:1.521 串行=10522 回复串行=50
这告诉我们:
- 当属性更改为信号所报告的 ( )
[CHG] Device XX:XX:XX:XX:XX:XX Connected: yes
时,屏幕上会出现。Connected
true
time=1646854336.902736
- 当方法返回 ( ) 时会出现该
Connection successful
消息。Connect()
time=1646854339.349113
- 这些事件相隔 2.4 秒发生。
问题是这两个事件之间有什么区别,哪一个实际上表示蓝牙设备已连接?
(断开设备连接时,Disconnect()
方法返回和信号到达0.003
相隔数秒)。
环境:Linux内核:5.4-179
,Bluez:5.62-r3
,Systemd 249.9
:。
Andrew Virya Victorio
Asked:
2021-11-06 18:27:30 +0800 CST
我用 Windows11 做双引导 Kali-Linux。所以问题是我想连接我的蓝牙扬声器(JBL GO),但不幸的是我无法连接。我使用 GUI 和 CLI 连接到我的扬声器。它以前工作得很好。我可以在 Windows 中连接,但不能在我的 Kali 中连接。
这是使用 GUI 的消息:
这是使用 CLI 的消息:
$ bluetoothctl
Agent registered
[bluetooth]# agent KeyboardOnly
Agent is already registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# scan on
Discovery started
[CHG] Controller 00:1A:7D:DA:71:15 Discovering: yes
[CHG] Device 30:C0:1B:95:1D:C3 RSSI: -51
[CHG] Device 30:C0:1B:95:1D:C3 TxPower: 0
[bluetooth]# remove 30:C0:1B:95:1D:C3
[DEL] Device 30:C0:1B:95:1D:C3 JBL GO
Device has been removed
[NEW] Device 30:C0:1B:95:1D:C3 JBL GO
[CHG] Device 30:C0:1B:95:1D:C3 TxPower: 0
[CHG] Device 30:C0:1B:95:1D:C3 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device 30:C0:1B:95:1D:C3 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Device 30:C0:1B:95:1D:C3 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device 30:C0:1B:95:1D:C3 UUIDs: 0000110d-0000-1000-8000-00805f9b34fb
[CHG] Device 30:C0:1B:95:1D:C3 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[bluetooth]# trust 30:C0:1B:95:1D:C3
[CHG] Device 30:C0:1B:95:1D:C3 Trusted: yes
Changing 30:C0:1B:95:1D:C3 trust succeeded
[bluetooth]# pair 30:C0:1B:95:1D:C3
Attempting to pair with 30:C0:1B:95:1D:C3
[CHG] Device 30:C0:1B:95:1D:C3 Connected: yes
[CHG] Device 30:C0:1B:95:1D:C3 UUIDs: 00001101-0000-1000-8000-00805f9b34fb
[CHG] Device 30:C0:1B:95:1D:C3 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Device 30:C0:1B:95:1D:C3 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device 30:C0:1B:95:1D:C3 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device 30:C0:1B:95:1D:C3 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device 30:C0:1B:95:1D:C3 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device 30:C0:1B:95:1D:C3 ServicesResolved: yes
[CHG] Device 30:C0:1B:95:1D:C3 Paired: yes
Pairing successful
[CHG] Device 30:C0:1B:95:1D:C3 ServicesResolved: no
[CHG] Device 30:C0:1B:95:1D:C3 Connected: no
[bluetooth]# connect 30:C0:1B:95:1D:C3
Attempting to connect to 30:C0:1B:95:1D:C3
Failed to connect: org.bluez.Error.Failed
[bluetooth]# exit
我检查了蓝牙服务:
$ sudo systemctl status bluetooth
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; disabled; vendor preset: disabled)
Active: active (running) since Sat 2021-11-06 08:32:21 WIB; 47min ago
Docs: man:bluetoothd(8)
Main PID: 3844 (bluetoothd)
Status: "Running"
Tasks: 1 (limit: 38347)
Memory: 2.0M
CPU: 439ms
CGroup: /system.slice/bluetooth.service
└─3844 /usr/libexec/bluetooth/bluetoothd
Nov 06 09:12:21 [hostname] bluetoothd[3844]: Endpoint registered: sender=:1.87 path=/MediaEndpoint/A2DPSink/sbc
Nov 06 09:12:21 [hostname] bluetoothd[3844]: Endpoint registered: sender=:1.87 path=/MediaEndpoint/A2DPSource/sbc
Nov 06 09:12:21 [hostname] bluetoothd[3844]: Endpoint registered: sender=:1.87 path=/MediaEndpoint/A2DPSink/sbc_xq_453
Nov 06 09:12:21 [hostname] bluetoothd[3844]: Endpoint registered: sender=:1.87 path=/MediaEndpoint/A2DPSource/sbc_xq_453
Nov 06 09:12:21 [hostname] bluetoothd[3844]: Endpoint registered: sender=:1.87 path=/MediaEndpoint/A2DPSink/sbc_xq_512
Nov 06 09:12:21 [hostname] bluetoothd[3844]: Endpoint registered: sender=:1.87 path=/MediaEndpoint/A2DPSource/sbc_xq_512
Nov 06 09:12:21 [hostname] bluetoothd[3844]: Endpoint registered: sender=:1.87 path=/MediaEndpoint/A2DPSink/sbc_xq_552
Nov 06 09:12:21 [hostname] bluetoothd[3844]: Endpoint registered: sender=:1.87 path=/MediaEndpoint/A2DPSource/sbc_xq_552
Nov 06 09:12:30 [hostname] bluetoothd[3844]: /org/bluez/hci0/dev_30_C0_1B_95_1D_C3/sep1/fd0: fd(42) ready
Nov 06 09:12:30 [hostname] bluetoothd[3844]: profiles/audio/avctp.c:avctp_connect_browsing_cb() Browsing: connect to 30:C0:1B:95:1D:C3: Connection refused (111)
我已经尝试过了rfkill
,alsa
但没有结果。但是当我尝试这些命令时:
$ pulseaudio -k
$ pulseaudio -D
$ pulseaudio --start
, 有用。但我无法在pavucontrol
. 现在我被困住了:|
这是我的 Kali 版本:
$ uname -a
Linux [my_hostname] 5.14.0-kali2-amd64 #1 SMP Debian 5.14.9-2kali1 (2021-10-04) x86_64 GNU/Linux
蓝牙版本:bluetoothctl: 5.61
蓝人版:2.2.2-1
user351890
Asked:
2019-05-08 22:47:31 +0800 CST