Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp735173pxb; Thu, 19 Nov 2020 12:27:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWCG6m23t4U/+FKp2VZK0To94fSn0qo1eHVmKQ/ZQ2mqabxP1ay9lNQY5nMRi4p78JnLIG X-Received: by 2002:a05:6402:154b:: with SMTP id p11mr32869512edx.217.1605817626319; Thu, 19 Nov 2020 12:27:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605817626; cv=none; d=google.com; s=arc-20160816; b=p5ZOgTmE1LoCyhuLlStEU2nl2IfPy8HvKV/J3Qn/sEDDCzUneDAqUGS1faf9wHeX4f krAFYDF51NSaHOwqYzHjgyJkIIWSvi4hecOManIQ8H8sZUokxtdASOwapJxz5GD6Q7qP ySKhRS1BaVHlo0HQ+PvrL4ur/SlbK6blImrpKSUOhvFyD3FZU3vGUst9kTmJ4HbDRkRM DF6XwVTAAXxEiWPKnS29Z824i7J/yl2HXD0egPUPwPEJfl9y1uBIs+3+oa079lzF1rFD tsvksh0PMI0eUmGbkXZzHiYP4MTYK03LM+0Vg6nLef6pxhZ4mNTfIDZXfarOdxBLEtO5 rZ7Q== 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=sEq4IzqBnAmx5dpMgp9ZKh8p2ENgVPKp2NO8sDACZG8=; b=RQsRh3txZAAA49DcZteghs8TV6xXXl1041a4cqk59+Q12/8MUZg/qr+vugcniGP/Ye Z6FYRnlurdYWqpK+yQCdGavI+reRx4FEyC/fntoXFA/4l0d70y2IFCbO06fZHjDm0flL Gi2IMbBDfmK1byjMuo6WpqNGwGG5Ohl+EWRmxruHQL5pWFUb+JW5AVfJadwh7DcqNibe tcPLeJiCf1RfcJx2pHkmMyhVhLJFZGPhge+o/QJBZVOFPWJB6p9FUsUaZ/cJ0LYwK0ng 9mNLzdLEGKyffEss4GJlvcISPlnVAFbL/h6iIyV4s0F6SDlEXKK5M30vDTb57PBPZQts n4WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Hm5QjcrR; 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 f13si509299edx.450.2020.11.19.12.26.38; Thu, 19 Nov 2020 12:27:06 -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=Hm5QjcrR; 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 S1727206AbgKSUZ3 (ORCPT + 99 others); Thu, 19 Nov 2020 15:25:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727049AbgKSUZ3 (ORCPT ); Thu, 19 Nov 2020 15:25:29 -0500 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27FB4C0613CF for ; Thu, 19 Nov 2020 12:25:29 -0800 (PST) Received: by mail-ej1-x642.google.com with SMTP id s25so9755321ejy.6 for ; Thu, 19 Nov 2020 12:25:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sEq4IzqBnAmx5dpMgp9ZKh8p2ENgVPKp2NO8sDACZG8=; b=Hm5QjcrRHQNnqdpS9xFHyT5a7BNHaoOjsJjZqdq8Js6e+rj2axPaaTYaivTiwMz2Gg 0uLvD602+YeQqzQUR7R1aY38jkp8Hf+MdF5aQvKGVdAbHSb+XSDNKucwxcvdugFPw4M5 gxBYn3el2FCOrIX8DwU8nyaj5nkKm8bQrSWT4= 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=sEq4IzqBnAmx5dpMgp9ZKh8p2ENgVPKp2NO8sDACZG8=; b=eSFU/FFB2kk0pRLqr7EvL7qR6zGmURRCFcPoZqu6d4/+Rq9AJ8sDIxEvh+A6sZw7Zk L44VQyBmChqt2onb6Mv4pnJh92s5Cs+R1urt0Dkw3Ia0fUH/0/KC7MK1VTktsksmrTmE PbwsX7q1ecXRwZAjo+Ua3xOrzMfUR/PL8y3X8urK3tXtAVlpYHfFJjwhsOSkat4CK1sG +b3l58AKCKagOw+zI6Bvi4lSFLfYeXdnLQ5QQ5eM+hbDrhJicHNrLY0ZcPmRsC3kOzu+ IQYxuBGu36Newgd1RLhd82LylTJwA6lyi6KRp5kcqJeG9ysX78/G3lr+/Fzv9L5asTQi UQeQ== X-Gm-Message-State: AOAM532tP5BzsBTdId7OhVItuVuXtGdJTw0Xg0FqXpLW/YWhyZBnxcFI Le9ZbAfFqYaUMioR5Y6uEH2S7p8ITqpydA== X-Received: by 2002:a17:906:6d8e:: with SMTP id h14mr6789747ejt.522.1605817527140; Thu, 19 Nov 2020 12:25:27 -0800 (PST) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com. [209.85.128.42]) by smtp.gmail.com with ESMTPSA id rp28sm303605ejb.77.2020.11.19.12.25.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Nov 2020 12:25:26 -0800 (PST) Received: by mail-wm1-f42.google.com with SMTP id a3so7879709wmb.5 for ; Thu, 19 Nov 2020 12:25:25 -0800 (PST) X-Received: by 2002:a1c:e4d4:: with SMTP id b203mr6136023wmh.141.1605817525109; Thu, 19 Nov 2020 12:25:25 -0800 (PST) MIME-Version: 1.0 References: <20201111011745.2016-1-sonnysasaka@chromium.org> <20201111011745.2016-7-sonnysasaka@chromium.org> <1273e316b9ec06061a1065c04521ae91ab379af1.camel@hadess.net> In-Reply-To: From: Sonny Sasaka Date: Thu, 19 Nov 2020 12:25:13 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH BlueZ v2 7/7] battery: Implement Battery Provider API To: Bastien Nocera Cc: BlueZ , Miao-chen Chou Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Bastien, On Thu, Nov 19, 2020 at 2:53 AM Bastien Nocera wrote: > > On Tue, 2020-11-17 at 14:22 -0800, Sonny Sasaka wrote: > > Hi Bastien, > > > > More responses below. > > > > On Tue, Nov 17, 2020 at 10:01 AM Bastien Nocera > > wrote: > > > > > > On Tue, 2020-11-17 at 11:51 +0100, Bastien Nocera wrote: > > > > < > > > > didn't review the code in depth, but, having written this > > > > mechanism > > > > for Bluetooth battery reporting, I think that this is the right > > > > way > > > > to > > > > go to allow daemons like pulseaudio to report battery status. > > > > > > It would also be useful to know what external components, or > > > internal > > > plugins you expect to feed this API. > > BlueZ could have internal plugins to read proprietary battery > > reporting, e.g. JBL speakers and Bose QC35. > > But you don't need to go over D-Bus to implement this. Some proprietary protocols may not want to become an internal BlueZ plugin, for example because it is developed closed source. D-Bus API is useful to support these cases. > > > > > > > > > Apparently HSP/HFP, for example, provide more information that what > > > can > > > be expressed with the Battery1 API, whether it is charging or not, > > > or > > > whether a battery level is unknown, etc. > > > > > > So I would say that, even if the current battery API is extended, > > > we > > > need to make sure that the D-Bus API to feed new data is extensible > > > enough to allow new properties, and they don't need to be added > > > separately to org.bluez.BatteryProvider1 or org.bluez.Battery1. > > I proposed the API to start simple, but I believe that it can always > > be extended as we need in the future so I don't think the additional > > features need to be coded now. I documented how this API could evolve > > in the future by extending other features as well in this design > > document that I shared with Luiz and Marcel: > > > > https://docs.google.com/document/d/1OV4sjHLhTzB91D7LyTVT6R0SX2vXwSG1IA3q5yWQWps > > . > > Right. My advice would have been to say "the properties exported by > BatteryProvider1 API match the properties exported by the Battery1 > API", so you don't need to update 2 APIs separately when the API is > extended. I am considering doing this. Let me think it through to make sure we don't stumble on anything in the future if we do it this way. > > > > > > > >