Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5383134pxb; Sun, 13 Feb 2022 19:22:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwrfguUbFgBAPaJ0MSsduo9v8ow1vcx74gyUL24ZdhS6xgsGe++M1mTJrga4e1KwQ3C8rmZ X-Received: by 2002:a17:902:8688:: with SMTP id g8mr5420412plo.142.1644808926433; Sun, 13 Feb 2022 19:22:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644808926; cv=none; d=google.com; s=arc-20160816; b=MYvAQoyUt/fr5/nR3gcBz3+SnQU7PksrE64JrJbZOf2U+N+VIF5PVpWIzTCSv7zmU2 P7P8U9DhXguNk27i99q8Fi7p17A7rKwyRk0yVS6NTRCstcLU8+lAVzIwH3rJTsc6/IGq trXrL3qwqQFs9APZwIXbvhR05zY0clkRbFoIhN2oG4JEtp9wfPrqRTHy6To8K1VKlyuY BI4V61MGLkUa2c19QUGt/7G0UEJQUpL1egIlwKw9tRm2IpJscr+eeOlaFRy99awvWTaT CvzLkVavrpoVZBqfZ9LBTeCwkD55HL5ze4X4L2Xcgu6iTm+e5czRynKggKvLToS3dJ+g T+gw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=qDBGvFT6GeSRvbn8Hj0+9EC7BV/VDaZZ9h/H5UXObh0=; b=qrjGd6WbVTBh+Sv/rlZt6OnoSW+rltk/5xapXvVei1kU8I5DhmwJUez+AUiZeF9iOh 5XpcUw2cEOj/hqN1vFVEWeBFkrfVrCKFzf+jyZXS6pf5G/x0duDKCL/0yk2P/iKYhtUM S6QdmPf0BHhvWzmfue6KhzCOIx+7Fs4qbWblfAkAf7UOOXuLl7zkHxanKhXUpv3OiS4y 3EnO89lywB58/4pi+LT4ZlGTMQDmELz75bsWm6t9FH7vbDAqYS8Tij/b1dL66PFnpUKo AnxBR6hkudFY09AUc38V+v81SvauAuougrwnOwRPmVa/56btfeX8aSFmFccAHvRTNaHE C71Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OwsKCw+a; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h65si28332691pgc.542.2022.02.13.19.21.41; Sun, 13 Feb 2022 19:22:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OwsKCw+a; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232749AbiBLIsa (ORCPT + 99 others); Sat, 12 Feb 2022 03:48:30 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:56534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229726AbiBLIs3 (ORCPT ); Sat, 12 Feb 2022 03:48:29 -0500 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 005A626553 for ; Sat, 12 Feb 2022 00:48:26 -0800 (PST) Received: by mail-ej1-x630.google.com with SMTP id a8so27296588ejc.8 for ; Sat, 12 Feb 2022 00:48:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qDBGvFT6GeSRvbn8Hj0+9EC7BV/VDaZZ9h/H5UXObh0=; b=OwsKCw+aJWH8IGnx/uY05wWXJML62TFWLuPmKCJg2O87RKwjzEFHBNsMSSjSY3G8Rk kh+KMW4FESYY9oD3XYV8xwoagFTR3e4THI58tl3m5HM6S9eauieUkqG6NI5TesFgFtRP Wx1bBh3Gt3OL8crSv7Ow2wK8TnU/mHu/+SWIKECKKBSsn3B42r6XvI5hAw2liGNAjoCv IpIa8jmXMujjVwUghp/ucMYSuDPuANeM+NqnUo5RZQwKit+O8uzu/YNEd2MN4vOfmkZX V+/nw2A4svTh2JMbh4Fh3XykkvBww8P7DIWrrwbXCD/O63dPbBkEYEg0yVIu32cIBYOJ 9w5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qDBGvFT6GeSRvbn8Hj0+9EC7BV/VDaZZ9h/H5UXObh0=; b=ulJnSMtPf0WlwgdWPERfrd/ohPEri1JmDivLSRPOw2HI7IFnRBUve5YB1wAo/wYrLl 40oobJrTcyzYOft2pY1bZvEk8VEFJMrXGNO4UOfKg9jb6Bjte7Rm0X2SNwN/2xxkN1UG H/FMmRJCUDBSSx874khP1Wsemq2LBF+NP+64Nn0yZjNAf4c0tW40u5IyiC2ymMaTb5wZ 6uFqskAwOF8/wTKdKyQ+9vxaYGJ1uPRDm+w9ySkqD4DjHjLuXvxrYduIS2YQK/5vYHXc e/QHhP87GshA9FoPtB9dzINXwen4vIBpzFCNNEhmXIRO+T+UxOYPIhyqIIFjCPHF8qox AjQw== X-Gm-Message-State: AOAM530oRu9DCH3S9rMr3xdHv01M9fPrfIjhAXdRLWpehzsnB3ymQP51 1N0YNmqaKGxuZnOxJVS+J2jOT2S7Y3Y= X-Received: by 2002:a17:906:dc90:: with SMTP id cs16mr4319505ejc.295.1644655705211; Sat, 12 Feb 2022 00:48:25 -0800 (PST) Received: from localhost.localdomain (ip-89-103-68-137.net.upcbroadband.cz. [89.103.68.137]) by smtp.gmail.com with ESMTPSA id h6sm2025854edb.5.2022.02.12.00.48.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Feb 2022 00:48:24 -0800 (PST) From: Daniel Trnka To: linux-bluetooth@vger.kernel.org Cc: Daniel Trnka Subject: [PATCH BlueZ] adapter: battery provider for non-LE controllers Date: Sat, 12 Feb 2022 09:45:42 +0100 Message-Id: <20220212084541.221196-1-daniel.trnka@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Enable battery provider dbus interface BatteryProviderManager1 for non-LE controllers, so external clients like pipewire can provide battery information for bluetooth headsets on non-LE controllers. --- src/adapter.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/adapter.c b/src/adapter.c index eef50f67a..2071cf8db 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -8976,6 +8976,11 @@ static int adapter_register(struct btd_adapter *adapter) agent_unref(agent); } + if (g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL) { + adapter->battery_provider_manager = + btd_battery_provider_manager_create(adapter); + } + /* Don't start GATT database and advertising managers on * non-LE controllers. */ @@ -9010,11 +9015,6 @@ static int adapter_register(struct btd_adapter *adapter) } } - if (g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL) { - adapter->battery_provider_manager = - btd_battery_provider_manager_create(adapter); - } - db = btd_gatt_database_get_db(adapter->database); adapter->db_id = gatt_db_register(db, services_modified, services_modified, -- 2.35.1