I am trying to collect temperature and humidity from beacons, that sends this raw data:
020106 020AFC 0A16 ABFE 70BF01 00DB00DB
where:
0x02 – length (2 bytes)
0x01 – type (flags)
0x06 – value (BIN=00000110)
0x02 -length (2 bytes)
0x0A type («Tx Power Level»)
0xFC – value (DEC =-4)
0x0A – length (10 bytes)
0x16 - type («Service Data - 16-bit UUID»
0xABFE - UUID = FEAB
0x70 – frame type (temperature and humidity)
0xBF – TX@1m
0x01 – TX power
0x00DB – temperature (DEC=219 = 21.9 C)
0x00DB – humidity (DEC – 219= 21.9C)
I am trying to build an instance, but it looks like that it is not correct, WAIDW?
m:9-10=feab, i:11-14, p:6-6, d:14-17
Thank you for your help
Try this:
"s:0-1=feab,m:2-2=70,i:3-8,p:3-3,d:5-6,d:7-8"
That expression will:
beacon.getId1()
(this is not very useful, but you are required to have at least one identifier field for your beacon parser)beacon.beacon.getDataFields().get(0)
beacon.beacon.getDataFields().get(1)