[英]BeaconParser instance issue Android beacon library
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?我正在尝试构建一个实例,但看起来它不正确,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.getId1()
访问的第一个标识符字段(这不是很有用,但您的信标解析器需要至少有一个标识符字段)beacon.beacon.getDataFields().get(0)
beacon.beacon.getDataFields().get(0)
可访问的第一个数据字段中beacon.beacon.getDataFields().get(1)
beacon.beacon.getDataFields().get(1)
访问的第二个数据字段中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.