The hcitool lescan answer is incomplete. it will loop. You want a timeout, but a timeout that will not cause issue to hcitool (the default signal would)
For 5 seconds:
timeout -s SIGINT 5s hcitool -i hci0 lescan --passive
Then you can use gatttool:
sudo gatttool -i hci1 -b BC:6A:29:AC:2E:B4 -I
For more details on what to do after the connect: http://joost.damad.be/2013/08/experiments-with-bluetooth-low-energy.html
So I'm not sure if you're looking to do this programmatically or not. But the first step you'd need to accomplish this is a database that catalogues all of this sort of information for each distribution and their respective releases.
Luckily… that is exactly what distrowatch.com is.
You can gather this information using their advanced search page, which has a cool feature that allows you to search for distribution releases that include a specific version of a package. In this case, you're interested in the linux
package.
Searching for a specific version of that package (which corresponds to the kernel version) will give you a nice list of distributions followed by the releases of that distribution that ship with that package version.
I don't know of any DistroWatch API, so if you need to do this programmatically, you'll probably have to do some html parsing. But the format for the query to generate the results page for a given kernel version would be as follows:
distrowatch.com/search.php?pkg=linux&pkgver=VERSION&distrorange=InAny#pkgsearch
Play around with that, and you might be able to get a nice little tool to do exactly what you're trying to do. If anyone knows of a better way to search DistroWatch's Database, please chime in. It'd be really nice, since they have such a treasure-trove of information.
Best Answer
If you have a rough idea (or are fine with covering the last 10 years),
bluez
provides tools inbluez-uils
to request the version. Unfortunately, these tools changed between version 4 and 5, so you may have to check if one of both is installed.For BlueZ 4.0:
Since BlueZ 5.0, there is a new command-line tool
bluetoothctl
: