【问题标题】:Connect iphone with 2 Low Energy devices将 iphone 与 2 个低功耗设备连接
【发布时间】:2013-10-05 19:59:43
【问题描述】:

好吧,这是我的问题。我知道,可以将 iphone 连接到低功耗蓝牙设备(例如 Polar Heart Rate Belt),然后在我的应用程序中处理此非 iOS 设备提供的数据。但是可以同时将我的 iphone 与 2 条皮带连接吗?所以我可以使用每一个提供的数据。

【问题讨论】:

    标签: iphone ios bluetooth-lowenergy


    【解决方案1】:

    发现并连接到所有 HR 传送带设备。你也可以在 iOS7 中使用retrieveConnectedPeripherals。然后注册每个外围设备上的心率值特征通知:

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

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

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

    【讨论】:

    • 好吧,你可以从两个设备中检索数据。我稍后会尝试你的代码,ty =)
    猜你喜欢
    • 1970-01-01
    • 2013-11-17
    • 2012-05-12
    • 1970-01-01
    • 1970-01-01
    • 2014-05-05
    • 2014-02-09
    • 2014-09-29
    • 1970-01-01
    相关资源
    最近更新 更多