From owner-freebsd-bluetooth@FreeBSD.ORG Thu Apr 6 07:51:25 2006 Return-Path: X-Original-To: freebsd-bluetooth@freebsd.org Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 24F6A16A401 for ; Thu, 6 Apr 2006 07:51:25 +0000 (UTC) (envelope-from plunky@rya-online.net) Received: from mail07.svc.cra.dublin.eircom.net (mail07.svc.cra.dublin.eircom.net [159.134.118.23]) by mx1.FreeBSD.org (Postfix) with SMTP id 4BEBB43D46 for ; Thu, 6 Apr 2006 07:51:23 +0000 (GMT) (envelope-from plunky@rya-online.net) Received: (qmail 4951 messnum 2896211 invoked from network[83.70.176.191/unknown]); 6 Apr 2006 07:51:22 -0000 Received: from unknown (HELO rya-online.net) (83.70.176.191) by mail07.svc.cra.dublin.eircom.net (qp 4951) with SMTP; 6 Apr 2006 07:51:22 -0000 Received: (nullmailer pid 1303 invoked by uid 1000); Thu, 06 Apr 2006 07:49:50 -0000 Date: Thu, 6 Apr 2006 08:49:50 +0100 (BST) To: Eric Anderson In-Reply-To: <4434980E.8050202@centtech.com> References: <43F34314.7030606@centtech.com> <43F3688B.8060700@savvis.net> <43F4B7AA.5030000@centtech.com> <43F5229C.8050106@savvis.net> <43F5D186.7060302@centtech.com> <43F60A7B.2090206@savvis.net> <43F62314.1070101@centtech.com> <43F645BB.4070008@savvis.net> <4434980E.8050202@centtech.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Message-Id: <1144309790.220711.1109.nullmailer@galant.ukfsn.org> From: Iain Hibbert Cc: freebsd-bluetooth@freebsd.org Subject: Re: mouse battery status? 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: Thu, 06 Apr 2006 07:51:25 -0000 On Wed, 5 Apr 2006, Eric Anderson wrote: > What about a simple tiny kernel module that can maintain these and other > tweaks related to bluetooth? Like a btmon.ko? This seems overly complex. Can you not just add an entry in your syslog.conf to filter messages from bthidd? I have not tried this, but syslog.conf(5) on appears to show that it is possible, eg: !bthidd *.* |/usr/bin/batmon though I'm not so sure what the 'batmon' program would do - it can extract the battery reports at least, but can't really do anything with them. Probably better to just feed bthidd output to a logfile and get a user program to parse it. You could add a commandline option to bthidd to make it do special logging of the battery information, eg add if (battery_log) syslog(LOG_LOCAL7, "%s %d", bt_ntoa(&s->bdaddr, NULL), val); to the battery report section which might make parsing easier, and use something like !bthidd user.local7 /var/log/bthidd.batlog so you dont have to worry about all the other stuff. Then, your user program will just have to open battery.log and sit in a read() loop to get what it needs. iain