Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4426788pxb; Tue, 10 Nov 2020 16:39:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyg0Qzw6bGy1Fn4Ti+Ro7v1t/XjiV8zzsK9LiF1Uas6BWT8Kxwj0mZrAJw708tKBxQxND6J X-Received: by 2002:a17:906:1f53:: with SMTP id d19mr22358389ejk.255.1605055196949; Tue, 10 Nov 2020 16:39:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605055196; cv=none; d=google.com; s=arc-20160816; b=nq7BwJPsElVgFbd8fkRHCc0194Wcz+Tn0WATvWgMWxmDeDl96WNeIWajhWpnCLh3o4 f4IV1aQ8rN4hg3ZBnEoK3ZV89qekWhkxnmAC5sgsuq/jUbxvbgglIEk62jO2UInAtw05 hZhnIARsMuuF4AY1/UQ1byRNAMO3qT2QLAM8qR9el9wce6frMyi1upSWc1HID7Es2P4C tJsKT0T4x3YMCZFV2IeiYR198F0Cf0oK/VWp5Dr+zdX7yZocXRvaSuOE5KSlPwkAbyzW u3yhxp8VV7P8EHzIJtSkYXIPtGvTDJVRIxsIyyFgFlt1wbPrMgpmvTAqz1TrIZS/Ru5b 5Bow== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dQ+EnXZ2kdnBZmC8x3MiuHzZ0854bTxxkZnBN1oy2g0=; b=oh96xOzDcIUuQGWFkUlu+s1swZwdVP6Upzrg/vhBEv3jBVD7QEKzfxuzGnoRVy1YdV 2XQj8uuad52+Cw2RQYEiIMN3Mwq90dPxJfuKPugD9IbLlKoUqI3tXkaWyrZVtvQx9Sql QJpM/doR4KjFTE+nZ7JrZDcdEtyo9lqdbKWoewvJrStT0mzWoi+OplgwT0ZgOuMOTRzL LWPRT+iY1LE1uDwkxTYPk9EGg7k2BWimD+CSxgCEz1yweHqlm1L1ZMpTrVtGRYps67nz NGNkVL4balgtGnZZaAlKmru61Ies9vQ/dfbl3MqNnxhwY8K5469E4dZ1Fkd+32XiozWQ mbWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ByRkWcJ2; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr12si173638ejc.562.2020.11.10.16.39.22; Tue, 10 Nov 2020 16:39:56 -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=@chromium.org header.s=google header.b=ByRkWcJ2; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731805AbgKKAhs (ORCPT + 99 others); Tue, 10 Nov 2020 19:37:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732209AbgKKAhr (ORCPT ); Tue, 10 Nov 2020 19:37:47 -0500 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB3B1C0613D1 for ; Tue, 10 Nov 2020 16:37:45 -0800 (PST) Received: by mail-pg1-x52e.google.com with SMTP id m13so212500pgl.7 for ; Tue, 10 Nov 2020 16:37:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dQ+EnXZ2kdnBZmC8x3MiuHzZ0854bTxxkZnBN1oy2g0=; b=ByRkWcJ2M6mnumiHHtsZPh/BM9jQIfAEeJ7uU8FNajgdBiiq248LzYrpiMkUoOyO3i v0D0VJUMCBhUtFdm7aQft/8ncC8IQN0D4QgwpXnSLy5ylRs2Rwxu3goAdifR3SQd74Aq 9b+dfUaY34vnnhTVqFee9nnIbgISREhXFz80U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dQ+EnXZ2kdnBZmC8x3MiuHzZ0854bTxxkZnBN1oy2g0=; b=Qu5LOez6qOt+HP2eu9qaJeshhV8aitRuhytIRL7Y/VaNLpqklJzDC3uA7QAhXzDr75 X5GFJuLEVGMdk18+Y0IlzLRbmDAn0Ggq3D8pA8N8uPRNrLNoPw37AxcJEWyQ0Ke9xEfK pHcjiTvVh3fOE83uPc1omtqwdTKnAiJ0/4hblTaUQmVH9TsXRXn2IfmGlQqLVyI4jTkP AfG/rtJKpZOYPV0MhxmhbtQzw8gOAylZ2mWUontmcKUjAQJ/ZflB7u3DPVesMVqxT3Ou ua7LMJi9gKVHX7ow/eNlJLhe3M17SmB1jpjz87bv6xPDdFZrMBImxmoDEwoyhPTjtHoB klOQ== X-Gm-Message-State: AOAM530SycQXSQluwakhnoltDR3Cn5cIkQIa/7tXxyehxrnd9PJy4pB8 Z7bqR7yKsf/2vY0ixpKuWOTImCQtmONxdA== X-Received: by 2002:a17:90a:4749:: with SMTP id y9mr896541pjg.229.1605055065045; Tue, 10 Nov 2020 16:37:45 -0800 (PST) Received: from sonnysasaka-chrome.mtv.corp.google.com ([2620:15c:202:201:4a0f:cfff:fe66:e60c]) by smtp.gmail.com with ESMTPSA id b16sm180655pju.16.2020.11.10.16.37.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2020 16:37:44 -0800 (PST) From: Sonny Sasaka To: linux-bluetooth@vger.kernel.org Cc: Sonny Sasaka , Miao-chen Chou Subject: [PATCH BlueZ 4/7] doc: Add Battery Provider API doc Date: Tue, 10 Nov 2020 16:37:17 -0800 Message-Id: <20201111003720.1727-5-sonnysasaka@chromium.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201111003720.1727-1-sonnysasaka@chromium.org> References: <20201111003720.1727-1-sonnysasaka@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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..058bf0c6e 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 + (e.g. "HFP 1.7", "HID"). + This property is informational only and may be useful + for debugging purposes. + + +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. +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}/org/bluez/{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] + + Describes where the battery information comes from + (e.g. "HFP 1.7", "HID"). + This property is informational only and may be useful + for debugging purposes. The content of this property is + a free string, but it is recommended to include the + profile name and version to be useful. -- 2.26.2