2
votes

My bluetooth adapter in Settings (on Ubuntu) can detect my AR Drone (MiniSpider) device. But using the simple Bluez code example to detect Bluetooth devices, I'm not able to detect the drone device. My code is exactly the same as the code in the before mentioned link. I can detect a phone using the code (if the phone has made itself visible).

Any idea what could be the problem?

Output from hcitool lescan: it successfully finds the drone bluetooth device.

sudo hcitool lescan
LE Scan ...
A0:14:31:48:8C:EB RS_W082091
A0:14:31:48:8C:EB RS_W082091
A0:14:31:48:8C:EB RS_W082091

1
The code sample is for classic BT scan not LE scan. - kaylum

1 Answers

1
votes

The code snippet you are using is for scanning classic Bluetooth devices. This is the equivalent of using hcitool inq from the command line, in which case you'll probably not be able to detect your device.

However, the AR Drone seems to support Bluetooth Low Energy (BLE), and not classic Bluetooth. Therefore, using the inquiry method you were not able to detect it. If you use code that scan for BLE devices, you'll be able to find your device. You can have a look at the source for hcitool.c below:-

https://github.com/aguedes/bluez/blob/master/tools/hcitool.c

And then your starting point would be to use the hcitool lescan code:-

static void cmd_lescan(int dev_id, int argc, char **argv)
{
    ...
}