iPhone 6 支持 BLE 4.2,但没有示例

Posted

技术标签:

【中文标题】iPhone 6 支持 BLE 4.2,但没有示例【英文标题】:iPhone 6 support BLE 4.2, but no example 【发布时间】:2015-11-12 19:05:44 【问题描述】:

发现 iPhone 6 支持 BLE 4.2

与BLE 4.0相比,v4.2在安全性上有很大的提升,比如支持ECDH。

我想做一些基于 ECC 的测试。有什么例子吗?我在 ios 9.1 API 中找不到任何 API 更改

【问题讨论】:

【参考方案1】:

在 iOS 上还是相当简单的。您只需要标记您的特征并设置权限,如下所示。其余的都处理好了。

emailCharacteristic = [[CBMutableCharacteristic alloc]
    initWithType:emailCharacteristicUUID
    properties:CBCharacteristicPropertyRead
    | CBCharacteristicPropertyNotifyEncryptionRequired
    value:nil permissions:CBAttributePermissionsReadEncryptionRequired];

实际上,它是 iOS 6.0 自带的(刚刚发现)!它可能不会原生内置于 ble 4.0 芯片中,但它是构建在基本 ble 规范之上的,并且 iOS 会在软件方面处理它。

iOS 设备上应该会出现一个弹出窗口,要求您允许配对(受信任的频道)。现在,当您直接处理微控制器和 ble 芯片时,我不知道它是如何工作的。我的猜测:在 iOS 设备上接受配对就是您所需要的。

参考: https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/BestPracticesForSettingUpYourIOSDeviceAsAPeripheral/BestPracticesForSettingUpYourIOSDeviceAsAPeripheral.html#//apple_ref/doc/uid/TP40013257-CH5-SW9

CBCharacteristicProperties: https://developer.apple.com/library/prerelease/ios/documentation/CoreBluetooth/Reference/CBCharacteristic_Class/index.html#//apple_ref/c/tdef/CBCharacteristicProperties

【讨论】:

以上是关于iPhone 6 支持 BLE 4.2,但没有示例的主要内容,如果未能解决你的问题,请参考以下文章

是否可以使用支持 BLE 的 Android/iPhone 作为 BLE 信标?

ANCS 是不是支持向多个 BLE 设备发送通知?

BLE 5 外围设备未在支持 BLE 5 的 Android 手机和 iPhone 上得到扫描

视频冻结在iphone 6 swift 4.2中

支持 iPhone 3G

CRC蓝牙低功耗4.2