[英]How should I connect multiple BLE peripherals to an iOS device?
Currently my team is calling 目前我的团队正在打电话
[myCentralManager scanForPeripheralsWithServices:nil options:nil];
and then starting an NSTimer
that fires in two seconds. 然后启动一个在两秒内触发的
NSTimer
。 During these two seconds, the Central Manager delegate method 在这两秒钟内,Central Manager委托方法
centralManager:didDiscoverPeripheral:advertisementData:RSSI:
is used to create an array of CBPeripherals
that we are interested in. 用于创建我们感兴趣的
CBPeripherals
数组。
When the timer fires, we call connectPeripheral
on every item in the array within a for loop. 当计时器触发时,我们在for循环中对数组中的每个项目调用
connectPeripheral
。
I am worried that this is not the best way to connect to several devices at once. 我担心这不是一次连接多个设备的最佳方式。 Should we wait for one device's connection process to complete before calling
connectPeripheral
on another device? 我们是否应该在另一台设备上调用
connectPeripheral
之前等待一个设备的连接过程完成?
Thanks for any suggestions. 谢谢你的任何建议。
Have you experienced issues? 你遇到过问题吗? If not, then do it the way you do.
如果没有,那就按照你的方式去做。
Some additional thoughts: 一些额外的想法:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.