Bluetooth RFCOMM connection refused

268 views
Skip to first unread message

d70fan

unread,
Sep 10, 2009, 3:12:15 AM9/10/09
to android-porting
Hi all,

I am getting the following error, while trying to port bluetooth.

When use UI to connect headset(Handfree profile). Pair can success but
always disconnect. The fail is happen in
android_bluetooth_HeadsetBase.cpp
static jint waitForAsyncConnectNative(JNIEnv *env, jobject obj, jint
timeout_ms)
{
.....
int nr = read(nat->rfcomm_sock, &ch, 1);
.....
}
return nr=-1, error=111

Have anyone know how to fix it?


find below the logs:
D/BluetoothDeviceService( 1818): 00:1A:0E:EC:14:B4 bond state 0 -> 2
(0)
V/BluetoothEventRedirector( 1972): Received
android.bluetooth.intent.action.BOND_STATE_CHANGED_ACTION
V/BluetoothEventRedirector( 1972): Received
android.bluetooth.intent.action.REMOTE_NAME_UPDATED
D/BluetoothDeviceService( 1818): 00:1A:0E:EC:14:B4 bond state 2 -> 1
(0)
D/BT HSHFP( 1860): Loaded priority 00:1A:0E:EC:14:B4 = 0
V/BluetoothEventRedirector( 1972): Received
android.bluetooth.intent.action.BOND_STATE_CHANGED_ACTION
D/BT HSHFP( 1860): Saved priority 00:1A:0E:EC:14:B4 = 100
D/LocalBluetoothDevice( 1972): []
D/LocalBluetoothDevice( 1972): Adding: CONNECT Address:00:1A:0E:EC:
14:B4 Profile:HEADSET TimeSent:not yet
D/LocalBluetoothDevice( 1972): workQueue.size() == 1 || TimeOut ->
process command now
D/LocalBluetoothDevice( 1972): processCommands:[CONNECT Address:00:1A:
0E:EC:14:B4 Profile:HEADSET TimeSent:not yet]
D/BT HSHFP( 1860): Headset state 0 -> 1, result = 1
D/BT HSHFP( 1860): Handsfree SDP request
D/LocalBluetoothDevice( 1972): Command sent successfully:CONNECT
Address:00:1A:0E:EC:14:B4 Profile:HEADSET TimeSent:12:03:08 AM
V/BluetoothEventRedirector( 1972): Received
android.bluetooth.intent.action.HEADSET_STATE_CHANGED
D/BT HSHFP( 1860): SDP request returned 1 (320 ms)
D/BT HSHFP( 1860): RFCOMM connection try to connect for 20 seconds
I/BT HSHFP( 1860): Created RFCOMM socket fd 38.
I/BT HSHFP( 1860): async connect is in progress (Operation now in
progress)
E/BT HSHFP( 1860): RFCOMM async connect() error: Connection refused
(111), nr = -1
D/BT HSHFP( 1860): RFCOMM connection attempt took 132 ms
W/BT HSHFP( 1860): headset.waitForAsyncConnect() error: -1
D/BT HSHFP( 1860): Rfcomm error
D/BT HSHFP( 1860): Headset state 1 -> 0, result = 0
V/BluetoothEventRedirector( 1972): Received
android.bluetooth.intent.action.HEADSET_STATE_CHANGED
I/BluetoothEventRedirector( 1972): Failed to connect BT headset
D/LocalBluetoothDevice( 1972): onProfileStateChanged:[CONNECT Address:
00:1A:0E:EC:14:B4 Profile:HEADSET TimeSent:12:03:08 AM]
D/LocalBluetoothDevice( 1972):
LocalBluetoothDevice.onProfileStateChanged() called. MAC addr matched
D/LocalBluetoothDevice( 1972): processCommands:[]

d70fan

unread,
Sep 10, 2009, 2:54:30 AM9/10/09
to android-porting
Reply all
Reply to author
Forward
0 new messages