From: Johan Hedberg <johan.hedberg@gmail.com>
To: Chen Ganir <chen.ganir@ti.com>
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
linux-bluetooth@vger.kernel.org, marcel@holtmann.org
Subject: Re: [PATCH v4 01/10] Battery: Add Battery Service Gatt Client
Date: Mon, 27 Aug 2012 18:04:12 -0700 [thread overview]
Message-ID: <20120828010412.GA10928@x220.sheraton.com> (raw)
In-Reply-To: <5039CA72.6090906@ti.com>
Hi Chen,
On Sun, Aug 26, 2012, Chen Ganir wrote:
> So what do you suggest here ? Calculating an average ? How shoudl it
> be done ? If 2 batteries are available, first is 100% and the second
> is 50%, we should simply set the value as 75%? I'm not so sure that we
> should make such decisions for the end user.
>
> >Another thing that worth adding is that there are other profiles that
> >do support battery status such as HFP and AVRCP, so I think this
> >should be made generic enough so other sources could be supported.
>
> The internal device API uses the device_add_battery(...) and
> device_remove_battery(...) to allow adding/removing batteries to the
> device battery list, but it is the responsibility of the profile to
> register a D-Bus interface, and update.
>
> I could redesign this, to add a generic battery API, which will
> expose a new API, such as battery_add(battery_struct* batt),
> battery_remove(battery_struct* batt) and
> battery_update(battery_struct* batt) which will allow a more generic
> approach. This Battery module will be responsible for
> registering/unregistering the D-Bus API, and profiles which need to
> use it will simply use the exposed API to add/remove/update. The
> batt_structure will also include some callback functions to be
> called when a value is queried for example, or if a device is
> removed. The LE Battery plugin will use the GATT to
> read/write/receive notification, and use the Generic Battery
> interface to interface with the external world. What do you think
> about it ?
I had a brief chat with Marcel about this and the following were the
main conclusions:
1. It'd be nice to have support for this added to UPower so that it can
enumerate Bluetooth batteries.
2. The easiest way to do 1. would be to have this one D-Bus object per
battery.
3. Use uint16 instead of byte to keep our D-BUs API consistent wrt.
unsigned integers (byte is signed).
4. No Adapter property or interface needed once we've merged the object
manager patches.
5. (as you proposed) we'll probably want/need a src/device.c API for
device drivers to register batteries. Other profiles supporting battery
info (AVRCP, HFP, etc) could use the same API.
Johan
next prev parent reply other threads:[~2012-08-28 1:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-16 9:34 [PATCH v4 0/10] Add GATT Client Battery Service chen.ganir
2012-08-16 9:34 ` [PATCH v4 01/10] Battery: Add Battery Service Gatt Client chen.ganir
2012-08-16 11:39 ` Johan Hedberg
2012-08-16 12:14 ` Chen Ganir
2012-08-16 12:44 ` Johan Hedberg
2012-08-16 12:55 ` Chen Ganir
2012-08-16 19:24 ` Johan Hedberg
2012-08-20 13:03 ` Luiz Augusto von Dentz
2012-08-26 7:04 ` Chen Ganir
2012-08-28 1:04 ` Johan Hedberg [this message]
2012-08-16 9:34 ` [PATCH v4 02/10] Battery: Add Battery Service plugin skeleton chen.ganir
2012-08-16 9:34 ` [PATCH v4 03/10] Battery: Add connection logic chen.ganir
2012-08-16 9:34 ` [PATCH v4 04/10] Battery: Discover Characteristic Descriptors chen.ganir
2012-08-16 9:34 ` [PATCH v4 05/10] Battery: Get Battery ID chen.ganir
2012-08-16 9:34 ` [PATCH v4 06/10] Battery: Add Battery list to btd_device chen.ganir
2012-08-16 9:35 ` [PATCH v4 07/10] Battery: Read Battery level characteristic chen.ganir
2012-08-16 9:35 ` [PATCH v4 08/10] Battery: Add Battery D-BUS API chen.ganir
2012-08-16 9:35 ` [PATCH v4 09/10] Battery: Add support for notifications chen.ganir
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=20120828010412.GA10928@x220.sheraton.com \
--to=johan.hedberg@gmail.com \
--cc=chen.ganir@ti.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).