Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp167344pxu; Tue, 1 Dec 2020 08:27:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvX7K+scMFNJcS8Dlpy/bAImh1+HvLy4cOulXIPI+8KSFhBXge2n4xb9S5UKnVL37WYbPE X-Received: by 2002:a17:906:259a:: with SMTP id m26mr3653868ejb.399.1606840070636; Tue, 01 Dec 2020 08:27:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606840070; cv=none; d=google.com; s=arc-20160816; b=ixz5Mjsq9+Vi+ROOj8eZ39GN6Go350PCPEjS6uRuMOfHOcWKeo0N1o/d2dXyLcucYy 5cy5Go1UvM5KVsqVQBuzyaJ6JMWqX4EgAy4Dbo8K3nXQjTmQvjeVfim83SAooT+acm8T PQzHa1XUApBcs51aDzmdxdlYwr3+j3dXWw6l6KmBbdbyvz/lG62w7IdwwBRBYwQUZb0l dqIewHzXIOyq19l3opbzXDy8ENJRkLIwn3rf1l0g8Srhhp6zV3PIZ6KvnYmuUmZnP9cE y7Q+UAFKn6HuLnSWjA7DkQ5jkqlxB++sRW3VPlLRMRGKJo+uT7QYP1zHfklougrAA3l3 JALA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=rildGLP50ctEBDjGWFkDtPbIFnP5GQ/jB6nNZoUYYKw=; b=d9nMs5pQKzTQmbqjIEbbl2eTk0sQ56PWmzI1rNmpe9ZOOGqwQsz4rjyYMBmBVoynSp ROpszyZPOZj+wO4NJDeiXN1MrJfiQ86zGAsatyZV6rcgfLStClOxQwXT9HIg7aihV36A y/EKRaslvD5l6OjmzS/Aa8B2eHLzTZFLTmH3tBwGkj9nd7YE3rpCxsVvlRXRSS3Zwf// vGpCLy0ELTB+lDjuw7lQI6+QJNKVoK24OXAvLhdksCbsFzsQBJlsmayhedD23endFRxJ y1QTBfLHpXoKXi3XAPrPzP6qH62J7qX2kMFundDqhT5zNTm8985qAAUQMc9LaU2g7nc/ qK4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l12si256854ejx.101.2020.12.01.08.27.11; Tue, 01 Dec 2020 08:27:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725985AbgLAQ0E (ORCPT + 99 others); Tue, 1 Dec 2020 11:26:04 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:57179 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725979AbgLAQ0D (ORCPT ); Tue, 1 Dec 2020 11:26:03 -0500 X-Originating-IP: 82.255.60.242 Received: from [192.168.0.28] (lns-bzn-39-82-255-60-242.adsl.proxad.net [82.255.60.242]) (Authenticated sender: hadess@hadess.net) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 52CC140004; Tue, 1 Dec 2020 16:25:21 +0000 (UTC) Message-ID: Subject: Re: [PATCH BlueZ v5 4/7] doc: Add Battery Provider API doc From: Bastien Nocera To: Sonny Sasaka , linux-bluetooth@vger.kernel.org Cc: Miao-chen Chou Date: Tue, 01 Dec 2020 17:25:20 +0100 In-Reply-To: <20201130215602.386545-4-sonnysasaka@chromium.org> References: <20201130215602.386545-1-sonnysasaka@chromium.org> <20201130215602.386545-4-sonnysasaka@chromium.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.1 (3.38.1-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Mon, 2020-11-30 at 13:55 -0800, Sonny Sasaka wrote: > This patch add the documentation of the Battery Provider which lets > external clients feed battery information to BlueZ if they are able > to > decode battery reporting via any profile. BlueZ UI clients can then > use > the org.bluez.Battery1 API as a single source of battery information > coming from many different profiles. > > Reviewed-by: Miao-chen Chou > > --- >  doc/battery-api.txt | 55 > +++++++++++++++++++++++++++++++++++++++++++++ >  1 file changed, 55 insertions(+) > > diff --git a/doc/battery-api.txt b/doc/battery-api.txt > index dc7dbeda2..9a6b4fd39 100644 > --- a/doc/battery-api.txt > +++ b/doc/battery-api.txt > @@ -12,3 +12,58 @@ Object path  [variable > prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX >  Properties     byte Percentage [readonly] >   >                         The percentage of battery left as an unsigned > 8-bit integer. > + > +               string Source [readonly, optional, experimental] > + > +                       Describes where the battery information comes > from > +                       This property is informational only and may > be useful > +                       for debugging purposes. > +                       Providers from BatteryProvider1 may make use > of this > +                       property to indicate where the battery report > comes from > +                       (e.g. "HFP 1.7", "HID", or the profile UUID). > + > + > +Battery Provider Manager hierarchy > +================================== > +A battery provider starts by registering itself as a battery > provider with the > +RegisterBatteryProvider method passing an object path as the > provider ID. Then, > +it can start exposing org.bluez.BatteryProvider1 objects having the > path > +starting with the given provider ID. It can also remove objects at > any time. > +The objects and their properties exposed by battery providers will > be reflected > +on org.bluez.Battery1 interface. > + > +BlueZ will stop monitoring these exposed and removed objects after > +UnregisterBatteryProvider is called for that provider ID. > + > +Service                org.bluez > +Interface      org.bluez.BatteryProviderManager1 [experimental] > +Object path    /org/bluez/{hci0,hci1,...} > + > +Methods                void RegisterBatteryProvider(object provider) > + > +                       This registers a battery provider. A > registered > +                       battery provider can then expose objects with > +                       org.bluez.BatteryProvider1 interface > described below. > + > +               void UnregisterBatteryProvider(object provider) > + > +                       This unregisters a battery provider. After > +                       unregistration, the BatteryProvider1 objects > provided > +                       by this client are ignored by BlueZ. > + > + > +Battery Provider hierarchy > +========================== > + > +Service                 > +Interface      org.bluez.BatteryProvider1 [experimental] > +Object path    {provider_root}/{unique battery object path} > + > +Properties     Objects provided on this interface contain the same properties > +               as org.bluez.Battery1 interface. Additionally, this interface > +               needs to have the Device property indicating the object path > +               of the device this battery provides. "this interface needs to have a Device property indicating the object path this battery information pertains to." or "this interface needs to have a Device property indicating the object path the battery information is provided for." > + > +               object Device [readonly] > + > +                       The object path of the device that has this > battery.