[android-developers] Bluetooth, RFCOMM socket close error ?
Hi all,
Using this list as a valuable source of info, I've been able to
succesfully create an RFCOMM connection and transfer data over it,
using my HTC Desire.
The primary obstacle was the failure of
BluetoothDevice.createRfcommSocketToServiceRecord(), circumvented by
reflection (createRfcommSocket). Search this group or
stackoverflow.com for example code.
So far, so good.
But - after closing down the connection following what I think is
correct procedure (close streams, then close socket, each encapsulated
in try/catch), the next call to connect() blocks until I call close()
from another thread.
In this scenario, Logcat always contains:
E/BTLD (23644): RFCOMM_CreateConnection - already opened state:2,
RFC state:4, MCB state:5
- despite the fact that I (think I) have closed everything properly.
The only cure I've been able to find is cycling BT off and on, which
is a bit much, I think... Doable from code, but definitely not a nice
thing to do.
Am I missing a point somewhere, or is this a known bug in the BT stack
(possibly HTC specific) ?
BR
Per
--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home