简体   繁体   English

RFComm连接块WiFi

[英]RFComm connection blocks WiFi

I have this code: 我有以下代码:

theSocket = theDevice.createInsecureRfcommSocketToServiceRecord(SPP_UUID);
theSocket.connect();

which works fine, except for one thing (at least on the LG L40 Android 4.4.2, had similar problems, though not as clear, on the LG E430), as soon as the theSocket.connect() call finished, the complete WiFi is gone (I run a ping on the ADB shell and it stops as soon as that call is done). 该功能正常运行,但只有一件事(至少在LG L40 Android 4.4.2上,在LG E430上有类似的问题,尽管不太清楚),只要theSocket.connect()调用完成,就可以完成整个WiFi不见了(我在ADB shell上运行ping,并且在调用完成后立即停止)。

Updates 更新

  • Changing the RFComm socket to a normal, paired one, makes no difference. 将RFComm插座更改为普通的配对插座没有区别。
  • Changing to HID mode will block the WiFi as soon as data arrives. 数据到达后,更改为HID模式将阻止WiFi。
  • Starting in "safe mode" has no effect, problem is still there. 以“安全模式”启动没有任何作用,问题仍然存在。

Is there anything I could change to make sure the Wifi-Bluetooth interference is minimised? 我有什么可以改变的,以确保将Wifi蓝牙干扰降到最低?

There were known bugs with Android 4.2.x that caused the Wi-Fi to drop out when attempting to use Bluetooth simultaneously, especially with the Nexus 4. This post discusses the issue: Android 4.2.x一些已知错误导致尝试同时使用蓝牙时,尤其是Nexus 4,导致Wi-Fi中断。这篇文章讨论了这个问题:

https://code.google.com/p/android/issues/detail?id=41631 https://code.google.com/p/android/issues/detail?id=41631

Whether the issues discussed above are occurring for similar reasons or are more related to hardware issues with the Nexus 4 remains unclear. 上面讨论的问题是由于类似的原因发生还是与Nexus 4的硬件问题更多相关,目前尚不清楚。 I do know that Android introduced a new Bluetooth stack in the 4.2 release, so this could be a potential source of problems. 我确实知道Android在4.2版本中引入了新的蓝牙协议栈,因此这可能是潜在的问题根源。

Have you tried updating your device to Android 5.0 or higher in order to see if this fixes the issue? 您是否尝试过将设备更新为Android 5.0或更高版本,以查看是否可以解决此问题? That would be my recommendation. 那是我的建议。

UPDATE 更新

Reading further in the link provided above it seems as if this problem extended to multiple devices (Nexus 4, 5, 7, Galaxy S4, Galaxy Tab 5 just to name a few) and multiple Android releases (problems were still reported as late as 4.4.4). 在上面提供的链接中进一步阅读,似乎此问题扩展到了多种设备(Nexus 4、5、7,Galaxy S4,Galaxy Tab 5等)和多个Android版本(问题仍然报告到4.4年)。 .4)。 With this in mind I think the clearest path to fixing the issue, as mentioned above, is to try and upgrade to Lollipop 考虑到这一点,如上所述,我认为解决此问题的最明确途径是尝试升级到Lollipop

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

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