gpt4 book ai didi

bluetooth-lowenergy - 有没有办法在 BlueZ 中创建多连接 BLE 设备?

转载 作者:行者123 更新时间:2023-12-04 07:56:15 25 4
gpt4 key购买 nike

我在 linux 中使用以下命令广播 BLE 广告:

sudo hcitool -i hci0 cmd 0x08 0x0008 1E 02 01 1A 1A FF 4C 00 02 15 63 6F 3F 8F 64 91 4B EE 95 F7 D8 CC 64 A8 63 B5 00 00 00 00 C8

BLE devce 是可见的,但不允许任何连接(因为它遵循 iBeacon 规范,我认为)。所以我的问题是,有没有办法用 BlueZ 创建一个 BLE 设备,它不仅允许一个连接,而且允许多个连接?我在某处读到一个 BLE 设备应该能够允许最多 20 个连接,而经典蓝牙则为 7 个。

非常感谢

最佳答案

这取决于您的硬件及其支持的蓝牙版本。使用蓝牙 v4.1,所有限制都已取消,您的设备可以是连接到多个中心的外围设备。这在 this link 中提到:-

Beginning with version 4.1 of the specification, any restrictions onrole combinations have been removed, and the following are allpossible:

A device can act as a central and a peripheral at the same time.

A central can be connected to multiple peripherals.

A peripheral can be connected to multiple centrals.

Previous versions of the specification limited the peripheral to asingle central connection (although not conversely) and limited therole combinations.

您可以通过hciconfig -a查看您设备的蓝牙版本:-

hci0:   Type: Primary  Bus: USB
BD Address: 00:11:22:33:44:55 ACL MTU: 310:10 SCO MTU: 64:8
UP RUNNING
RX bytes:736 acl:0 sco:0 events:57 errors:0
TX bytes:5366 acl:0 sco:0 commands:57 errors:0
Features: 0xff 0xff 0xcf 0xfe 0xdb 0xff 0x5b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'uknown'
Class: 0x1c0000
Service Classes: Rendering, Capturing, Object Transfer
Device Class: Miscellaneous,
**HCI Version: 4.0 (0x6) Revision: 0x22bb**
LMP Version: 4.0 (0x6) Subversion: 0x22bb
Manufacturer: Cambridge Silicon Radio (10)

我建议在 Linux 上使用 bluetoothctl 实用程序来做广告,而不是通过 hcitool 来做,因为 hcitool 已被弃用并且也不是很用户友好。可以在此处找到有关使用 bluetoothctl 通告和接受传入连接的更多信息:-

关于bluetooth-lowenergy - 有没有办法在 BlueZ 中创建多连接 BLE 设备?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66688715/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com