hi erveryone, i have a problem when i use BluetoothSocket.connect(),
it cause the "connection refused" error as follow:


11-21 00:25:11.086: DEBUG/dalvikvm(16199): Debugger has detached;
object registry had 1 entries
11-21 00:25:11.086: INFO/ActivityManager(85): Start proc
com.liqiang.bluetooth for activity
com.liqiang.bluetooth/.MainActivity: pid=16206 uid=10075 gids={3002,
3001}
11-21 00:25:11.096: INFO/AndroidRuntime(16199): NOTE: attach of thread
'Binder Thread #3' failed
11-21 00:25:11.146: DEBUG/dalvikvm(16206): Debugger has detached;
object registry had 1 entries
11-21 00:25:11.226: VERBOSE/RenderScript_jni(164): surfaceDestroyed
11-21 00:25:13.566: WARN/KeyCharacterMap(16206): No keyboard for id
65540
11-21 00:25:13.576: WARN/KeyCharacterMap(16206): Using default
keymap: /system/usr/keychars/qwerty.kcm.bin
11-21 00:25:14.046: INFO/ActivityManager(85): Displayed activity
com.liqiang.bluetooth/.MainActivity: 2966 ms (total 2966 ms)
11-21 00:25:14.496: INFO/ActivityManager(85): Starting activity:
Intent { cmp=com.liqiang.bluetooth/.DeviceListActivity }
11-21 00:25:14.866: INFO/ActivityManager(85): Displayed activity
com.liqiang.bluetooth/.DeviceListActivity: 336 ms (total 336 ms)
11-21 00:25:15.546: ERROR/BluetoothEventLoop.cpp(85): event_filter:
Received signal org.bluez.Adapter:PropertyChanged from /org/bluez/
13302/hci0
11-21 00:25:15.546: VERBOSE/BluetoothEventRedirector(11131): Received
android.bluetooth.adapter.action.DISCOVERY_STARTED
11-21 00:25:15.686: DEBUG/dalvikvm(11131): GC_FOR_MALLOC freed 8312
objects / 545176 bytes in 61ms
11-21 00:25:16.376: ERROR/BluetoothEventLoop.cpp(85): event_filter:
Received signal org.bluez.Adapter:DeviceFound from /org/bluez/13302/
hci0
11-21 00:25:16.386: DEBUG/BluetoothService(85):
updateDeviceServiceChannelCache(00:1C:26:D4:B6:8A)
11-21 00:25:16.406: VERBOSE/BluetoothEventRedirector(11131): Received
android.bluetooth.device.action.FOUND
11-21 00:25:16.406: INFO/DeviceListActivity(16206): ACTION_FOUND----->
11-21 00:25:16.576: ERROR/BluetoothEventLoop.cpp(85): event_filter:
Received signal org.bluez.Adapter:DeviceFound from /org/bluez/13302/
hci0
11-21 00:25:16.576: DEBUG/BluetoothService(85):
updateDeviceServiceChannelCache(00:26:5E:97:37:97)
11-21 00:25:16.596: VERBOSE/BluetoothEventRedirector(11131): Received
android.bluetooth.device.action.FOUND
11-21 00:25:16.596: INFO/DeviceListActivity(16206): ACTION_FOUND----->
11-21 00:25:20.417: ERROR/BluetoothEventLoop.cpp(85): event_filter:
Received signal org.bluez.Adapter:PropertyChanged from /org/bluez/
13302/hci0
11-21 00:25:20.417: ERROR/BluetoothService.cpp(85):
stopDiscoveryNative: D-Bus error in StopDiscovery:
org.bluez.Error.Failed (Invalid discovery session)
11-21 00:25:20.426: VERBOSE/BluetoothEventRedirector(11131): Received
android.bluetooth.adapter.action.DISCOVERY_FINISHED
11-21 00:25:20.426: INFO/DeviceListActivity(16206):
ACTION_DISCOVERY_FINISHED---->
11-21 00:25:20.446: DEBUG/BluetoothTest(16206): onActivityResult -1
11-21 00:25:20.446: DEBUG/BluetoothTest(16206): onActivityResult----
requestCode 1
11-21 00:25:20.706: ERROR/BluetoothService.cpp(85):
stopDiscoveryNative: D-Bus error in StopDiscovery:
org.bluez.Error.Failed (Invalid discovery session)
11-21 00:25:21.986: ERROR/BluetoothService.cpp(85):
stopDiscoveryNative: D-Bus error in StopDiscovery:
org.bluez.Error.Failed (Invalid discovery session)
11-21 00:25:22.556: ERROR/BluetoothEventLoop.cpp(85): event_filter:
Received signal org.bluez.Adapter:DeviceCreated from /org/bluez/13302/
hci0
11-21 00:25:22.566: ERROR/BluetoothEventLoop.cpp(85): event_filter:
Received signal org.bluez.Adapter:PropertyChanged from /org/bluez/
13302/hci0
11-21 00:25:22.566: ERROR/BluetoothEventLoop.cpp(85): event_filter:
Received signal org.bluez.Device:PropertyChanged from /org/bluez/13302/
hci0/dev_00_1C_26_D4_B6_8A
11-21 00:25:22.596: INFO/BluetoothEventLoop.cpp(85):
agent_event_filter: Received method org.bluez.Agent:RequestPinCode
11-21 00:25:22.596: DEBUG/BluetoothService(85): 00:1C:26:D4:B6:8A bond
state 10 -> 11 (0)
11-21 00:25:22.606: VERBOSE/BluetoothEventRedirector(11131): Received
android.bluetooth.device.action.BOND_STATE_CHANGED
11-21 00:25:22.616: INFO/ActivityManager(85): Starting activity:
Intent { act=android.bluetooth.device.action.PAIRING_REQUEST
flg=0x10000000
cmp=com.android.settings/.bluetooth.BluetoothPairingDialog (has
extras) }
11-21 00:25:23.119: WARN/ActivityManager(85): Activity pause timeout
for HistoryRecord{44b675d0 com.liqiang.bluetooth/.MainActivity}
11-21 00:25:23.426: INFO/ActivityManager(85): Displayed activity
com.android.settings/.bluetooth.BluetoothPairingDialog: 313 ms (total
313 ms)
11-21 00:25:29.426: DEBUG/dalvikvm(15812): GC_EXPLICIT freed 969
objects / 70920 bytes in 87ms
11-21 00:25:36.066: ERROR/BluetoothEventLoop.cpp(85): event_filter:
Received signal org.bluez.Device:PropertyChanged from /org/bluez/13302/
hci0/dev_00_1C_26_D4_B6_8A
11-21 00:25:36.066: DEBUG/BluetoothService(85): 00:1C:26:D4:B6:8A bond
state 11 -> 12 (0)
11-21 00:25:36.086: VERBOSE/BluetoothEventRedirector(11131): Received
android.bluetooth.device.action.BOND_STATE_CHANGED
11-21 00:25:36.116: WARN/System.err(16206): java.io.IOException:
Connection refused
11-21 00:25:36.116: WARN/System.err(16206):     at
android.bluetooth.BluetoothSocket.connectNative(Native Method)
11-21 00:25:36.116: WARN/System.err(16206):     at
android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:204)
11-21 00:25:36.116: WARN/System.err(16206):     at
com.liqiang.bluetooth.MainActivity.connect(MainActivity.java:226)
11-21 00:25:36.116: WARN/System.err(16206):     at
com.liqiang.bluetooth.MainActivity.access$2(MainActivity.java:207)
11-21 00:25:36.116: WARN/System.err(16206):     at
com.liqiang.bluetooth.MainActivity$1.onClick(MainActivity.java:93)
11-21 00:25:36.116: WARN/System.err(16206):     at
android.view.View.performClick(View.java:2408)
11-21 00:25:36.116: WARN/System.err(16206):     at android.view.View
$PerformClick.run(View.java:8816)
11-21 00:25:36.116: WARN/System.err(16206):     at
android.os.Handler.handleCallback(Handler.java:587)
11-21 00:25:36.116: WARN/System.err(16206):     at
android.os.Handler.dispatchMessage(Handler.java:92)
11-21 00:25:36.127: WARN/System.err(16206):     at
android.os.Looper.loop(Looper.java:123)
11-21 00:25:36.127: WARN/System.err(16206):     at
android.app.ActivityThread.main(ActivityThread.java:4627)
11-21 00:25:36.127: WARN/System.err(16206):     at
java.lang.reflect.Method.invokeNative(Native Method)
11-21 00:25:36.127: WARN/System.err(16206):     at
java.lang.reflect.Method.invoke(Method.java:521)
11-21 00:25:36.127: WARN/System.err(16206):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-21 00:25:36.127: WARN/System.err(16206):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-21 00:25:36.137: WARN/System.err(16206):     at
dalvik.system.NativeStart.main(Native Method)

anything idea?
thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to