简体   繁体   English

为什么一段时间后Android Wear蓝牙会断开连接-btm_sec_disconnected?

[英]Why does Android Wear bluetooth disconnect after some time - btm_sec_disconnected?

I am developing an android app for android wear Android Wear 4.4W. 我正在为Android Wear Android Wear 4.4W开发一个Android应用程序。 I'm debugging the app directly via usb in the smartwatch (that's how I want it - no companion app on the phone). 我正在通过智能手表中的USB直接调试应用程序(这就是我想要的方式-手机上没有配套的应用程序)。 The app receives bluetooth messages every 10ms. 该应用程序每10毫秒接收一次蓝牙消息。 After 10-20s, this error is thrown - 10到20秒后,会引发此错误-

01-01 21:10:22.683 E/bt-btm  (  826): btm_sec_disconnected - Clearing Pending flag
01-01 21:10:22.686 W/bt-btif (  826): invalid rfc slot id: 4

I'm basically using this code- How to receive serial data using android bluetooth 我基本上是在使用此代码- 如何使用android蓝牙接收串行数据

I tried sending "keep alive" messages as mentioned here- Application using bluetooth SPP profile not working after update from Android 4.2 to Android 4.3 , but this does not work either. 我尝试发送“保持活动”消息,如此处所述- 从蓝牙4.2更新到Android 4.3后使用蓝牙SPP配置文件的应用程序无法正常工作 ,但这也不起作用。

Are there any mistakes that I'm making or any workarounds to this problem? 我是否有任何错误或解决此问题的方法?

Ok, found the answer. 好的,找到答案了。 The external bluetooth module kept resetting itself because of some circuit issues. 由于某些电路问题,外部蓝牙模块一直保持复位状态。 The reset caused the connection to be lost momentarily. 重置导致连接暂时丢失。

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

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