From owner-freebsd-bluetooth@FreeBSD.ORG Sun Sep 9 17:40:20 2012 Return-Path: Delivered-To: bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 47F141065680 for ; Sun, 9 Sep 2012 17:40:20 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from smtpout.wanadoo.co.uk (smtpout2.wanadoo.co.uk [80.12.242.42]) by mx1.freebsd.org (Postfix) with ESMTP id D99058FC0A for ; Sun, 9 Sep 2012 17:40:18 +0000 (UTC) Received: from galant.ukfsn.org ([109.249.211.131]) by mwinf5d25 with ME id x5Ye1j0012qfP7R035YfUq; Sun, 09 Sep 2012 19:32:42 +0200 Received: by galant.ukfsn.org (Postfix, from userid 1000) id 8278E2600A0; Sun, 9 Sep 2012 18:32:50 +0100 (BST) Date: Sun, 9 Sep 2012 18:32:50 +0100 (BST) From: Iain Hibbert To: "Mikhail T." In-Reply-To: <504CBF27.5030500@aldan.algebra.com> Message-ID: References: <504CBF27.5030500@aldan.algebra.com> User-Agent: Alpine 2.00 (NEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: bluetooth@FreeBSD.org Subject: Re: Monitoring Bluetooth devices X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Sep 2012 17:40:20 -0000 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