简体   繁体   English

iOS:失去蓝牙连接

[英]iOS : Losing Bluetooth Connection

I succesfully managed to connect an iPhone and a Mac using Bluetooth. 我成功地使用蓝牙连接了iPhone和Mac。

The iPhone is the central and the Mac is the peripheral. iPhone是核心,Mac是外围设备。 After the connection, both can communicate (the iPhone is subscribing to some characteristics, advertised by the Mac). 连接后,两者都可以通信(iPhone正在订阅一些特性,由Mac公布)。

But, after some (random ?) time, the iPhone's Bluetooth icon is grayed out and the iPhone doesn't receive Bluetooth messages from the Mac anymore. 但是,在一些(随机?)时间之后,iPhone的蓝牙图标显示为灰色,iPhone不再接收来自Mac的蓝牙消息。

Why? 为什么? How can I make the communication last ? 如何让沟通持续?

EDIT : here is the error : advertised by didDisconnectPeripheral : 编辑:这是错误: didDisconnectPeripheral

Domain=CBErrorDomain Code=6 "The connection has timed out unexpectedly. Domain = CBErrorDomain Code = 6“连接意外超时。

After several days of research, I find out what was the problem. 经过几天的研究,我发现问题是什么。

Might help you if you have the same problem : 如果您遇到同样的问题,可能会帮助您:

I had an interference problem between the Bluetooth and the Wifi on my mac. 我的Mac上的蓝牙和Wifi之间存在干扰问题。 So each time I was using the Wifi, the Bluetooth connection crashed. 所以每次我使用Wifi时,蓝牙连接都会崩溃。

Maybe one way to solve the problem is to change the frequency of the wifi provided. 也许解决问题的一种方法是改变所提供的wifi的频率。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM