0

我想使用 AltBeacon lib,但无法识别 blueBar 信标在 logcat 输出下方有 AltBeacon:

01-08 11:28:11.577    8876-12231/com.pdavid.android.widget.bulb D/BluetoothLeScanner﹕ onScanResult() - ScanResult{mDevice=00:07:80:79:18:6C, mScanRecord=ScanRecord [mAdvertiseFlags=6, mServiceUuids=null, mManufacturerSpecificData={76=[2, 21, 61, -99, 76, 102, -5, 15, 17, -29, -85, 100, -56, 42, 20, 51, 20, -42, -128, 121, 24, 108, -74]}, mServiceData={}, mTxPowerLevel=-2147483648, mDeviceName=BlueBar Beacon 883314E57808], mRssi=-61, mTimestampNanos=521250993399662}
01-08 11:28:11.583    8876-8876/com.pdavid.android.widget.bulb D/CycledLeScanner﹕ got record
01-08 11:28:11.592    8876-9225/com.pdavid.android.widget.bulb D/BeaconParser﹕ This is not a matching Beacon advertisement.  (Was expecting be ac.  The bytes I see are: 0201061aff4c0002153d9d4c66fb0f11e3ab64c82a143314d68079186cb61c09426c756542617220426561636f6e20383833333134453537383038000000

我搜索了 blueBar 信标的广告包方案,但没有运气。

ScanResult{mDevice=00:07:80:79:18:6C, mScanRecord=ScanRecord [mAdvertiseFlags=6, mServiceUuids=null, mManufacturerSpecificData={76=[2, 21, 61, -99, 76, 102, -5, 15, 17, -29, -85, 100, -56, 42, 20, 51, 20, -42, -128, 121, 24, 108, -74]}, mServiceData={}, mTxPowerLevel=-2147483648, mDeviceName=BlueBar Beacon 883314E57808], mRssi=-61, mTimestampNanos=521250993399662}

    beaconManager.getBeaconParsers().add(new BeaconParser().
            setBeaconLayout("???????????????????????????????????"));

谢谢

编辑 :

我在我的应用程序子类中添加了以下代码:

    beaconManager.getBeaconParsers()
        .add(new BeaconParser()
             .setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25"));

    String blueBarUuid = "A0B13730-3A9A-11E3-AA6E-0800200C9A66";
    // wake up the app when a beacon is seen
    Region region = new Region("backgroundRegion",
                               Identifier.parse(blueBarUuid), null, null);
    regionBootstrap = new RegionBootstrap(this, region);
    BeaconManager.debug = true;

接缝现在可以工作了。没有它,我会得到“这不是匹配的 Beacon 广告。”

更多输出:

beacon detected multiple times in scan cycle :id1: 3d9d4c66-fb0f-11e3-ab64-c82a143314d6 id2: 32889 id3: 6252
beacon detected :id1: 3d9d4c66-fb0f-11e3-ab64-c82a143314d6 id2: 32889 id3: 6252
This region does not match: id1: a0b13730-3a9a-11e3-aa6e-0800200c9a66 id2: null id3: null


This is not a matching Beacon advertisement.  (Was expecting be ac.  The bytes I see are: 0201061aff4c0002153d9d4c66fb0f11e3ab64c82a143314d68079186cb61c09426c7565426172
This is a recognized beacon advertisement -- 0215 seen
Byte array is size 2
index is 0
calculatedValue for position 0 with positionValue 1 and byteValue 121 is 121
index is 1
calculatedValue for position 1 with positionValue 256 and byteValue 128 is 32768
Byte array is size 2
index is 0
calculatedValue for position 0 with positionValue 1 and byteValue 108 is 108
index is 1
calculatedValue for position 1 with positionValue 256 and byteValue 24 is 6144
Byte array is size 1
index is 0
calculatedValue for position 0 with positionValue 1 and byteValue 28 is 28
parsing found data field 0
Byte array is size 1
index is 0
calculatedValue for position 0 with positionValue 1 and byteValue 182 is 182
Byte array is size 2
index is 0
calculatedValue for position 0 with positionValue 1 and byteValue 21 is 21
index is 1
calculatedValue for position 1 with positionValue 256 and byteValue 2 is 512
Byte array is size 2
index is 0
calculatedValue for position 0 with positionValue 1 and byteValue 76 is 76
index is 1
calculatedValue for position 1 with positionValue 256 and byteValue 0 is 0
beacon detected multiple times in scan cycle :id1: 3d9d4c66-fb0f-11e3-ab64-c82a143314d6 id2: 32889 id3: 6252
beacon detected :id1: 3d9d4c66-fb0f-11e3-ab64-c82a143314d6 id2: 32889 id3: 6252
This region does not match: id1: a0b13730-3a9a-11e3-aa6e-0800200c9a66 id2: null id3: null
4

1 回答 1

1

根据文档,BlueBar 信标使用与 iBeacon 相同的布局:

BlueBar Beacon 的主要特点如下: - 完全兼容 iBeacon 技术 - 经过测试并适用于 iPhone(4S 及更新版本)以及 iPad

资料来源: http ://bluesensenetworks.com/announcing-bluebar-beacon/

所以答案基本上是重复的:这是用 AltBeacon 的 Android 信标库检测 iBeacons 的正确布局吗?

于 2015-01-08T17:18:54.133 回答