iphone - 将 iPhone 与 2 个低能耗设备连接

标签 iphone ios bluetooth-lowenergy

嗯,这是我的问题。我知道,可以将 iPhone 连接到低功耗蓝牙设备(例如 Polar 心率带),然后在我的应用程序中处理该非 iOS 设备提供的数据。但是我的 iPhone 可以同时连接 2 条皮带吗?这样我就可以使用每一个提供的数据。

最佳答案

发现并连接到所有心率带设备。您还可以在 iOS7 中使用 retrieveConnectedPeripherals。然后在各个外设上注册接收心率值特征的通知:

[currentPeripheral setNotifyValue:notify 
    forCharacteristic:self.heartRateCaracterisctic]; 

didUpdateNotification 触发时,您的委托(delegate)将收到一个 CBPeripheral 实例 - 使用它来确定哪一个外围设备发送了新值:

(void)peripheral:(CBPeripheral *)peripheral 
    didUpdateNotificationStateForCharacteristic:(CBCharacteristic *)characteristic 
    error:(NSError *)error 

关于iphone - 将 iPhone 与 2 个低能耗设备连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19202107/

相关文章:

iphone - namespace 与 XML 有什么关系?

iphone - 我无法在一段时间内获取 gps 坐标

iphone - 当我的应用程序进入后台模式时,如何更新位置管理器和计时器?

objective-c - 如何使用 "Splash"UIViewController 有条件地重定向到另一个 View Controller ?

ios - 从类 'NSObject' 和 'AWSDynamoDBObjectModel' 多重继承

ios - 我正在尝试将背景图像设置为 UISearchBar 但背景图像未在我的 iPhone 应用程序中显示

安卓低功耗蓝牙 : Not hearing advertisements on some devices

bluetooth-lowenergy - BLUEZ 中的 DBUS API

bluetooth-lowenergy - 估计到 ibeacon AVR 的距离

ios - 无法远程调试简单的 React-Native 项目