Ibeacon的数据包格式

来源:互联网 发布:通州and淘宝城 编辑:程序博客网 时间:2024/04/28 03:24

Ibeacon 是apple开发的基于BLE(Bluetooth low energy)的精确定位技术。常常用来做室内定位。

  这里简单讲解下ibeacon的数据包格式

  这里以UUID为B9407F30-F5F8-466E-AFF9-25556B57FE6D,Major为01,minor为01(此uuid为Estimote B9407F30)为例:

 

d6 be 89 8e # Access address for advertising data 这个通常是固定的40 # 包头的第一个字节.  Contains: (type = 0), (tx add = 1), (rx add = 0)24 # 包头的第二个字节第,表示长度,这里的长度是Mac地址(6Byte) + 数据包过的长度(这里是30)05 a2 17 6e 3d 71 # 蓝牙的Mac地址,注意这里不是真正的mac地址02 01 1a 1a ff 4c 00 02 15 b9 40 7f 30 f5 f8 46  6e af f9 25 55 6b 57 fe 6d 00 01 00 01 c5<span style="font-family: Arial, Helvetica, sans-serif;"> #蓝牙数据包</span>52 ab 8d 38 a5 # 校验和checksum

这里核心的部分是蓝牙的数据包部分

02 # 第一个AD structure 的字节数(接下来的字节数,这里是2个byte)01 # AD type 的标志1A # 标志的值 0x1A = 000011010     bit 0 (OFF) LE Limited Discoverable Mode   bit 1 (ON) LE General Discoverable Mode   bit 2 (OFF) BR/EDR Not Supported   bit 3 (ON) Simultaneous LE and BR/EDR to Same Device Capable (controller)   bit 4 (ON) Simultaneous LE and BR/EDR to Same Device Capable (Host)1A # 第二个AD structure的字节数 (接下来的字节数,这里是26个)FF # AD type 的标志,这里Manufacturer specific data.更多的标志可以到BLE的官网找到:例如0x16 表示servicedata4C 00 # 公司的标志 (0x004C == Apple)02 # Byte 0 of iBeacon advertisement indicator15 # Byte 1 of iBeacon advertisement indicatorB9 40 7F 30 F5 F8 46 6E AF F9 25 55 6B 57 FE 6D # iBeacon proximity uuid00 01# major 00 01 # minor c5 # calibrated Tx Power


由于Ibeacon是建立在BLE上的数据包。所以,可以发发出BLE的设备均可以发送ibeacon。

Apple官方有AirLocate 开放源码的软件可以供开发参考。



1 0