AltBeacon setBeaconLayout()
Asked Answered
S

1

19

I would like to know what the Beacon Code stands for. I mean, as far as I know it should identify the beacon layout. Does this mean that I can customize any sort of layout and assign to it any sort of Beacon Code? I mean, can I write something like that:

setBeaconLayout("m:2-3=abcd,i:4-13,i:14-23,p:24-24,d:25-25")?

Thanks for your help

Scrip answered 8/11, 2015 at 12:53 Comment(0)
C
39

According to AltBeacon docs:

m - matching byte sequence for this beacon type to parse (exactly one required)

s - ServiceUuid for this beacon type to parse (optional, only for Gatt-based beacons)

i - identifier (at least one required, multiple allowed)

p - power calibration field (exactly one required)

d - data field (optional, multiple allowed)

x - extra layout. Signifies that the layout is secondary to a primary layout with the same matching byte sequence (or ServiceUuid). Extra layouts do not require power or identifier fields and create Beacon objects without identifiers.

Example of a parser string for AltBeacon:

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

This signifies that the beacon type will be decoded when an advertisement is found with 0xbeac in bytes 2-3, and a three-part identifier will be pulled out of bytes 4-19, bytes 20-21 and bytes 22-23, respectively. A signed power calibration value will be pulled out of byte 24, and a data field will be pulled out of byte 25.

here is a list of some 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
Coleman answered 8/3, 2016 at 14:1 Comment(1)
can you please tell me how can i make custom beacon layout for 0x229abaf03ed601010201000000000000 as its a eddystone beacon. i just want to search for this beacon using altbeacon library/Jezreel

© 2022 - 2024 — McMap. All rights reserved.