Android蓝牙java.io.IOException:连接被拒绝了?

jac*_*nad 3 java android bluetooth

我需要使用SPP 将KwikBlue-2模块开发套件连接到Nexus One上的Android BluetoothChat示例.在将BluetoothChat示例示例中的UUID更改为SPP设备的00001101-0000-1000-8000-00805F9B34FB 之后,我能够使用tera术语连接和交换串行数据(一次).然后我循环使用KwikBlue-2模块开发套件来验证连接是否可重复,但java.io.IOException: Connection refused在我尝试连接时不断获得 .有任何想法吗?

43.200: ERROR/BluetoothEventLoop.cpp(96): event_filter: Received signal org.bluez.Adapter:PropertyChanged from /org/bluez/219/hci0
52.200: ERROR/BluetoothChat(707): - ON PAUSE -
54.470: ERROR/BluetoothService.cpp(96): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
54.520: ERROR/BluetoothChat(707): + ON RESUME +
54.530: ERROR/BluetoothService.cpp(96): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
54.620: ERROR/BluetoothService.cpp(96): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
55.520: ERROR/BluetoothEventLoop.cpp(96): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/219/hci0/dev_00_60_57_FD_42_18
56.010: ERROR/BluetoothChatService(707): unable to connect
56.010: ERROR/BluetoothChatService(707): java.io.IOException: Connection refused
56.010: ERROR/BluetoothChatService(707):     at android.bluetooth.BluetoothSocket.connectNative(Native Method)
56.010: ERROR/BluetoothChatService(707):     at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:204)
56.010: ERROR/BluetoothChatService(707):     at com.cti.BluetoothChat.BluetoothChatService$ConnectThread.run(BluetoothChatService.java:329)
00.110: ERROR/BluetoothEventLoop.cpp(96): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/219/hci0/dev_00_60_57_FD_42_18
Run Code Online (Sandbox Code Playgroud)

小智 12

尝试取消配对/修复,然后它可以再次工作.这似乎是Android上核心蓝牙支持的一个错误.

  • 这不是一个好的答案,因为它没有给出问题的永久解决方案.我现在有同样的问题,并且不能告诉我的用户每天两次或多次取消配对/配对应用程序. (3认同)
  • @GlennBech然而,在其他人找到更好的解决方案之前,这是唯一的答案. (2认同)