Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AltBeacon setBeaconLayout()

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

like image 350
user3494145 Avatar asked Nov 08 '15 12:11

user3494145


1 Answers

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
like image 90
Aray Karjauv Avatar answered Oct 06 '22 00:10

Aray Karjauv