objective-c - iOS蓝牙连接外设,调用断开方法后无法立即断开,求解决方案。
PHP中文网
PHP中文网 2017-04-18 09:25:47
0
4
398

本人的蓝牙4.0相关项目现在需要实现iphone连接蓝牙外设发送数据后马上断开与外设的连接

但调用core bluetooth的[manager cancelPeripheralConnection:Peripheral]后蓝牙并不能马上断开连接,

总要等待数秒后外设才能继续广播,

开始以为是发数据占用时间,但是不发送任何数据只是连接后马上断开还是有同样的问题

用电脑和安卓手机测试都可以马上断开 应该也不是蓝牙外设固件的问题

感觉就是断开命令没有被立即发送 但是[manager cancelPeripheralConnection:Peripheral]确实执行了

求大神帮忙

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(4)
小葫芦

I also have the same problem, please continue to pay attention! !

小葫芦

Why no one has the answer? I am also looking for this answer

巴扎黑

[manager cancelPeripheralConnection:Peripheral] method can ensure that the APP layer is disconnected immediately and can go to the disconnect callback, but the physical layer can wait about 5 seconds before the physical layer can be disconnected.

巴扎黑

manager=nil; OK?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!