获取蓝牙低功耗外设的MAC地址 [英] Get MAC address of bluetooth low energy peripheral

查看:709
本文介绍了获取蓝牙低功耗外设的MAC地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前工作的iOS应用程序基于蓝牙低功耗设备。为了得到一个唯一的标识符来比较外设了,我得外设的MAC地址。

I am currently working on an iOS application based on bluetooth low energy devices. In order to get a unique identifier to compare the peripherals got, I have to get the MAC address of the peripherals.

可以观察到,一个外围设备的UUID属性跨iOS设备并且还对所述外围设备以获得一个UUID而变化,但将要获得至少一次连接到主设备。因为我必须处理入住的,我不希望建立一个连接。当我通过蓝牙服务门户网站去了,我发现该设备的信息本身是一种服务,除非连接已经在主iOS设备和外围蓝牙低功耗设备之间建立了无法检索。

It is observed that the UUID property of a peripheral device varies across iOS devices and also for the peripheral device to get a UUID, it will have to get connected to a master device at least once. Since I have to deal with check-in's I don't want to establish a connection. As I went through the bluetooth services portal, I found that the device information itself is a service, which couldn't be retrieved unless a connection has been established between the master iOS device and the peripheral bluetooth low energy device.

我发现在Android中我们得到了设备的整个信息,包括它的MAC地址(使用的getAddress()),当我们从设备上扫描本身的响应。

I found that in Android we get the entire information of the device, including its MAC address (using getAddress()) when we get the response from the device on scanning itself.

我没有找到相关的设备地址CBPeripheral类中的任何属性。
以获得一个唯一的参数的另一个方法是将定制的广告数据来发送关于该设备,这需要对固件侧更多的工作的其他信息。

I didn't find any properties in CBPeripheral class related to the device address. Another way to get a unique parameter would be to customize the advertisement data to send additional information regarding the device, which requires more work on firmware side.

那么,有没有在iOS的任何方式,我可以得到的蓝牙低功耗外设的MAC地址没有建立连接?

So is there any way in iOS that I could get the MAC address of the bluetooth low energy peripheral without establishing a connection?

任何帮助将大大AP preciated。

Any help would be greatly appreciated.

推荐答案

有没有公共API来获取这些信息。

There is no public API to get this information.

如果这是一个内部或越狱应用程序,您可以通过 liblockdown.dylib

If this is an internal or jailbreak application you can get the value of the kLockdownBluetoothAddressKey key via liblockdown.dylib

这篇关于获取蓝牙低功耗外设的MAC地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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