如何解码BLE广告数据 [英] How to decode the BLE advertisement data

查看:401
本文介绍了如何解码BLE广告数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

扫描完BLE设备后,我调用以下方法:

After scanning for the BLE device, I call the below method:

- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI 

并收到以下广告数据:

{ kCBAdvDataManufacturerData = <ffff0215 cf6d4a0f .....  adf2f491 ... ... > }

如何解码数据并访问其信息?

How can I decode the data and access its information?

推荐答案

看来你希望这个广告包可以像iBeacon一样解码,但事实并非如此。评论中列出的完整字节为:

It seems that you are expecting this advertising packet to be decodable as iBeacon, but it is not. The full bytes listed in comments are:

ff ff 02 15 e8 4a 40 af 7b 8d e8 8d 4a 7b 40 af af e8 4a 40 40 af 7b 8d c3

02 15是Apple的公司代码,但接下来的两个字节e8 4a与您将为iBeacon看到的模式不一致。因此,没有理由认为信标标识符在该分组中被编码。

The 02 15 is the company code of Apple, but the next two bytes e8 4a are not consistent with the pattern you will see for iBeacon. There is no reason to think, therefore, that beacon identifiers are encoded in this packet.

数据是什么意思?如果没有更多关于什么软件或硬件正在传输此数据包以及它的预期目的的信息,就不可能说。我们只能说它是一个制造商广告(类型为ff),并将自己报告为Apple设备。

What do the data mean? It's impossible to say without more information about what software or hardware is transmitting this packet and what its intended purpose is. All we can tell is that it is a manufacturer advertisement (type ff) and is reporting itself as an Apple device.

如果你想弄清楚数据包的含义,您需要确定哪个应用程序或硬件制造商正在发出它并从该实体中寻找文档。

If you want to figure out the meaning of the packet, you need to determine what app or hardware manufacturer is emitting it and seek documentation from that entity.

这篇关于如何解码BLE广告数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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