【问题标题】:Raspberry Pi IBeacon missing name characteristicRaspberry Pi IBeacon 缺少名称特征
【发布时间】:2015-07-10 07:17:17
【问题描述】:

我根据https://learn.adafruit.com/pibeacon-ibeacon-with-a-raspberry-pi/setting-up-the-pi等几个教程将Raspberry Pi设置为iBeacon

只要我能找到具有不同应用程序的信标,一切正常。 但我也从 BeaconInside 购买了一个“真正的”iBeacon,在将两个信标的广告数据与蓝牙 LE 扫描应用程序进行比较时,我注意到存在差异:

pi-beacon 缺少“名称(完整)”和“服务数据”记录: http://postimg.org/image/yc5wky7bv/

我还尝试使用 Android BluetoothLeGatt 示例应用程序 (developer.android.com/samples/BluetoothLeGatt/index.html) 扫描两者并得到相同的结果:

信标内部:

8836-8889/com.example.android.bluetoothlegatt D/BluetoothLeScanner﹕ onScanResult() - ScanResult{mDevice=78:A5:04:39:8C:3A, mScanRecord=ScanRecord [mAdvertiseFlags=6, mServiceUuids=null, mManufacturerSpecificData={76=[2, 21, -16, 1, -117, -101, 117, 9, 76, 49, -87, 5, 26, 39, -45, -100, 0, 60, 51, 1, -86, -36, -65]}, mServiceData={0000d00d-0000-1000-8000-00805f9b34fb=[1, 51, -36, -86, 93]}, mTxPowerLevel=0, mDeviceName=BEACON 39:8C:3A], mRssi=-76, mTimestampNanos=387592434672407}

树莓派信标:

8836-8889/com.example.android.bluetoothlegatt D/BluetoothLeScanner﹕ onScanResult() - ScanResult{mDevice=5C:F3:70:61:93:C7, mScanRecord=ScanRecord [mAdvertiseFlags=6, mServiceUuids=null, mManufacturerSpecificData={76=[2, 21, -30, -59, 109, -75, -33, -5, 72, -46, -80, 96, -48, -11, -89, 16, -106, -32, 17, 17, 18, 17, -56]}, mServiceData={}, mTxPowerLevel=-2147483648, mDeviceName=null], mRssi=-28, mTimestampNanos=387592794842927}

DeviceName 为空且没有 ServiceData。

hciconfig hci0 -a:

hci0:类型:BR/EDR 总线:USB
BD 地址:5C:F3:70:61:93:C7 ACL MTU:1021:8 SCO MTU:64:1
正在运行 PSCAN ISCAN
RX 字节:2785 acl:0 sco:0 事件:73 错误:0
TX 字节:1348 acl:0 sco:0 命令:71 错误:0
特点:0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
数据包类型:DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
链接策略:RSWITCH SNIFF
链接模式:SLAVE ACCEPT
名称:'ABC'
类:0x000000
服务类别:未指定
设备类:杂项,
HCI 版本:4.0 (0x6) 修订:0x1000
LMP 版本:4.0 (0x6) 颠覆:0x220e
制造商:博通公司(15)

有人知道为什么 pi-beacon 没有名称和服务数据记录吗?

【问题讨论】:

    标签: linux raspberry-pi bluetooth-lowenergy ibeacon


    【解决方案1】:

    设备名称作为 BLE 扫描响应的一部分发送,而不是信标广告的一部分。蓝牙信标通常不会在扫描响应中发送名称。

    如果您想让 BlueZ 设备在扫描响应中传输其名称,您可以尝试使用如下命令进行设置:hciconfig hci0 name 'Device Name'

    【讨论】:

    • 谢谢。我已经尝试过这种方法,但没有帮助。
    猜你喜欢
    • 2022-01-02
    • 2015-11-16
    • 1970-01-01
    • 2017-06-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-07
    • 2022-11-25
    相关资源
    最近更新 更多