【发布时间】:2021-10-21 05:09:56
【问题描述】:
尝试使用 android 信标库(带有 xamarin 绑定)检测树莓派上的 iBeacon 设置
想知道我在这里做错了什么:
sudo hcitool -i hci0 cmd 0x08 0x0008 1E 02 01 1A 1A FF 4C 00 02 15 E2 0A 39 F4 73 F5 4B C4 A1 2F 17 D1 AD 07 A9 61 00 01 00 00 C8 00
然后像这样设置 Beacon Parser
beaconManager.BeaconParsers.Add(new BeaconParser().SetBeaconLayout("m:0-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"));
我可以在 Android 上使用例如“BeaconScope”检测此信标,但我无法使用 android 信标库检测到它。
我可以从调试中看到以下输出
[BeaconParser] Processing pdu type FF: 02011a1aff4c000215e20a39f473f54bc4a12f17d1ad07a96100010000c80000000000000000000000000000000000000000000000000000000000000000 with startIndex: 5, endIndex: 29
[BeaconParser] Ignoring pdu type 06
[BeaconParser] This is not a matching Beacon advertisement. (Was expecting be ac. The bytes I see are: 02011a1aff4c000215e20a39f473f54bc4a12f17d1ad07a96100010000c80000000000000000000000000000000000000000000000000000000000000000
设置为 AltBeacon 工作!
sudo hcitool -i hci0 cmd 0x08 0x0008 1F 02 01 1A 1B FF 18 01 BE AC 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 01 C5 01
图书馆检测到这个。
我错过了什么?
我将 RadButton 设置检测为 iBeacon,但无法从树莓派中使用它
【问题讨论】:
-
仅供参考:
hcitool是 2017 年 BlueZ 项目的 deprecated。支持的工具是bluetoothctl或btmgmt。使用bluetoothctl涉及更多一点,但btmgmt仍然允许您将信标用作单线。例如sudo btmgmt add-adv --adv-data 1BFF1801BEAC0000000000000000000000000000000000010001C501 --general-discov 1。和sudo btmgmt rm-adv 1删除广告。您可以使用bluetoothctl做更多事情,而无需sudo也可以工作