aharpour / bluecove

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

Bluecove-bluez: setConfigProperty() doesn't accepts numbers #69

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is related to the message:
http://groups.google.com/group/bluecove-users/browse_thread/thread/cfaeb548b90a1
6db#

The following code works on bluecove-gpl, but not in bluecove-bluez
2.1.1-SNAPSHOT.16:

BlueCoveImpl.setConfigProperty("bluecove.deviceID", "0");
Object id = BlueCoveImpl.getThreadBluetoothStackID();

An exception is thrown:

----- 8< ----- Begin exception ---------------------------

Exception in thread "main" org.bluez.Error$NoSuchAdapter: No such
adapter
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.freedesktop.dbus.Error.getException(Unknown Source)
        at org.freedesktop.dbus.Error.throwException(Unknown Source)
        at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod
(Unknown Source)
        at org.freedesktop.dbus.RemoteInvocationHandler.invoke(Unknown
Source)
        at $Proxy1.FindAdapter(Unknown Source)
        at com.intel.bluetooth.BluetoothStackBlueZDBus.getAdapterUsingDeviceID
(BluetoothStackBlueZDBus.java:208)
        at com.intel.bluetooth.BluetoothStackBlueZDBus.initialize
(BluetoothStackBlueZDBus.java:294)
        at com.intel.bluetooth.BlueCoveImpl.setBluetoothStack
(BlueCoveImpl.java:964)
        at com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:
493)
        at com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:65)
        at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:1035)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged
(BlueCoveImpl.java:1033)
        at com.intel.bluetooth.BlueCoveImpl.getBluetoothStack
(BlueCoveImpl.java:1026)
        at com.intel.bluetooth.BlueCoveImpl
$BluetoothStackHolder.getBluetoothStack(BlueCoveImpl.java:184)
        at com.intel.bluetooth.BlueCoveImpl$BluetoothStackHolder.access$300
(BlueCoveImpl.java:177)
        at com.intel.bluetooth.BlueCoveImpl.getThreadBluetoothStackID
(BlueCoveImpl.java:622)
        at my.package.MyClass.<init>(MyClass.java:23)

----- 8< ----- End exception --------------------------- 

Vlad has reported that the second parameter must be like this:

BlueCoveImpl.setConfigProperty("bluecove.deviceID", "hci0");
BlueCoveImpl.setConfigProperty("bluecove.deviceID", "11:22:33:44:55:66");

Both should work either on bluecove-gpl and bluecove-bluez.

Original issue reported on code.google.com by rodolpho...@gmail.com on 4 Mar 2009 at 1:55

GoogleCodeExporter commented 9 years ago
The problem fixed in 2.1.1-SNAPSHOT.20
Now this should work:
 BlueCoveImpl.setConfigProperty("bluecove.deviceID", "hci0");
 BlueCoveImpl.setConfigProperty("bluecove.deviceID", "0");

or
 BlueCoveImpl.setConfigProperty("bluecove.deviceAddress", "112233445566");

And this will not work:
 BlueCoveImpl.setConfigProperty("bluecove.deviceID", "11:22:33:44:55:66");

Original comment by skarzhev...@gmail.com on 5 Mar 2009 at 10:25