我需要连接一个 KwikBlue-2 Module Development Kit到 Android BluetoothChat example在使用 SPP 的 Nexus One 上。
在更改 BluetoothChat example 中的 UUID 后,我能够使用 tera term 连接和交换串行数据(一次)对于 SPP 设备,示例为 00001101-0000-1000-8000-00805F9B34FB。
然后我重新启动了 KwikBlue-2 Module Development Kit验证连接是否可重复但不断得到
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
最佳答案
尝试取消配对/修复,然后它可能会再次工作。这似乎是 Android 上核心蓝牙支持的错误。
关于java - Android 蓝牙 java.io.IOException : Connection refused?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5298572/