Bluecove library 2.1.1-SNAPSHOT on Windows/Mac - connecting to service fails

529 views
Skip to first unread message

Davis Ford

unread,
May 17, 2011, 3:11:57 PM5/17/11
to Vlad Skarzhevskyy, bluecov...@googlegroups.com
Hi Vlad,

I wonder if I could ask you a quick question regarding bluecove since
the groups seem to be down (I'm trying to cc to the group just in
case). I promise not to bother you directly in the future, but if
there's something here you see that I'm doing wrong, and can quickly
diagnose it, I would appreciate it greatly.

I'm using bluecove-2.1.1-SNAPSHOT, and I'm developing a cross-platform
app that incorporates bluetooth -- meant to run on Win/Mac/Linux.
Right now, I'm having issues with the library on both the Windows and
Mac platform. I haven't yet tried Linux bluez yet.

I wrote a simple main program based off one of your examples to just
do device discovery, service discovery and then try to connect to the
serial port profile service. The source is attached, but I'll
summarize the problem areas here.

Device Discovery => works fine
Service Discovery => works fine
Connection => doesn't work.

So, I retrieve the service URL string during service discovery like this:

String url = servRecord[i].getConnectionURL(ServiceRecord.NOAUTHENTICATE_NOENCRYPT,
false);

Later, after service discovery is complete, I attempt to connect like this:

Connection connection = Connector.open(url);

On Mac OS 10.6, my stdout prints the following debug info, and it
indicates that I was able to get a connection, but the bluecove stack
shutdowns immediately at that point, even if I set a breakpoint. In
addition, I get a lot of bad looking warnings (see below):

BlueCove log redirected to log4j
BlueCove version 2.1.1-SNAPSHOT on mac
####### LOCAL DEVICE / STACK INFO #########
Address/Name: 60334B28FB8F/FooBar’s MacBook Pro
DeviceMajor/DeviceMinor: 256/12
Local Adapters: null
BlueCove Version: 2.1.1-SNAPSHOT
Does stack support multiple adapters? null
Does stack support L2CAP: true
Feature Service Attributes: true
Device Service Classes: true
Number of open connections: 0
Bluetooth Stack Implementation: mac
###########################################
Starting device inquiry...
2011-05-17 14:52:20.511 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x100117210 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:20.514 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10011b220 of class NSCFString autoreleased with no pool in
place - just leaking
2011-05-17 14:52:20.514 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10b10ad00 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:20.514 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10b1106c0 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:20.515 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10b11af70 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:20.515 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10b119af0 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:20.515 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10b11aae0 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:20.515 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102112240 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:20.515 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102112240 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:20.516 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102112240 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:20.516 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102112240 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:20.516 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102112240 of class NSCFArray autoreleased with no pool in
place - just leaking
Device discovered: 00066606C59E
response code: INQUIRY_COMPLETED
Device Inquiry Completed.

