Android 蓝牙套接字错误
我在 android 1.6 上使用向后移植蓝牙 api。我正在使用 Google 蓝牙聊天示例应用程序进行测试。该应用程序在正常情况下运行良好。
在某种情况下,当我尝试连接到处于关闭状态的配对设备时,我收到以下错误:
01-04 09:00:11.629: ERROR/BluetoothEventLoop.cpp(84): onGetRemoteServiceChannelResult: D-Bus error: org.bluez.Error.ConnectionAttemptFailed (Host is down)
01-04 09:00:11.729: DEBUG/dalvikvm(128): GC freed 4535 objects / 256008 bytes in 296ms
01-04 09:00:21.880: ERROR/bluetooth_RfcommSocket.cpp(1433): connect error: Host is down (112)
但它将状态设置为已连接。应用程序无法捕获异常。
为什么会发生这种情况?还是 backport api 就是这种情况?
感谢任何帮助,因为我正在努力让事情顺利进行。
I am using backport bluetooth api on android 1.6. I am using Google Bluetooth Chat sample app for testing. The app works fine in normal scenarios.
In a scenario, when I try to connect to paired device which is in off state, I get following error:
01-04 09:00:11.629: ERROR/BluetoothEventLoop.cpp(84): onGetRemoteServiceChannelResult: D-Bus error: org.bluez.Error.ConnectionAttemptFailed (Host is down)
01-04 09:00:11.729: DEBUG/dalvikvm(128): GC freed 4535 objects / 256008 bytes in 296ms
01-04 09:00:21.880: ERROR/bluetooth_RfcommSocket.cpp(1433): connect error: Host is down (112)
But it sets the state as connected. The app is unable to catch the exception.
Why does it happen? Or is it the case with backport api?
Any help is appreciated as I am struggling a lot to get things run fine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚发现这是 api 的一个缺陷。
请检查:http://code.google.com /p/backport-android-bluetooth/issues/detail?id=15
I just found out that this is a defect in api.
Please check this: http://code.google.com/p/backport-android-bluetooth/issues/detail?id=15