如何通过CBCentralManager创建到BLE外围设备的安全连接? [英] How can I create a secured connection to BLE peripheral through CBCentralManager?

查看:110
本文介绍了如何通过CBCentralManager创建到BLE外围设备的安全连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iOS和Core Bluetooth的新手.我想知道的是如何建立与设备的安全连接.

I am new to iOS and Core Bluetooth. What I would like to know is how to create a secured connection to the device.

我了解的是:

[manager connectPeripheral:peripheral options:nil] 

是提供的用于连接BLE设备的API.由此,如何建立安全连接?

is the API provided to connect to the BLE device. From this, how do I establish a secured connection?

推荐答案

所有BT4.0连接均由设备/传感器和iOS保护和管理,您对此无能为力.

All BT4.0 connections are secured and managed by the device/sensor and iOS, you do not have control over this.

BT4.0设备还具有绑定和无限制的连接.

BT4.0 devices you also have bounded and unbounded connections.

绑定的连接与iOS设备配对".一旦绑定,它们将无法与任何其他设备通信.这样可以确保设备始终与受限制的iOS设备保持安全连接.边界由操作系统(iOS)控制.当需要限制连接的设备与iOS设备通信时,iOS设备将显示一个警报视图,询问您是否要连接到该设备.

Bounded connections are in a way "paired" to the iOS device. Once bounded they will not communicate to any other device. This ensures the device will always have a secured connection with the bounded iOS device. Bounding is controlled by the operating system (iOS). When a device that requires a bounded connection communicates with a iOS device, the iOS device will present a alert view asking if you wish to connect to the device.

无限制的设备会不断广播其服务,并允许任何iOS设备连接到它.操作系统不会记住设备信息,通常应用程序会存储UUID,以便下次可以建立与同一设备的连接.这是大多数BT4.0传感器的正常/推荐方法.

Unbounded devices are continually broadcast their services and allows any iOS device to connect to it. The operating system will not remember the device information, normally the application would store the UUID so it can establish the connection to the same device next time. This is the normal/recommended method for most BT4.0 sensors.

注意:尽管无界设备未与iOS设备配对",但它们只能在任何时间与一台iOS设备通信.

NOTE: Although unbounded devices are not "paired" with the iOS device, they will only communicate with a single iOS device at any one time.

这篇关于如何通过CBCentralManager创建到BLE外围设备的安全连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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