Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2052437pxu; Tue, 24 Nov 2020 15:59:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuh/JvfIVbqmmT9qP8sVhMnjmw5gwZAQIfwq1QHXECl4I1B+FwyCxMGA+HUJaZKksMghQH X-Received: by 2002:a17:906:86c7:: with SMTP id j7mr810673ejy.301.1606262341059; Tue, 24 Nov 2020 15:59:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606262341; cv=none; d=google.com; s=arc-20160816; b=XhA8DMYXiKC8Y6KKxVhiCpdc5zZNfUK73pOqDr+E6OSIJaM6Qi8z0t+iaf7LyYPIVI 6vXX+ThcwEhmkThl+/deMHlXvWqOE/bEJtSRlQSs6M1Y3EHX0NsC0W3s5kd/dQHgyvwm S6IVy+Tsa9Nm+9mRb9EhBxx+pqux1UQ9T+BlspgJ3pK6BItH7/XjRDuXS2yZ1Opy9kwG 5XwXMjrX/2XdayOolIR694WM3nZJc1Gv84obDU6XBwAhD9L0jr9qCV/pyofYy4+fF90q JG2EerpU77uBsj5zu6AZSy1zIEaRF31Yaf6DT9KEHKvk9E4uFDQhP8cBBaUxK9YP68xp DC4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=aum/X9Od4wA35Sx6OJZNb0T9DuxiNcfT+bG/Xc9nyZY=; b=vh6bpVZ7gttDwBzdpQHXuGMDSMeEnX1AemldkqQt5HM5+diqx1++RXnJCoCZoHQ6pz tPojk6YZLgfaD2WVm14FMtz77GWGhf+VOJX3Uaoblw/HINgmHwLCVNjJCxb6B3ngRZq9 WktzCFORDc6NeYh7KU/ti1QgUnhkLXRhl9UEsAXnM2/3XmMEAbrq8N2ZW7s4vGVZJLdV nZM5zLyBnKsNgz0GFP4O2xo41QKqSpXz25+42Zknnfsb9PyMgu+XONM9fI/EPri3GJ37 IaLTEtPWa0dtjI+kDH8kzzRDoPM2itMOMEdUGYWcJGXQV/GJrmJE5CjEy2Zbf9JWNr/o Y5kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bpMpN+Eb; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id wr19si264318ejb.218.2020.11.24.15.58.37; Tue, 24 Nov 2020 15:59:01 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bpMpN+Eb; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731335AbgKXVVX (ORCPT + 99 others); Tue, 24 Nov 2020 16:21:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731133AbgKXVVW (ORCPT ); Tue, 24 Nov 2020 16:21:22 -0500 Received: from mail-oi1-x244.google.com (mail-oi1-x244.google.com [IPv6:2607:f8b0:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6020BC0613D6 for ; Tue, 24 Nov 2020 13:21:22 -0800 (PST) Received: by mail-oi1-x244.google.com with SMTP id s18so312679oih.1 for ; Tue, 24 Nov 2020 13:21:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aum/X9Od4wA35Sx6OJZNb0T9DuxiNcfT+bG/Xc9nyZY=; b=bpMpN+Eb5Pmk+ychZYLJfJ65P/YsY91xcA5N5xCODMeI7vTAhhWcGIbOTouRKVLjml o9VuSFulNiYCgYCrNvrXSgBvGcOLuIdbYEiCvFHF8aDe6//wt3N0J5fbLkG/DcqD0euV oYsC5dl7WR9YcMDueiNk7yYqQhohJCXcfUCBBlVvUfup2vMJCLcrGUB8jyEVwkrsXO/i zirCDAp78u8ygLIhnEDHHd85jMjSe+5Zbnnjo32GGd4kO5zHwlKs+U2d/DONeJcPpDgY wBBVLMvCcBgO5UEBz3bmhRgB0B31+WvXkT+rNQ3hJHC20Md/KEotPOALKZQtE2/BqBi9 KvuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aum/X9Od4wA35Sx6OJZNb0T9DuxiNcfT+bG/Xc9nyZY=; b=WzGBbj5gYh0wBM6WnLHliz9KdbbCZzR4FxkDCAyEWpf76srmlASHCWxrStBOk9z8Dg kkOgBh+FPbhH48CyVYk8H6NtRP4NAC5MIeWQ4dQ5BsLoC80fMTVczN8+MC9eH6JwG/5f 8v5zK4gfVeaZ/xXL+MPCr4RJ9w5zM3LtGQTBhcS9X3Ax774O0EoB5sY27d61PIBmN9N3 64WcRk921szRT3Z33dsdz4M1S+8mBBMeJxv4bUjAvAfUqIZ9ZRIU9T/wf8O5imOOGEqP eL684TQoaqrusiePgMrrki9NPBdCOtYShyfTIi9bmBMdHuytb1ueC2yvk8zh8NrdjYsJ TdCA== X-Gm-Message-State: AOAM532RL0mYPxBxZTBFxtd/i7X6/vRjXIBQizKrdkb63jL+9PjVIpVc kZHyPQEnYU8+PXpdqiGRO3KaDVGqwTZ1WroaVmM= X-Received: by 2002:aca:cc08:: with SMTP id c8mr99044oig.161.1606252881694; Tue, 24 Nov 2020 13:21:21 -0800 (PST) MIME-Version: 1.0 References: <20201120205728.339325-1-sonnysasaka@chromium.org> <20201120205728.339325-4-sonnysasaka@chromium.org> In-Reply-To: <20201120205728.339325-4-sonnysasaka@chromium.org> From: Luiz Augusto von Dentz Date: Tue, 24 Nov 2020 13:21:10 -0800 Message-ID: Subject: Re: [PATCH BlueZ v3 4/7] doc: Add Battery Provider API doc To: Sonny Sasaka Cc: "linux-bluetooth@vger.kernel.org" , Miao-chen Chou Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Sonny, On Fri, Nov 20, 2020 at 1:00 PM 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 > > --- > Changes in v3: > * Remove doc duplication in BatteryProvider1 and mention that it's the > same as Battery1 instead. > * Suggest profile UUID in Source property. > > doc/battery-api.txt | 49 +++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 49 insertions(+) > > diff --git a/doc/battery-api.txt b/doc/battery-api.txt > index dc7dbeda2..b5c9a7be1 100644 > --- a/doc/battery-api.txt > +++ b/doc/battery-api.txt > @@ -12,3 +12,52 @@ 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). We might need to remove the version number here since there is no equivalent on UUID, in fact friendly names may be a bad idea after all since for new profiles we may not have a friendly name to do the translation and since this is property that would be hard to notify the provider that we don't understand what is the Source while UUIDs, if well formatted, should not have this problem so Id just get rid of the use of friendly names altogether and expect the Source to be a 128bits UUID in string format. > + > + > +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. We should probably mention this expects an object implementing ObjectManaged in order to list the Battery1 provider. > + 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}/org/bluez/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX If this is on the client the object path does not necessarily need to follow our object hierarchy. > + > +Properties Objects provided on this interface contain the same properties > + as org.bluez.Battery1 interface. > -- > 2.26.2 -- Luiz Augusto von Dentz