From: David Sainty <david.sainty@dtsp.co.nz>
To: Iain Hibbert <plunky@rya-online.net>
Cc: Bastien Nocera <hadess@hadess.net>, linux-bluetooth@vger.kernel.org
Subject: Re: Apple Bluetooth devices: Battery level?
Date: Mon, 08 Jun 2009 09:15:42 +1200 [thread overview]
Message-ID: <4A2C2DFE.6090607@dtsp.co.nz> (raw)
In-Reply-To: <1244403258.783597.685.nullmailer@galant.ukfsn.org>
Iain Hibbert wrote:
> On Sun, 7 Jun 2009, Marcel Holtmann wrote:
>
>
>> Hi Bastien,
>>
>>
>>> I just got an Apple Bluetooth Mighty Mouse, and was wondering whether
>>> anyone had information on how to get the battery level from the device
>>> (the keyboard apparently also allows that):
>>> http://support.apple.com/kb/TA27118?viewlocale=en_US
>>>
>>> Anyone with an idea? An unparsed HID event? Does it need "poking"?
>>>
>> I think that Apple ones used an actually HID HUT conform descriptor for
>> that. I did reverser engineered that a long time ago, but then never got
>> around to do anything with it. Can't find my notes right now. Just run
>> hcidump and eventually you will see the report.
>>
>
> I have a mighty mouse and while I don't use BlueZ or Linux I would be
> interested in the details of this.. On my (NetBSD) system, the HID
> descriptor parses as:
>
> Collection page=Generic_Desktop usage=Mouse
> Input id=2 size=1 count=1 page=Button usage=Button_1 Variable, logical range 0..1
> Input id=2 size=1 count=1 page=Button usage=Button_2 Variable, logical range 0..1
> Input id=2 size=1 count=1 page=Button usage=Button_3 Variable, logical range 0..1
> Input id=2 size=1 count=1 page=Button usage=Button_4 Variable, logical range 0..1
> Input id=2 size=4 count=1 page=0x0000 usage=0x0000 Const Variable, logical range 0..1
> Collection page=Generic_Desktop usage=Pointer
> Input id=2 size=8 count=1 page=Generic_Desktop usage=X Variable Relative, logical range -127..127
> Input id=2 size=8 count=1 page=Generic_Desktop usage=Y Variable Relative, logical range -127..127
> Input id=2 size=8 count=1 page=Consumer usage=AC_Pan Variable Relative, logical range -127..127
> Input id=2 size=8 count=1 page=Generic_Desktop usage=Wheel Variable Relative, logical range -127..127
> End collection
> Input id=2 size=8 count=1 page=0x00ff usage=0x00c0 Variable, logical range -127..127
> Feature id=71 size=8 count=1 page=Device_Controls usage=Battery_Strength Variable NoPref Volatile, logical range 0..100
> End collection
>
> But I'm not really sure what the Device_Controls feature is supposed to
> be. Is it sent from the device, or sent to the device? I've never had one
> sent from the device in any case that I know of, and I'm not sure what the
> Vendor_Defined (page 0x00ff) value (usage 0x00c0) is for either, it seems
> to be zero.
>
> What I know does happen is that a report with id=48 containing a single
> byte with value=0x01 is sent two or three times just before the battery
> gives out. That also happens with an older Apple keyboard except that the
> descriptor does not contain any Vendor or Feature items. I did capture the
> report once but I don't have it now. (I think it was an input report)
>
Features are bidirectional (speaking from USB experience, not
bluetooth). Presumably it has a battery level value between 0% and 100%
on input. You'd expect it to be just an input though (unless you can
charge it by slowly setting it to bigger and bigger values :)
Hard to guess what it does with the output value of the feature. Maybe
it's just in the feature report to get it out of the input report, which
gets sent rather often (I.e. as a power saving measure).
next prev parent reply other threads:[~2009-06-07 21:15 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-07 14:17 Apple Bluetooth devices: Battery level? Bastien Nocera
2009-06-07 14:17 ` Bastien Nocera
2009-06-07 15:52 ` Marcel Holtmann
2009-06-07 15:52 ` Marcel Holtmann
2009-06-07 19:34 ` Iain Hibbert
2009-06-07 21:15 ` David Sainty [this message]
2009-06-08 13:33 ` Jiri Kosina
2009-06-08 13:33 ` Jiri Kosina
2009-06-09 23:22 ` Bastien Nocera
2009-06-10 7:03 ` Marcel Holtmann
2009-06-10 7:03 ` Marcel Holtmann
2009-06-12 13:25 ` Jiri Kosina
2009-06-12 13:27 ` [PATCH 2/2] HID: use debugfs for events/reports dumping Jiri Kosina
2009-06-12 13:27 ` Jiri Kosina
2009-06-12 13:27 ` [PATCH 1/2] HID: use debugfs for report dumping descriptor Jiri Kosina
2009-06-10 7:14 ` Apple Bluetooth devices: Battery level? Dmitriy Geels
2009-06-10 7:14 ` Dmitriy Geels
2009-06-10 7:24 ` Marcel Holtmann
2009-06-10 7:24 ` Marcel Holtmann
2009-06-10 8:25 ` Bastien Nocera
2009-06-10 8:25 ` Bastien Nocera
2009-06-10 8:25 ` Jiri Kosina
2009-06-10 8:25 ` Jiri Kosina
2009-06-10 14:25 ` Bastien Nocera
2009-06-10 14:25 ` Bastien Nocera
2009-06-10 14:06 ` Bastien Nocera
2009-06-10 14:06 ` Bastien Nocera
2009-06-10 18:19 ` Iain Hibbert
2009-06-10 18:19 ` Iain Hibbert
2009-06-12 13:31 ` Jiri Kosina
2009-06-12 13:31 ` Jiri Kosina
2009-06-13 13:16 ` Iain Hibbert
2009-06-13 13:16 ` Iain Hibbert
2009-06-16 9:59 ` Jiri Kosina
2009-06-16 9:59 ` Jiri Kosina
2009-06-16 13:37 ` Marcel Holtmann
2010-02-12 15:41 ` Bastien Nocera
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A2C2DFE.6090607@dtsp.co.nz \
--to=david.sainty@dtsp.co.nz \
--cc=hadess@hadess.net \
--cc=linux-bluetooth@vger.kernel.org \
--cc=plunky@rya-online.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.