mouse battery status?
Iain Hibbert
plunky at rya-online.net
Thu Apr 6 07:51:25 UTC 2006
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
More information about the freebsd-bluetooth
mailing list