Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3875465pxu; Mon, 30 Nov 2020 12:07:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJyW97libcf9B8D4vt2+tjsYfWrIMeXlPcU1VXR3FAT4mn0Q2YLT90zRmQ2Xr32Ax+25KO5i X-Received: by 2002:aa7:c94b:: with SMTP id h11mr23365874edt.322.1606766869190; Mon, 30 Nov 2020 12:07:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606766869; cv=none; d=google.com; s=arc-20160816; b=ldudqdaNJF8EcDaS1UzQf4iP+XtjPGtLvG7ipv0cP0I4QN6DmbRtyFNEK3Pk+F+01l NCA0jSKXfN64sp44hNdgdq2CAhi1ZLftL3Kv/WtmV5Rrh7ljFB2ZmZ3GSz1HiIYw9q8e Nj0bsZfHBBtZsTV7SBh6oKHTuVoSuncHGgo+dDCv0IXK1GHAVwjer1sl1Z2UON3N6W0Z UfxTJ6dfjTOFFPRx6GCkQZD1yd4ZQvbryOPg7ZGf+mRaUb/We6F/rpGI3RH9IBau0RsN uD+UsNBdc22oeWXf9uGZnjKUkQkovNftU/BPlXaxHkZWNIeGZEmAqMM9Xx3awc7CgGTp BsHA== 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=kh50OcTzrFmgdURg93OTnhuU/F5aplwBjH9orxXDq7k=; b=EFQEG15AOalX6+lcv+0r1UId8zORfhL8D7AFVGXhIuAtCb/pqMiyReWho2Br4XplTU tCcNm5uiP3wcZjPUtlQmWgqNS/1r5mBKwtCGrJVBxS+BljlQxyUNLkkqnR2ec+H8RXrX kqNGKIqg9TOyLo1l8QlPC01fp9L0q6aNh0liXHNGERLhU49vS6kaziOiw6RQGn+/myNz 5bXBDLl8XtBmIRFj6eVX4UomHI26FYblqbEG3RI/ICfoGfcb+IAXh0/qdxG9BkQZen5u PHbY/6rfQ6WknsckuUxn7HOGBRhAInBWY3arWznJ1o7+u+T1X2m6YFoUhWl6+TZhC9sm HeSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZHXrymvG; 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 cb6si7173345ejb.459.2020.11.30.12.07.25; Mon, 30 Nov 2020 12:07:49 -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=ZHXrymvG; 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 S1729876AbgK3UEJ (ORCPT + 99 others); Mon, 30 Nov 2020 15:04:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727685AbgK3UEI (ORCPT ); Mon, 30 Nov 2020 15:04:08 -0500 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A63E8C0617A7 for ; Mon, 30 Nov 2020 12:03:28 -0800 (PST) Received: by mail-pf1-x42a.google.com with SMTP id b10so9722671pfo.4 for ; Mon, 30 Nov 2020 12:03:28 -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=kh50OcTzrFmgdURg93OTnhuU/F5aplwBjH9orxXDq7k=; b=ZHXrymvG+HCPPaUA8Jhpy/HpmMT+jmJwkdmRokoKjuNFPrTEnbdmu0msgOTbViU7RB tQcV1VUKUGiibzv3Vbi556w+G9MIOfqkGt+aqxA5JRhMZqc/NhHKkpC6ZeMgsFWsS/ui AVTZ0ncsX6ONYI/zZjwGJ/L8xqLnXL/yHZ2is= 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=kh50OcTzrFmgdURg93OTnhuU/F5aplwBjH9orxXDq7k=; b=oi8PHih0niGXernLP5+Uk74/PMTadh594LM5fp8ijIBn4N8x43j579k4OF9YkdYX1P n98z26GDcX0Cu8USDbu0JXdaH1S4BmdIeXrfHp56lUkbojXCvsCod34mRqLBufrvgP6J IbgTYkxoYWkQCQuluGEgS0UlL9Ird/ecw662lWVDa0+piYg2OkPvN2hBvGWn72ADxOcN j04ecRxDMOmvLcigdFp8R39rP2omceGSeRi6G1dLw/mO3tdN9mNzJYadn8p8LA5zhtjX HRXpOCyt0ckuqhNbzjXawkO3ZXAFMy+kAb7FLJQ0DdC930PI7AJIRtNykCn+p7P7AMyC Uzhw== X-Gm-Message-State: AOAM5301ByOoI2oleeRiqC0CGwHMO9SH2wsrMzWqsW/eLXciUVqX7/pa ujIlo9byb3n9x/HPP3OA+mYEecEK4SAjYw== X-Received: by 2002:aa7:8254:0:b029:19a:c192:5ddc with SMTP id e20-20020aa782540000b029019ac1925ddcmr13114659pfn.26.1606766607300; Mon, 30 Nov 2020 12:03:27 -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 y24sm17117184pfn.176.2020.11.30.12.03.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Nov 2020 12:03:26 -0800 (PST) From: Sonny Sasaka To: linux-bluetooth@vger.kernel.org Cc: Sonny Sasaka , Miao-chen Chou Subject: [PATCH BlueZ v4 4/7] doc: Add Battery Provider API doc Date: Mon, 30 Nov 2020 12:03:04 -0800 Message-Id: <20201130200307.386410-4-sonnysasaka@chromium.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201130200307.386410-1-sonnysasaka@chromium.org> References: <20201130200307.386410-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..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. + + object Device [readonly] + + The object path of the device that has this battery. -- 2.26.2