Change bluetooth address (linux)?

349 views
Skip to first unread message

Andrew Smith

unread,
Feb 22, 2010, 11:06:40 AM2/22/10
to bluecov...@googlegroups.com
Is this possible with Bluecove? If not, with linux?

Thanks

Andrew Smith

unread,
Feb 22, 2010, 7:16:28 PM2/22/10
to bluecov...@googlegroups.com
OK, as a follow up I've found that it is possible via a linux command:

sudo bccmd -d hci0 psset -r bdaddr 0x04 0x00 0x06 0x05 0x03 0x00 0x02 0x01

However! Should I run this command after my program has run and then attempt to (for example) do LocalDevice.getLocalDevice().setDiscoverable(i); I get the error

ntel.bluetooth).Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Unable to retrieve the local scan mode.
        at com.intel.bluetooth.BluetoothStackBlueZ.nativeGetLocalDeviceDiscoverable(Native Method)

Any pointers for a resolution?

By the way this is Ubuntu 9.10, Bluecove, using multiple bluetooth adapters.

Thanks!

Youri Westerman

unread,
Feb 24, 2010, 12:43:51 PM2/24/10
to bluecov...@googlegroups.com
Ok the best possible suggestion here is: do not change the bluetooth
address of the adapter you are using during runtime.
Another thing you could try is selecting the right device before you
call getLocalDevice().
It might be a better idea to check out what happens to your
localdevices after you change the address, just print some info about
them to see if the address change came through to bluecove.
However I suspect that the change you're making won't be available
untill the next initialization of bluecove..
Please let me know if you succeed or not.

Regards,

Youri

> --
> You received this message because you are subscribed to the Google Groups
> "bluecove-users" group.
> To post to this group, send email to bluecov...@googlegroups.com.
> To unsubscribe from this group, send email to
> bluecove-user...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/bluecove-users?hl=en.
>

Andrew Smith

unread,
Mar 2, 2010, 11:02:15 AM3/2/10
to bluecov...@googlegroups.com
Experimentation so far shows that even if I do external calls to change the address *before* Bluecove stack is initalized I will either get

Bluetooth Device is not ready. [32] Broken pipe
Bluetooth Device is not ready. [110] Connection timed out

This is often followed by weird behaviour such a my application only picking up a couple of devices when there are in fact 7. Even after multiple restarts.

It seems really inadvisable to change BD Addr at all but I would like to do it.

My investigation continues..

Andrew Smith

unread,
Mar 2, 2010, 11:05:36 AM3/2/10
to bluecov...@googlegroups.com
Actually, sleeping for a second after altering addresses seems to get rid of Broken pipe and Timed out errors, which is promising.
Reply all
Reply to author
Forward
0 new messages