Mortal user cannot make local device discoverable

22 views
Skip to first unread message

Google Apps Discussion Group

unread,
May 29, 2009, 3:52:42 PM5/29/09
to bluecove-users
The following code:

package smartspaces.device;

import javax.bluetooth.DiscoveryAgent;
import javax.bluetooth.LocalDevice;

public class Test
{
public static void main(final String[] argument)
{
try
{
LocalDevice.getLocalDevice().setDiscoverable
(DiscoveryAgent.GIAC);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}

Produces the following results:

$ java -cp <classpath> -Djava.library.path=external/bluecove-gpl-2.1.0
smartspaces.device.Test
BlueCove version 2.1.0 on bluez
javax.bluetooth.BluetoothStateException: Bluetooth Device is not
ready. [1] Operation not permitted
at
com.intel.bluetooth.BluetoothStackBlueZ.nativeSetLocalDeviceDiscoverable
(Native Method)
at com.intel.bluetooth.BluetoothStackBlueZ.setLocalDeviceDiscoverable
(BluetoothStackBlueZ.java:291)
at javax.bluetooth.LocalDevice.setDiscoverable(LocalDevice.java:206)
at smartspaces.device.Test.main(Test.java:12)
BlueCove stack shutdown completed

When run as a mortal user on Ubuntu 9.04. However, no exception is
thrown if it's run as root. What permission problem am I seeing?

If this is a FAQ, I'll take a pointer to where to look.

Thanks,

Mike

Vlad Skarzhevskyy

unread,
May 30, 2009, 2:12:37 AM5/30/09
to bluecov...@googlegroups.com

Michael Smith

unread,
Jun 8, 2009, 5:52:10 PM6/8/09
to bluecove-users
Thanks Vlad. I guess I need to look at the newer BlueZ stack.

On May 29, 11:12 pm, Vlad Skarzhevskyy <skarzhevs...@gmail.com> wrote:
> http://code.google.com/p/bluecove/wiki/stacks
Reply all
Reply to author
Forward
0 new messages