Monitoring Bluetooth devices

Iain Hibbert plunky at rya-online.net
Sun Sep 9 17:40:20 UTC 2012


On Sun, 9 Sep 2012, Mikhail T. wrote:

> I'd like to keep a log of Bluetooth-devices appearing within "earshot" of my
> computer at home. I don't need to "pair" with them or do anything else
> actively -- just log the facts like these:
>
>    2012-09-11 11:47:50    00:11:22:33:44:55 appeared
>    2012-09-11 11:47:53    00:11:22:33:44:55 disappeared
>
> Where would I start? Thanks! Yours,

You could arrange to call bt_devinquiry(3) once per minute, and tabulate
the results from that.

Or, I don't know how much it interferes with general operation (perhaps
less, than the above) you could look into placing the device into
"periodic inquiry" mode, rather than performing a "general inquiry"
constantly. That way, I think you just get inquiry results as devices
respond..

There is not really a way to say that a device has moved away, since in a
busy environment it could just have missed the inquiry scan (or you, its
response), but you could delist devices which hadn't been seen for a few
iterations, or after a specific time had lapsed..

I have found it very noticeable, since the advent of Android smartphones
(which seem to not have a permanent 'discoverable' mode) that Bluetooth
devices are not so easy to see in public spaces.

regards,
iain


More information about the freebsd-bluetooth mailing list