Something weird in bluecove code (probably a bug)

36 views
Skip to first unread message

Mina Shokry

unread,
Aug 15, 2009, 8:06:32 PM8/15/09
to bluecove-...@googlegroups.com
Hello all,

I found something weird in bluecove code that may be a bug!
asking for local devices IDs and then selecting one of them to use, causes an exception.

Here is an example code

public class Test {
    public static void main(String[] args) throws BluetoothStateException {
        Vector devicesId = BlueCoveImpl.getLocalDevicesID();
        for(Object o:devicesId) {
            System.out.println(o);
        }
        BlueCoveImpl.setConfigProperty(BlueCoveConfigProperties.PROPERTY_LOCAL_DEVICE_ID, (String)devicesId.get(0));
    }
}

output is

BlueCove version 2.1.1-SNAPSHOT on bluez
hci0
Exception in thread "main" java.lang.IllegalArgumentException: BlueCove Stack already initialized
        at com.intel.bluetooth.BlueCoveImpl.setConfigProperty(BlueCoveImpl.java:789)
        at Test.main(Test.java:23)
BlueCove stack shutdown completed
Java Result: 1

is this a bug?

I am using bluecove gpl on linux bluez 4 (ubuntu 9.04 64-bits)

Vlad Skarzhevskyy

unread,
Aug 15, 2009, 11:58:31 PM8/15/09
to bluecove-...@googlegroups.com

You need a stak instanse to get any information from from bt system. So one is initialised for you when you listing avalabel devices. You may shutdown it or reuse it...

Idealy you would not need to itialise stack instance interface to get the list of initialization options. But the promlem is that in bluecove this get list function was added as addon in already initialized stack. In later version initialization plumbing of bluecove can be redesigned to avoid such confusions.
There should esist two set of interfaces for initialization (missing now) and inerfaces for diferent part of bt functionality that are now one interface.
Do you want to do this?

Mina Shokry

unread,
Aug 16, 2009, 4:42:05 PM8/16/09
to bluecove-...@googlegroups.com
yes I want to do this,
but first I have to make androbex more stable. then I may start making this and implementing bluecove as android service to enable packaging bluecove as a separate package.
Reply all
Reply to author
Forward
0 new messages