什么是iBeacon显示蓝牙模式 [英] What is the iBeacon Bluetooth Profile

查看:843
本文介绍了什么是iBeacon显示蓝牙模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建自己的iBeacon显示一些蓝牙低功耗开发套件。苹果公司还没有发布针对iBeacons的规范,但一些硬件开发人员逆向工程从AirLocate样品code中的iBeacon显示并开始销售iBeacon显示开发套件。

I'd like to create my own iBeacon with some bluetooth low energy dev kits. Apple has yet to release a specification for iBeacons, however a few hardware developers have reverse Engineered the iBeacon from the AirLocate Sample code and started selling iBeacon dev kits.

那么,什么是iBeacon显示蓝牙模式?

低功耗蓝牙采用GATT为LE配置文件服务的发现。因此,我认为,我们需要知道属性手柄,属性类型,属性值,也许iBeacon显示属性的属性权限。因此,对于一个UUID E2C56DB5-DFFB-48D2-B060-D0F5A71096E0的1主要价值和1小值的iBeacon显示将蓝牙GATT配置文件服务是什么?

Bluetooth Low Energy uses GATT for LE profile service discovery. So I think we need to know the Attribute Handle, Attribute Type, Attribute Value, and maybe the Attribute Permissions of the iBeacon attribute. So for an iBeacon with a UUID of E2C56DB5-DFFB-48D2-B060-D0F5A71096E0 a major value of 1 and a minor value of 1 what would the Bluetooth GATT profile service be?

下面有一些假设我已经从讨论苹果的论坛,并通过文档。

Heres some assumptions I've made from the discussion on Apple's forums and through the docs.


  1. 您只需要看到蓝牙外设的配置文件服务(GATT)就知道它是一个iBeacon显示。

  1. You only need to see the profile service (GATT) of a Bluetooth peripheral to know it is an iBeacon.

主要和次要的按键都设有codeD某处在此配置文件服务

The Major and Minor keys are encoded somewhere in this profile service

下面有一些企业与iBeacon显示开发套件,似乎有这个数字已经出来:

Heres some companies with iBeacon Dev Kits that seem to have this figure out already:

  • http://redbearlab.com/ibeacon/
  • http://kontakt.io/

但愿时候我们就要贴在Bluetooth.org这样的一个配置文件:<一href=\"https://www.bluetooth.org/en-us/specification/adopted-specifications\">https://www.bluetooth.org/en-us/specification/adopted-specifications

Hopefully in time we will have a profile posted on Bluetooth.org like these: https://www.bluetooth.org/en-us/specification/adopted-specifications

推荐答案

对于ProximityUUID的iBeacon显示 E2C56DB5-DFFB-48D2-B060-D0F5A71096E0 ,各大 0 ,次要 0 ,和校准 -59 RSSI的传输BLE通告报文看起来是这样的:

For an iBeacon with ProximityUUID E2C56DB5-DFFB-48D2-B060-D0F5A71096E0, major 0, minor 0, and calibrated Tx Power of -59 RSSI, the transmitted BLE advertisement packet looks like this:

D6 89 8E 40 24 05 A2 17 6​​E 3D 71 02 01 1A 1A FF 4C 00 02 15 E2 C5 6D B5 DF FB 48 D2 B0 60 D0 F5 A7 10 96 E0 00 00 00 00 C5 52 AB 8D 38 A5

此包可细分如下:

d6 be 89 8e # Access address for advertising data (this is always the same fixed value)
40 # Advertising Channel PDU Header byte 0.  Contains: (type = 0), (tx add = 1), (rx add = 0)
24 # Advertising Channel PDU Header byte 1.  Contains:  (length = total bytes of the advertising payload + 6 bytes for the BLE mac address.)
05 a2 17 6e 3d 71 # Bluetooth Mac address (note this is a spoofed address)
02 01 1a 1a ff 4c 00 02 15 e2 c5 6d b5 df fb 48 d2 b0 60 d0 f5 a7 10 96 e0 00 00 00 00 c5 # Bluetooth advertisement
52 ab 8d 38 a5 # checksum

这包的关键部分是蓝牙广告,它可以被分解如下:

The key part of that packet is the Bluetooth Advertisement, which can be broken down like this:

02 # Number of bytes that follow in first AD structure
01 # Flags AD type
1A # Flags value 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 # Number of bytes that follow in second (and last) AD structure
FF # Manufacturer specific data AD type
4C 00 # Company identifier code (0x004C == Apple)
02 # Byte 0 of iBeacon advertisement indicator
15 # Byte 1 of iBeacon advertisement indicator
e2 c5 6d b5 df fb 48 d2 b0 60 d0 f5 a7 10 96 e0 # iBeacon proximity uuid
00 00 # major 
00 00 # minor 
c5 # The 2's complement of the calibrated Tx Power

这可被配置为发送一个特定的广告可产生上述信息包的任何Bluetooth LE设备。我一直在使用配合bluez发送这则广告配置一台Linux计算机,并运行苹果的AirLocate测试code iOS7设备把它捡起来,与上述指定的字段的iBeacon显示。参见:<一href=\"http://stackoverflow.com/questions/16151360/use-bluez-stack-as-a-peripheral-advertiser/19039963#19039963\">Use堆栈的BlueZ作为外设(广告客户)

Any Bluetooth LE device that can be configured to send a specific advertisement can generate the above packet. I have configured a Linux computer using Bluez to send this advertisement, and iOS7 devices running Apple's AirLocate test code pick it up as an iBeacon with the fields specified above. See: Use BlueZ Stack As A Peripheral (Advertiser)

这<一个href=\"http://web.archive.org/web/20131017042628/http://developer.radiusnetworks.com/2013/10/01/reverse-engineering-the-ibeacon-profile.html\">blog大约有逆向工程过程的全部细节。

This blog has full details about the reverse engineering process.

这篇关于什么是iBeacon显示蓝牙模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