I've got of those famous ISSC bluetooth adapters without an EEPROM and therefore with the annoying default bdaddr 11:11:11:11:11:11. If you've bought a noname adapter on eBay, then you most likely also have one of these.
root@wlhdd:~# lsusb -s 3
Bus 001 Device 003: ID 1131:1001 Integrated System Solution Corp.
Now, the bluez-utils includes a small utility called bdaddr in test/ which allows you to change the bdaddr. The version in CVS has support for ISSC adapters. I've successfully built this for whiterussian, based on a patched copy of the trunk bluez-utils. The changes to bluez-utils are minimal: a patch to bring bdaddr in sync with current CVS and a modified Makefile to build test/ and install test/bdaddr.
I was wondering if this was something that could be interesting to others? And if so, should I prepare a patch against bluez-utils, or should I try to create it as a separate target? The utility is small and depends on libbluetooth:
root@wlhdd:~# ls -l /usr/sbin/bdaddr
-rwxr-xr-x 1 root root 12775 Jan 1 2000 /usr/sbin/bdaddr
root@wlhdd:~# ldd /usr/sbin/bdaddr
libbluetooth.so.1 => /usr/lib/libbluetooth.so.1 (0x2aaee000)
libc.so.0 => /lib/libc.so.0 (0x2ab40000)
ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x2aaa8000)
And if I do prepare this, would it be appropriate to include a script to check for a 11:11:11:11:11:11 bdaddr and automagically change, e.g. it like this:
/usr/sbin/bdaddr -i hci0 `nvram get et0macaddr|awk '{OFS=FS=":";for(x=2,y=2;--x;){$x=sprintf("%02x",(y+="0x"$x)%256);y/=256}print}'`
(Reuses the et0 mac addr, with bit 2 set to 2 to indicate a locally set address)
I've been running this on a WL-HDD with whiterussion rc5 for a while and it seems to work very well.
Bjørn