Referencing this post I have successfully managed to get a Linux Device (A Raspberry Pi Model A+) to switch my Bluetooth 4.0 USB dongle into the 'advertising' state:
sudo hciconfig hci0 leadv 3
or
sudo hciconfig hci0 leadv 0
I verified this using an Ipod running the 'LightBlue Explorer' App.
All good so far.
From another Linux box (another Pi) which also has a Bluetooth 4.0 dongle; I can also see the device, using this command:
sudo hcitool lescan --passive
Which returns something like this:
LE Scan ...
xx:xx:xx:xx:xx:xx (unknown)
yy:yy:yy:yy:yy:yy (unknown)
xx:xx:xx;xx:xx:xx (unknown)
But the command loops around constantly refreshing the list of devices.
So my main question is: is there a variation of the command that can be run, listen for (say) 5 seconds; return the list of devices that it found to be advertising and exit ?
I want to build a simple script (or Python program ideally) that will periodically wake up, listen (passively) for advertising traffic for a few seconds, and then return the list of source devices.
Additionally: I'm not sure why the the command shows 'unknown' for the devices it finds. (Whereas the LightBlue does identify the name).