Bluetooth Devices:
00066606C59E (Daisy#2-C59E)
Search for services on 00066606C59E/Daisy#2-C59E
2011-05-17 14:52:33.531 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10011c100 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:33.531 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10011c140 of class NSCFString autoreleased with no pool in
place - just leaking
2011-05-17 14:52:33.532 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10b110140 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:33.532 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10b116280 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:33.532 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10b111df0 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:33.532 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10b1171c0 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:33.533 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10b110070 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:33.533 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x1021139d0 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:33.533 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x1021139d0 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:33.533 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x1021139d0 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:33.533 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x1021139d0 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:33.533 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x1021139d0 of class NSCFArray autoreleased with no pool in
place - just leaking
Service SPP found
btspp://00066606C59E:1;authenticate=false;encrypt=false;master=false
Service search complete for transaction 1
Trying to connect to
btspp://00066606C59E:1;authenticate=false;encrypt=false;master=false
response code: SERVICE_SEARCH_COMPLETED
2011-05-17 14:52:38.574 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10011bf20 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:38.575 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10011c890 of class NSCFString autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.575 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10210cc90 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:38.575 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102117e50 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:38.576 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10210fe10 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:38.576 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10210ff10 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:38.576 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102110170 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.576 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10b110070 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.576 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10b110070 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.577 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10b110070 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.577 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10b110070 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.577 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10b110070 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.637 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102110170 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.637 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102110170 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.638 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102110170 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.638 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10011bfe0 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:38.638 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10011c4e0 of class NSCFString autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.639 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x100117460 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:38.639 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10060f270 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:38.640 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x100117290 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:38.640 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x100117330 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:38.640 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x100116b70 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.641 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102110170 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.641 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102110170 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.642 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102110170 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.642 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102110170 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.642 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102110170 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.643 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x100116b70 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.643 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x100116b70 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.643 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x100116b70 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.644 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10210fcf0 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:38.644 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102117c20 of class NSCFString autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.644 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102117f40 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:38.644 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102117d40 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:38.644 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102113ad0 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:38.645 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102113bd0 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:38.645 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x102114e90 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.645 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x100116b70 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.645 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x100116b70 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.645 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x100116b70 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.645 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x100116b70 of class NSCFArray autoreleased with no pool in
place - just leaking
2011-05-17 14:52:38.645 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x100116b70 of class NSCFArray autoreleased with no pool in
place - just leaking
Got a connection
BlueCove stack shutdown completed

So my question is this: Am I doing something wrong here with trying to
get the Connection? Do you have any idea why the stack immediately
shuts down, and should I be concerned about all these object leak
warnings?

Now, on Windows (Win7 AMD64), the story is slightly different. It
just throws an exception when I try to connect, but I *think* this is
b/c it indicates in the debug printouts that L2CAP is not supported.
Could this be the reason for this exception? The Bluetooth hardware
is http://www.smc.com/index.cfm?event=viewProduct&cid=5&scid=103&localeCode=EN_USA&pid=1370

BlueCove log redirected to log4j
BlueCove version 2.1.1-SNAPSHOT on winsock
####### LOCAL DEVICE / STACK INFO #########
Address/Name: 0011B107BEFA/MACRODAVIS2
DeviceMajor/DeviceMinor: 256/4
Local Adapters: null
BlueCove Version: 2.1.1-SNAPSHOT
Does stack support multiple adapters? null
Does stack support L2CAP: false
Feature Service Attributes: true
Device Service Classes: true
Number of open connections: 0
Bluetooth Stack Implementation: winsock
###########################################
Starting device inquiry...
Device discovered: 00066606C59E
response code: INQUIRY_COMPLETED
Device Inquiry Completed.

Bluetooth Devices:
00066606C59E (Daisy#2-C59E)
Search for services on 00066606C59E Daisy#2-C59E
Service SPP found
btspp://00066606C59E:1;authenticate=false;encrypt=false;master=false
Trying to connect to
btspp://00066606C59E:1;authenticate=false;encrypt=false;master=false
Service search complete for transaction 1
response code: SERVICE_SEARCH_COMPLETED
Exception in thread "main"
javax.bluetooth.BluetoothConnectionException: Failed to connect;
[10051] A socket operation was attempted to an unreachable network.
at com.intel.bluetooth.BluetoothStackMicrosoft.connect(Native Method)
at com.intel.bluetooth.BluetoothStackMicrosoft.access$700(BluetoothStackMicrosoft.java:44)
at com.intel.bluetooth.BluetoothStackMicrosoft$ConnectThread.run(BluetoothStackMicrosoft.java:651)
BlueCove stack shutdown completed

BluetoothDiscovery.java

davis

unread,
May 18, 2011, 1:10:16 AM5/18/11
to bluecove-users

Ok, I managed to resolve nearly all of my issues, and I have the
library working with device discovery, service discovery, RFCOMM
connection and read/write on three platforms Windows (64-bit), Linux
(64-bit), Mac (64-bit).

I only have one question now. The code I mention seems to function ok
on the Mac, but it still spits out a ton of what appear to be JNI/
ObjectiveC related warnings indicating possible object/memory
leaks....? Here's a sampling:

2011-05-17 14:52:20.511 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x100117210 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking
2011-05-17 14:52:20.514 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10011b220 of class NSCFString autoreleased with no pool in
place - just leaking
2011-05-17 14:52:20.514 java[8324:903] *** __NSAutoreleaseNoPool():
Object 0x10b10ad00 of class NSConcreteMutableData autoreleased with no
pool in place - just leaking

Anyone have a clue what the root cause of this is, and is it benign or
should I be worried about it?

Thanks in advance,
Davis

Sampath Kumar

unread,
Dec 30, 2014, 3:58:21 AM12/30/14
to bluecov...@googlegroups.com, skarzh...@gmail.com, davi...@gmail.com
Hi davis,
I am facing the same issue as yours. How did you solve it ?
Reply all
Reply to author
Forward
0 new messages