ios - 如何读取外围设备的蓝牙 LE 地址?

标签 ios iphone bluetooth-lowenergy core-bluetooth

当 iPad 上的 central 扫描并检测到外围设备时,它如何读取外围设备的蓝牙 LE 地址?

CBPeripheral 类没有“地址”属性。

最佳答案

出于隐私原因,蓝牙地址被隐藏为“UUID”(或 NSUUID)

https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBPeripheral_Class/translated_content/CBPeripheral.html#//apple_ref/occ/instp/CBPeripheral/identifier

如果您确实需要知道外围设备的固定蓝牙地址,则将其编入其特性之一或作为您独特的制造商数据字段的一部分编入广告包。

这当然需要您向 BT SIG 询问制造商 ID(并且您是外围设备的“制造商”)并且外围设备使用静态蓝牙地址。

关于ios - 如何读取外围设备的蓝牙 LE 地址?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24021654/

相关文章:

ios - 如何将代码回调同步到音轨的播放时间?

c# - Unity GameAnalytics 插件在 iOS 构建上失败

ios - 当我从纵向模式更改为横向模式时,按钮背景图像消失

iphone - 在汽车中使用 iPhone 加速计

Android BluetoothGatt 未收到特征通知 BluetoothGatt#writeDescriptor(desc) 返回 false

android - txPower for Bluetooth LE 到底是什么,它是如何使用的?

android - 如何支持所有手机浏览器查看PDF?

iphone - 传递参数使指针来自整数而不进行强制转换

java - 在源方法内部调试时无法检查 catch 子句中的变量

iphone - UITextView自动补全气泡位置