Android AltBeacon library: how to find the beacon layout?
Asked Answered
O

2

8

I'm testing with a new type of beacon, and this is what I got from the debug:

onScanResult() - ScanResult{mDevice=20:73:2A:09:3E:41, mScanRecord=ScanRecord [mAdvertiseFlags=26, mServiceUuids=null, mManufacturerSpecificData={76=[2, 21, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 0, 5, 0, 10, -40]}, mServiceData={}, mTxPowerLevel=-2147483648, mDeviceName=null], mRssi=-55, mTimestampNanos=23541956038874}

After playing around with many beacon layout in SO, I still can't detect it for my app. From the debug above, how to find out the beacon parser. Is there a "universal" beacon layout for all types of beacons? Locate Beacon apps can detect my beacon. Any body knows the pattern?

Thanks.

Olfactory answered 10/9, 2015 at 23:59 Comment(0)
T
31

Here is a list of the main beacon layouts -

ALTBEACON   "m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25"

EDDYSTONE  TLM  "x,s:0-1=feaa,m:2-2=20,d:3-3,d:4-5,d:6-7,d:8-11,d:12-15"

EDDYSTONE  UID  "s:0-1=feaa,m:2-2=00,p:3-3:-41,i:4-13,i:14-19"

EDDYSTONE  URL  "s:0-1=feaa,m:2-2=10,p:3-3:-41,i:4-20v"

IBEACON  "m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"

A reference list here.

Towandatoward answered 23/11, 2015 at 21:7 Comment(0)
S
1

If the Locate Beacon app can detect your beacon, you can see all the beacon layouts it to uses by going to the settings screen. You can copy the layout expressions from there.

Unfortunately, there is no "universal" layout for beacons. This would require predicting new inventions people have not come up with yet.

Sylvanite answered 11/9, 2015 at 2:13 Comment(12)
Thanks David. In the Settings screen, I see many layouts, but don't know which one is the right one. These are the beacon I detect link and these are the layout I see link. I want to detect the custom beacon with "ugly" UUID like the 111111...Olfactory
I know they are not Samsung, not EddyStone, not AltBeacon. The first layout is probably them, but they are marked with ***Olfactory
Sorry to not be able to help more directly, but I suspect you are referring to the proprietary iBeacon format. Due to intellectual property restrictions we cannot publish the format. Doing a Google search for its layout will surely find you the answer.Sylvanite
Thanks, yes I googled "setBeaconLayout" but came up with other layout. The proprietary beacon is the new hardware I'm testing with (the hardware manufacturer sent them to me). Can I put a breakpoint at your layout parser to get the *** string you return?Olfactory
You really do not need to bother with a breakpoint... I assure you the information you want is easily available via a Google search. What makes you day the "other" layout you found is incorrect? Did you try it? The beacon may be new, but the layout is likely unchanged.Sylvanite
Hi David, After searching from Google, the beacon layouts I use in the code are String layout1 = "m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25"; String layout2 = "m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25"; String layout3 = "m:2-3=0203,i:4-19l,d:10-13,p:9-9"; mBeaconManager.getBeaconParsers().add(new BeaconParser().setBeaconLayout(layout1)); Only layout 1 can detect the proprietary beacons, but it also detects SenionLab beacons. Layout 2 and 3 can't detect anything. Any search term other than "setBeaconLayout" I should try? Thanks a lot.Olfactory
Why is it a problem that the fist layout also detects the SenionLab beacon? It is common for beacons from multiple manufacturers to share the same layout. You should not expect them to necessarily be different.Sylvanite
I don't see a problem when the first layout detects SenionLab beacons. Just don't know how to differentiate between SenionLab and the new one...Olfactory
It may very well be that there is no way to detect the difference -- the data transmitted might be identical. You can, of course, set the identifiers on each beacon to be different so you know how to differentiate them.Sylvanite
I'd like to reopen this question as I could not find the layout for a new beacon provider. It's proprietary but the Locate app could still detect it (showing as ***). Could you show me how to use the BeaconParser class to get the layout? The manufacturer beacon's typical message the following hex-string: 0201061AFF4C0002156E42F68AD0D1467BA23E9D11FA746E43000A0001C51508303030313030306136653432663638616430643107FFBC010003A9150000 I've tried with both "m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25" and "m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24" but none worked.Olfactory
Double check that the second layout does not work. If tgat fails, please open a new question.Sylvanite
The second layout indeed works. It didn't work before because I added many different BeaconParser to use (beaconManager.getBeaconParsers().add(...)). When I removed them all but the second layout the beacons showed up. One thing I notice in logcat is that even if I only add the second layout, the first layout is always added by default.Olfactory

© 2022 - 2024 — McMap. All rights reserved.