I'm experiencing problems in fast detecting nearby bluetooth devices' names (human names, not BTADDR) I found a very interesting Python-based project here [http://code.google.com/p/python-bluetooth-scanner/] but the issue basically is that, while looking for BTADDR and RSSI is fast, detecting the "human" name of the device takes longer (even if they say it should work in the code)
I know I can look up for names with:
- the simple "hcitool scan" console command, which is slow
- the bluetooth.lookup_name(address) method of module PyBlueZ
- as written in the project, reported below
-
sock = bluetooth.bluez._gethcisock(device)
timeoutms = int(timeout * 1000)
try:
name = bluetooth._bluetooth.hci_read_remote_name( sock, address, timeoutms )
except bluetooth._bt.error, e:
print e
logger.debug("Lookup Failed")
name = None
sock.close()
return name
A brief insight: the system uses 2 dongles to detect nearby BT devices, if I make them looking up for names, they spend more time hence remaining locked, when a new device is discovered, devices are still locked in looking for the previous one's name and the whole software hangs. I'm running Ubuntu 10.10 in a VirtualBox in WindowsXP environment and a couple BT 2.1 dongles.
Apart from creating a list of "unnamed" devices to look for as soon as my dongles are done with the previous ones. Do you know any way I could do that faster?