From owner-freebsd-bluetooth@FreeBSD.ORG Fri Feb 17 17:40:26 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 0852316A420 for ; Fri, 17 Feb 2006 17:40:26 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from ismybrain.com (ismybrain.com [64.246.42.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5EFF543D58 for ; Fri, 17 Feb 2006 17:40:23 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from [10.254.186.111] (localhost.localdomain [127.0.0.1]) by ismybrain.com (8.11.6/8.11.6) with ESMTP id k1HHeHM10199; Fri, 17 Feb 2006 12:40:17 -0500 Message-ID: <43F60A7B.2090206@savvis.net> Date: Fri, 17 Feb 2006 09:40:11 -0800 From: Maksim Yevmenkin User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050404) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Eric Anderson References: <43F34314.7030606@centtech.com> <43F3688B.8060700@savvis.net> <43F4B7AA.5030000@centtech.com> <43F5229C.8050106@savvis.net> <43F5D186.7060302@centtech.com> In-Reply-To: <43F5D186.7060302@centtech.com> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit 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: Fri, 17 Feb 2006 17:40:26 -0000 Eric Anderson wrote: [...] >> do not know. this code in bthidd(8) was written by looking at msdn >> docs (i think). >> >>> I have a microsoft bluetooth mouse at home that I'll try to get the >>> info from. >> >> ok. let us know about the results. > > Here's a bthidcontrol dump from a microsoft mouse: [...] > Collection page=Consumer usage=Consumer_Control > Collection page=Generic_Desktop usage=Mouse > Input id=3 size=2 count=1 page=Microsoft usage=0xfe01 Variable, > logical range 0..3 > Input id=3 size=1 count=1 page=Microsoft usage=0xfe00 Variable, > logical range 0..1 > Input id=3 size=5 count=1 page=0x0000 usage=0x0000 Const, logical > range 0..1 > End collection > End collection as you can see there is an input hid report, page == "Microsoft usage", usage == 0xfe01 and range 0..3. this looks like "battery report". i do not know what 0xfe00 report is > Collection page=Consumer usage=Consumer_Control > Collection page=Generic_Desktop usage=Mouse > Input id=4 size=8 count=1 page=Consumer usage=AC_Pan Variable > Relative, logical range -127..127 > Feature id=4 size=1 count=1 page=Microsoft usage=0xff04 Variable, > logical range 0..1 > Feature id=4 size=1 count=1 page=Microsoft usage=0xff06 Variable, > logical range 0..1 > Feature id=4 size=1 count=6 page=0x0000 usage=0x0000 Const, logical > range 0..1 > End collection > End collection i'm not sure what these are > I also noticed that a query shows this line: > > battery_power true; > > What is that telling me? That it is currently on battery power? I > suppose if that's the case, then some devices may report false for AC > power and true for battery.. no, its telling you that device uses battery as its power source. this information comes from the sdp record. usually, it only needs to pulled once during connection establishment. >>> I wonder where the right place to report the battery information is? >> >> like i said, right now it goes to /var/log/messages. info, notice and >> warning levels are used for different battery states (ok, low, very >> low). if this is not the right place, please let me know where do you >> want it to be? > > I suppose if one wanted to make a tool to monitor the mouse battery > (say, for an X window manager), you could poll/parse the output of > bthidcontrol, right? Is there a better way to grab the info (a bthid > library or something)? Sorry if this is a trivial question - I'm not a > bluetooth hacker :) not quite. "battery report" is an input report, i.e. mouse should send it periodically. bhtidd(8) already parses it. the question is what should it do with this information? right now it just logs it. it could send another message to another application (i.e. mouse battery monitoring tool) so it can do whatever is required. thanks, max