![](/img/trans.png)
[英]How can an iOS BLE central receive more than 182 bytes from a peripheral in notify mode?
[英]How to connect more than one peripheral BLE sensors - iOS?
我正在使用 BLE 传感器进行步行分析应用程序。 在此,我一直在研究单个传感器连接并分析该数据。 现在我需要连接多个(最多 4 个)传感器。 连接和管理外围设备以及收集数据传感器数据的最佳方式是什么?
您可以简单地将传感器或 CBPeripheral 保存在列表中,即[CBPeripheral] 。 您可以根据标识符跟踪读取、写入和通知操作。 例如,如果您执行读取操作,在委托方法中您可以执行以下操作:
func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) {
if peripheral.identifier == YourPeripheral.identifier {
// Here you are uniquely identifying a peripheral
}
}
希望这会有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.