RFCOMM channel handling on Mac

266 views
Skip to first unread message

bigmircea

unread,
Jan 13, 2010, 9:09:37 AM1/13/10
to bluecove-users
Hello,

I think I found a bug in Bluecove while running on mac stack: If you
have a btspp service running and in this time(while the service is
running) you try to connect to another device (knowing it's address
and channel), you get some exceptions, but not every time(sometimes it
works, sometimes it doesn't)

javax.bluetooth.BluetoothConnectionException: Failed to open connection
(3)
at
com.intel.bluetooth.BluetoothStackOSX.connectionRfOpenClientConnectionImpl
(Native Method)
at
com.intel.bluetooth.BluetoothStackOSX.connectionRfOpenClientConnection
(BluetoothStackOSX.java:576)
at com.intel.bluetooth.BluetoothRFCommClientConnection.<init>
(BluetoothRFCommClientConnection.java:37)
at com.intel.bluetooth.MicroeditionConnector.openImpl
(MicroeditionConnector.java:379)
at com.intel.bluetooth.MicroeditionConnector.open
(MicroeditionConnector.java:162)
at javax.microedition.io.Connector.open(Connector.java:83)

A similar problem was reported here:
http://wiigee.org/forums/viewtopic.php?f=6&t=33

The bug can be reproduced in the following way:

You start a btspp service in one thread (or another application like
my case) and then try to connect to a bluetooth device using btspp
profile from another thread (or a second application). The second
connection has to be on the same channel that the btspp service is
running.
For Mac, there is the BluetoothExplorer application that can show
all the running bt services and their RFCOMM channels.
This is only true for mac stack.

Is anybody aware of this problem?

I want to mention here that I tested the same scenario with Avetana
1.3.2 and it works fine.

I came across this problem because I want to be able to connect with
my bluetooth device while the btspp service is running in the
background, waiting for other kind of bluetooth devices.

Any suggestions are welcome,

Mircea

Youri Westerman

unread,
Jan 13, 2010, 10:10:13 AM1/13/10
to bluecov...@googlegroups.com
Unfortunately I don't know too much about the Apple Bluetooth Stack,
but it seems like the call fails because the local device is in the
wrong state or something. Maybe it will help if you check out some
local device properties.

http://www.bluecove.org/bluecove/apidocs/javax/bluetooth/LocalDevice.html#getProperty(java.lang.String)

Although it would be great if BlueCove behaved exactly the same, no
matter what stack is used, my experience is it doesn't. Which makes
sense because the stacks themselves don't behave exactly the same. The
same goes for libraries.

Regards,

Youri

> --
> You received this message because you are subscribed to the Google Groups "bluecove-users" group.
> To post to this group, send email to bluecov...@googlegroups.com.
> To unsubscribe from this group, send email to bluecove-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/bluecove-users?hl=en.
>
>
>
>

bigmircea

unread,
Jan 14, 2010, 8:20:59 AM1/14/10
to bluecove-users
Thank you Youri for your response.

I did check the LocalDevice's properties and everything seems to be
OK. The properties are exactly the same in both cases:
1. when I succeed to connect to the bluetooth device without the btspp
service in the background and
2. when the connection to my bluetooth device fails, while the btspp
service is running in the background.

If I have this btspp service running in the background and I try to
connect to another device, it's very weird what happens every second
time: I initiate the connection to the bluetooth device and then the
background btspp services takes over the connection and responds to my
bluetooth device. My original application that initiated the
connection then gets the above mentioned error.

Can anybody give me some guidelines to this problem please?

Mircea

bigmircea

unread,
Jan 14, 2010, 8:21:07 AM1/14/10
to bluecove-users
Reply all
Reply to author
Forward
0 new messages