manniru / bluecove

Automatically exported from code.google.com/p/bluecove
0 stars 0 forks source link

RFCOMM channels not handled properly on Mac #96

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. start a btspp service:

 StreamConnectionNotifier streamConnNotifier =
(StreamConnectionNotifier)Connector.
    open("btspp://localhost:" + new UUID(0x1234) + ";name=Test");

2. after the service has started, try to connect from another application
(or another thread) to a known device( known by its address and channel).
Make sure to have the device with bluetooth on.

StreamConnection testConnection = (StreamConnection)
        Connector.open("btspp://00a096122e66:1");

What is the expected output? What do you see instead?

I expect that the background btspp service to run in the background and to
be able to connect with my bluetooth device from the second application.

Instead, the background service takes over the connection with my device
and the application that wants to connect with the device in the first
place, receives an error (see attached file).

What BlueCove version are you using (include build number for SNAPSHOT)? On
what operating system and jvm? Is this 64-bit or 32-bit OS and jvm?

I use Bluecove 2.1.1-SNAPSHOT.60, on Macintosh 10.4.11, with Java 1.5.
32-bit OS.

Please provide any additional information below.
I want to mention here that the same scenario works fine on winsock and
widcomm stacks on Windows. 
Also works fine on above mentioned configuration if the Avetana library is
used instead of Bluecove.
A similar problem was reported here :
 http://wiigee.org/forums/viewtopic.php?f=6&t=33 

Original issue reported on code.google.com by bigmirc...@gmail.com on 15 Jan 2010 at 1:34

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by skarzhev...@gmail.com on 31 Mar 2010 at 5:02

GoogleCodeExporter commented 9 years ago
Hello,

I am trying to use bluecove to do peer to peer networking and I am running into 
the same issue.
Do you have any pointers on where to look or what might cause the issue? I'm 
willing to dig into the code (and have been doing so for a while now).

Regards

Original comment by Botje.linux@gmail.com on 26 Jul 2010 at 4:51

GoogleCodeExporter commented 9 years ago
It is impossible to connect to service running locally on the same device!
You need to connect to service from another computer or device.

Original comment by skarzhev...@gmail.com on 26 Jul 2010 at 4:56

GoogleCodeExporter commented 9 years ago
Thanks for your reply! However, the situation is slightly different:

We start an RFCOMM server in one thread. Then we discover and connect to a 
device in another thread (both threads running on the same device).
The outgoing connection never succeeds, it hangs in Connector.open().

We are not trying to connect to services running on the same device, but 
running both an RFCOMM server and connecting to a (remote) RFCOMM client.

We're testing with bluecove SVN and OSX 10.6.4.
Does that help narrow it down? If not, can you please tell us how we can help 
you debug it or how we should investigate it ourselves? Thanks!

Original comment by Botje.linux@gmail.com on 26 Jul 2010 at 10:56

GoogleCodeExporter commented 9 years ago
So you are connecting to Second device?

To debug this problem:
- The important debug for this case on Mac version only prints to stdout 
directly from native code.  So when you enable regular bluecove debug 
(-Dbluecove.debug=true) watch for stdout.
  Do you see somthing like 'ignore connectionComplete'

- Add more debug code to OSXStackChannelController.mm and OSXStackRFCOMM.mm see 
what are the events generated 

- Try to your app with demo version for avetana.  Does it work?

- Try running server in different process not just thread does it help?

- Can the problem be reproduced using Bluecove tester application?

- Can the problem be reproduced using L2CAP protocol?

Original comment by skarzhev...@gmail.com on 27 Jul 2010 at 1:40