This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Bluetooth Insecure client/server connection refused problems

Hi all,

My two devices can't connect each other when using insecure client/server in CTS verifier. But they can connect each other using secure client/server. I'm so confuse the problem only happen in insecure connection situation.

In that time, I got logcat and list below.

Have any ideas about the problem or give me some directions?

Thank you!

I/CtsBluetoothChatService( 1609): BEGIN mConnectThread SocketType:Insecure
E/BluetoothService.cpp(  230): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
E/BluetoothService(  230): stopDiscoveryNative returned false
D/        (  122): GPS console: GLON= 0,GALI=0,BEDO=1
D/BtDebug ( 1578): external/bluetooth/bluez/src/adapter.c:create_device() B0:D0:9C:58:0B:28
D/BtDebug ( 1578): external/bluetooth/bluez/src/adapter.c:adapter_create_device() B0:D0:9C:58:0B:28
D/BtDebug ( 1578): external/bluetooth/bluez/src/device.c:device_create() Creating device /org/bluez/1578/hci0/dev_B0_D0_9C_58_0B_28
D/BtDebug ( 1578): external/bluetooth/bluez/src/device.c:btd_device_ref() 0x1ff4d90: ref=1
D/BtDebug ( 1578): external/bluetooth/bluez/src/device.c:device_set_temporary() temporary 1
D/BtDebug ( 1578): external/bluetooth/bluez/src/device.c:btd_device_ref() 0x1ff4d90: ref=2
D/BluetoothEventLoop(  230): Device property changed: B0:D0:9C:58:0B:28 property: Vendor value: 10
D/BluetoothEventLoop(  230): Device property changed: B0:D0:9C:58:0B:28 property: Temporary value: true
D/BluetoothEventLoop(  230): Property Changed: Devices : 1
D/BtDebug ( 1578): external/bluetooth/bluez/ggsp/server.c:handle_property_change() path /org/bluez/1578/hci0/dev_B0_D0_9C_58_0B_28
D/BtDebug ( 1578): external/bluetooth/bluez/ggsp/server.c:handle_property_change() property Vendor
D/BtDebug ( 1578): external/bluetooth/bluez/ggsp/server.c:handle_property_change() path /org/bluez/1578/hci0/dev_B0_D0_9C_58_0B_28
D/BtDebug ( 1578): external/bluetooth/bluez/ggsp/server.c:handle_property_change() property Temporary
I/ActivityManager(  230): Displayed com.android.cts.verifier/.bluetooth.InsecureClientActivity: +23s304ms
D/OpenGLRenderer( 1609): Flushing caches (mode 0)
E/BluetoothService.cpp(  230): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
E/BluetoothService(  230): stopDiscoveryNative returned false
D/BtDebug ( 1578): external/bluetooth/bluez/plugins/mgmtops.c:mgmt_event() cond 1
D/BtDebug ( 1578): external/bluetooth/bluez/plugins/mgmtops.c:mgmt_event() Received 38 bytes from management socket
D/BtDebug ( 1578): external/bluetooth/bluez/plugins/mgmtops.c:mgmt_event() Opcode 0x000b, len 32, index 0
D/BtDebug ( 1578): external/bluetooth/bluez/plugins/mgmtops.c:mgmt_device_connected() hci0 device B0:D0:9C:58:0B:28 connected eir_len 19
D/BtDebug ( 1578): external/bluetooth/bluez/src/adapter.c:adapter_get_device() B0:D0:9C:58:0B:28
D/BluetoothEventLoop(  230): Device property changed: B0:D0:9C:58:0B:28 property: Connected value: true
D/BluetoothGattClientService(  230): BluetoothGattClientService::onReceive: BluetoothDevice.ACTION_ACL_CONNECTED:B0:D0:9C:58:0B:28
D/BluetoothGattClientService(  230): BluetoothGattClientService:onConnected device=B0:D0:9C:58:0B:28
D/BluetoothGattClientService(  230): Device B0:D0:9C:58:0B:28 is not connected to GATT and not bonded - ignoring.
D/BluetoothEventLoop(  230): Address:B0:D0:9C:58:0B:28 RSSI:1084489677 name:Galaxy Nexus LE:false Class:0Address Type:0
D/BtDebug ( 1578): external/bluetooth/bluez/ggsp/server.c:handle_property_change() path /org/bluez/1578/hci0/dev_B0_D0_9C_58_0B_28
D/BtDebug ( 1578): external/bluetooth/bluez/ggsp/server.c:handle_property_change() property Connected
D/BtDebug ( 1578): external/bluetooth/bluez/ggsp/server.c:handle_property_change() Connected 1
V/BluetoothEventManager( 1324): Received android.bluetooth.device.action.FOUND
D/        (  122): GPS console: sat_mode =0
D/        (  122): GPS console: GLON= 0,GALI=0,BEDO=1
D/BtDebug ( 1578): external/bluetooth/bluez/src/device.c:device_probe_drivers() Probing drivers for B0:D0:9C:58:0B:28
D/BtDebug ( 1578): external/bluetooth/bluez/network/manager.c:network_probe() path /org/bluez/1578/hci0/dev_B0_D0_9C_58_0B_28
D/BtDebug ( 1578): external/bluetooth/bluez/src/device.c:btd_device_ref() 0x1ff4d90: ref=3
D/BtDebug ( 1578): external/bluetooth/bluez/network/connection.c:create_peer() Registered interface org.bluez.Network on path /org/bluez/1578/hci0/dev_B0_D0_9C_58_0B_28
D/BtDebug ( 1578): external/bluetooth/bluez/input/manager.c:headset_probe() path /org/bluez/1578/hci0/dev_B0_D0_9C_58_0B_28
D/BtDebug ( 1578): external/bluetooth/bluez/src/adapter.c:adapter_get_device() B0:D0:9C:58:0B:28
D/BtDebug ( 1578): external/bluetooth/bluez/src/device.c:btd_device_ref() 0x1ff4d90: ref=4
D/BtDebug ( 1578): external/bluetooth/bluez/audio/device.c:audio_device_register() Registered interface org.bluez.Audio on path /org/bluez/1578/hci0/dev_B0_D0_9C_58_0B_28
D/BtDebug ( 1578): external/bluetooth/bluez/audio/manager.c:handle_uuid() server not enabled for 00001112-0000-1000-8000-00805f9b34fb (0x1112)
D/BtDebug ( 1578): external/bluetooth/bluez/audio/manager.c:handle_uuid() server not enabled for 0000111f-0000-1000-8000-00805f9b34fb (0x111f)
D/BtDebug ( 1578): external/bluetooth/bluez/audio/manager.c:handle_uuid() server not enabled for 0000110a-0000-1000-8000-00805f9b34fb (0x110a)
D/BtDebug ( 1578): external/bluetooth/bluez/audio/manager.c:handle_uuid() Found AV Target
D/BtDebug ( 1578): external/bluetooth/bluez/audio/control.c:control_init() Registered interface org.bluez.Control on path /org/bluez/1578/hci0/dev_B0_D0_9C_58_0B_28
D/BtDebug ( 1578): external/bluetooth/bluez/audio/manager.c:handle_uuid() Found AV Target
D/BluetoothEventLoop(  230): Device property changed: B0:D0:9C:58:0B:28 property: UUIDs value: 9
D/BluetoothService(  230): updateDeviceServiceChannelCache(B0:D0:9C:58:0B:28)
D/BtDebug ( 1578): external/bluetooth/bluez/src/device.c:device_set_temporary() temporary 0
D/BtDebug ( 1578): external/bluetooth/bluez/src/device.c:btd_device_unref() 0x1ff4d90: ref=3
D/BtDebug ( 1578): external/bluetooth/bluez/ggsp/server.c:handle_property_change() path /org/bluez/1578/hci0/dev_B0_D0_9C_58_0B_28
D/BtDebug ( 1578): external/bluetooth/bluez/ggsp/server.c:handle_property_change() property UUIDs
D/BluetoothService(  230):     uuid(system): 00001105-0000-1000-8000-00805f9b34fb 12
D/BtDebug ( 1578): external/bluetooth/bluez/ggsp/server.c:handle_property_change() path /org/bluez/1578/hci0/dev_B0_D0_9C_58_0B_28
D/BtDebug ( 1578): external/bluetooth/bluez/ggsp/server.c:handle_property_change() property Temporary
D/BluetoothService(  230):     uuid(application): 301c214f-91a2-43bf-a795-09d1198a81a7 5
D/BluetoothService(  230): Making callback for 301c214f-91a2-43bf-a795-09d1198a81a7 with result 5
V/BluetoothEventManager( 1324): Received android.bluetooth.device.action.UUID
D/BluetoothEventLoop(  230): Device property changed: B0:D0:9C:58:0B:28 property: Temporary value: false
D/CachedBluetoothDevice( 1324): updating profiles on device B0:D0:9C:58:0B:28 type 1
E/CtsBluetoothChatService( 1609): connect() failed
E/CtsBluetoothChatService( 1609): java.io.IOException: Connection refused
E/CtsBluetoothChatService( 1609):     at android.bluetooth.BluetoothSocket.connectNative(Native Method)
E/CtsBluetoothChatService( 1609):     at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:266)
E/CtsBluetoothChatService( 1609):     at com.android.cts.verifier.bluetooth.BluetoothChatService$ConnectThread.run(BluetoothChatService.java:393)