From patchwork Fri Sep 18 22:13:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Winkler X-Patchwork-Id: 252679 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63B03C43463 for ; Fri, 18 Sep 2020 22:14:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2210821734 for ; Fri, 18 Sep 2020 22:14:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="UjS+4Zps" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726201AbgIRWOK (ORCPT ); Fri, 18 Sep 2020 18:14:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726064AbgIRWOK (ORCPT ); Fri, 18 Sep 2020 18:14:10 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC24AC0613CE for ; Fri, 18 Sep 2020 15:14:09 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id k3so7020914ybp.1 for ; Fri, 18 Sep 2020 15:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=bkV98mI6HTRBlveAwJJOx4rOMskQp0RNxjsBtvixoqs=; b=UjS+4Zpss152SNoNBSO32DHFsLojPtyJw3i+GuvleOYCi8hQ9rlM0ItVrh0W+MMFX4 D3YV+Ur+Rum2j6f6pVeJTflJV9uP7BNwJMZ8A/d6coeg0/0TI3HGh7vHtJ6A5fFPNvlO Y1PUWDjYIDflwyEOI9b6YjU6zhFEsas6lS2pYFakM5RD1+dxiPY+lRcvar8YS7xq+P6h BcZaxAdbTqniefdQJQOOQb9aNFW8nNIkzqob6TQBuDmtkaWJoF73eRFR/Neqwx0qQ7uz oP0nwEPkN2v2rqtiyK6uaAk3t3+OZbcO5GIujEHcXwnTANO/bL/aCTLs5GZ15y9I0Uiq FWvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=bkV98mI6HTRBlveAwJJOx4rOMskQp0RNxjsBtvixoqs=; b=oiCuZpR8RKrQhTY29Cmy099mGavG2rbEv9gKw8AheLqxrGXU/dr7U366wDMyNzzT7f GnahM+ht2LnlIEB0PVBxbcwyTeh3X3/a9mfBlkVmbmfKHwes8KoqN9fYO3xL+Zw/USqv /rQFZUBxCSsRb5U8q9ZbMvNckKAdk3xh81qCgty0IJVRMJdxG/q5zho3/NU4jWp0RduV ZtYlvamxJ3sPonK2q1MDQzHK6BWoWLKwfeOkJo1UF6mwXsuVa5hKs1f6LNy5z4Oyz922 9UmRhfzKhUTy/2duxWAnzqsMhj+PiZGYSro4okr3E4hbs6OW8dH2jQMxpWOYGiOhlUag zYMg== X-Gm-Message-State: AOAM532m8QOINr7LphH3/ZC9JKnytTvOsx/wf8XD8ghy3hBy7l4q9hZ1 ahP8cFo+IO/caCnKlRBR5cKDqmFAP8TsFPOQBb7C X-Google-Smtp-Source: ABdhPJyNpbteRCiREnsaR7X6D0/wXYQ3N25hOoH+i+QUENmMweBb9oKlq1/2WVyF/e+oULjZwxv+X9vt7ZMqUH4Vz6/l Sender: "danielwinkler via sendgmr" X-Received: from danielwinkler-linux.mtv.corp.google.com ([2620:15c:202:201:f693:9fff:fef4:4e59]) (user=danielwinkler job=sendgmr) by 2002:a25:6e87:: with SMTP id j129mr35630636ybc.424.1600467248869; Fri, 18 Sep 2020 15:14:08 -0700 (PDT) Date: Fri, 18 Sep 2020 15:13:48 -0700 In-Reply-To: <20200918221357.3436905-1-danielwinkler@google.com> Message-Id: <20200918151041.Bluez.v2.1.Ifaa96e71a871158e5d9d454073b2b6846eae339f@changeid> Mime-Version: 1.0 References: <20200918221357.3436905-1-danielwinkler@google.com> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog Subject: [Bluez PATCH v2 01/10] doc/advertising-api: update API with new interface From: Daniel Winkler To: luiz.von.dentz@intel.com Cc: chromeos-bluetooth-upstreaming@chromium.org, linux-bluetooth@vger.kernel.org, Daniel Winkler , Sonny Sasaka , Alain Michaud Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This updates the advertising documentation to include the following features: LE Advertising Manager: - New SupportedCapabilities property LE Advertisement: - New min/max interval properties - New tx power property Reviewed-by: Sonny Sasaka Reviewed-by: Alain Michaud --- Changes in v2: None doc/advertising-api.txt | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/doc/advertising-api.txt b/doc/advertising-api.txt index b0565eab2..3215a52f7 100644 --- a/doc/advertising-api.txt +++ b/doc/advertising-api.txt @@ -138,6 +138,33 @@ Properties string Type "2M" "Coded" + uint32 MinInterval + + Minimum advertising interval to be used by the + advertising set, in .625 millisecond slots. + Time = N * .625 ms, where N has range + [0x000020, 0xFFFFFF]. If the provided MinInterval is + larger than the provided MaxInterval, the registration + will return failure. + + uint32 MaxInterval + + Maximum advertising interval to be used by the + advertising set, in .625 millisecond slots. + Time = N * .625 ms, where N has range + [0x000020, 0xFFFFFF]. If the provided MinInterval is + larger than the provided MaxInterval, the registration + will return failure. + + int16 TxPower + + Requested transmission power of this advertising set. + The provided value is used only if the "CanSetTxPower" + feature is enabled on the Advertising Manager. The + provided value must be in range [-127 to +20], where + units are in dBm. + + LE Advertising Manager hierarchy ================================ @@ -209,3 +236,26 @@ Properties byte ActiveInstances Possible values: "1M" "2M" "Coded" + + dict SupportedCapabilities + + Enumerates Advertising-related controller capabilities + useful to the client. + + Possible Values: + + byte MaxAdvLen + + Max advertising data length + + byte MaxScnRspLen + + Max advertising scan response length + + int16 MinTxPower + + Min advertising tx power (dBm) + + int16 MaxTxPower + + Max advertising tx power (dBm) From patchwork Fri Sep 18 22:13:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Winkler X-Patchwork-Id: 252678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0520DC43463 for ; Fri, 18 Sep 2020 22:14:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B401B21734 for ; Fri, 18 Sep 2020 22:14:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="TXQEXe1k" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726249AbgIRWOO (ORCPT ); Fri, 18 Sep 2020 18:14:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726245AbgIRWOO (ORCPT ); Fri, 18 Sep 2020 18:14:14 -0400 Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 166FEC0613CE for ; Fri, 18 Sep 2020 15:14:14 -0700 (PDT) Received: by mail-pj1-x104a.google.com with SMTP id mv5so3603113pjb.5 for ; Fri, 18 Sep 2020 15:14:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=hB0CpivhDfyrDY9Ky1oVzGJab7x3ciX7ZMWxakjiGGU=; b=TXQEXe1kV0LP+DE8LvhEzoe6PveY3xealaHWcfatqc7Z+oFPCdM3W7bHvpxITMkyb6 FVP8GyDdrCIHCm6y9U14hpuPaoxtIFv2j/HzEM9QjDRSt+Bzi8SGibRb4OeX4xFXCt7J fzEryB5WlRl09BFmAndUTGrwdEQrTSQrN/9O5lcelvPrlhOV4PWKZOg7vvrkhlaRJabq jA4OAAVFY74aumHbXbmIyKa/pfVbKuIb6WwdpVHriMxUkCFj8wtpIoKW/7dre3v12zY1 PU8sBhpRvTV5erpQt8xlskINtUHoG5V4XAHNFRqOjaVw4KjYtSxSXC33Ne8DZKUheF8V 2UyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=hB0CpivhDfyrDY9Ky1oVzGJab7x3ciX7ZMWxakjiGGU=; b=n/RT+/tzsyMWYnJCU9BiJVernYFHlQxL/XTxSCcuxnOw5g1vUCjH+C1TAzrs5XzSU2 mf2QQwH8ObinfYka5RHXv8VfEB6HgHOsrRfj0tyXoKWqwMHopnFcW3Zvw3KRtIE/eUh4 oQEwUS/BzK7iYQCCnlYU2bhrgc/S2M/Fpz61n9ygTZht7suCKd4OEGpoqq75yF73E8wV gePLm6zziBGY5b7DvZmIexULAg8cexP6GAlMW483zXWqErtj0ZMnyAt9VeyDcgYEWBlt xDG1vv9nIKkaqAPzgvYDd+os6CW5wdP6q/mabd6up6v+qlMs4ZXHiPVIrpm0jHAfuJwv r7sg== X-Gm-Message-State: AOAM532ZjwWnfBWiWNzPlGz4kD/GRXlqqGFRDmID42FdTc1ErIr9MjWt u0pSWuE6GbFJhK+oDduv6H7JPVgOMZi8l5JdV9pf X-Google-Smtp-Source: ABdhPJwPXMH/JE4kdxOYkSfG85dgz6sxitqLGz1qadcsD2L1zFZprCm6+yhaIOHi4sWb7J7zsg/wSekFHGYz8k/W9MLL Sender: "danielwinkler via sendgmr" X-Received: from danielwinkler-linux.mtv.corp.google.com ([2620:15c:202:201:f693:9fff:fef4:4e59]) (user=danielwinkler job=sendgmr) by 2002:a63:f342:: with SMTP id t2mr28928663pgj.313.1600467253441; Fri, 18 Sep 2020 15:14:13 -0700 (PDT) Date: Fri, 18 Sep 2020 15:13:50 -0700 In-Reply-To: <20200918221357.3436905-1-danielwinkler@google.com> Message-Id: <20200918151041.Bluez.v2.3.I50d9faa25e9da6e71d77c83c7d47a5b135e88799@changeid> Mime-Version: 1.0 References: <20200918221357.3436905-1-danielwinkler@google.com> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog Subject: [Bluez PATCH v2 03/10] advertising: Detect if extended advertising mgmt commands are supported From: Daniel Winkler To: luiz.von.dentz@intel.com Cc: chromeos-bluetooth-upstreaming@chromium.org, linux-bluetooth@vger.kernel.org, Daniel Winkler , Sonny Sasaka , Alain Michaud Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org We need to know if kernel supports the new MGMT interface. To do so, we check the return from adapter's MGMT_OP_READ_COMMANDS call for the new commands. This will later be used to route our requests for new advertisements. The change is tested by manually verifying that the correct MGMT commands are used when the feature is and is not available in kernel. Reviewed-by: Sonny Sasaka Reviewed-by: Alain Michaud --- Changes in v2: - Uses btd_has_kernel_features to detect kernel command support src/adapter.c | 4 ++++ src/adapter.h | 1 + src/advertising.c | 3 +++ 3 files changed, 8 insertions(+) diff --git a/src/adapter.c b/src/adapter.c index b2bd8b3f1..7811122c4 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -9653,6 +9653,10 @@ static void read_commands_complete(uint8_t status, uint16_t length, DBG("kernel supports exp features"); kernel_features |= KERNEL_EXP_FEATURES; break; + case MGMT_OP_ADD_EXT_ADV_PARAMS: + DBG("kernel supports ext adv commands"); + kernel_features |= KERNEL_HAS_EXT_ADV_ADD_CMDS; + break; default: break; } diff --git a/src/adapter.h b/src/adapter.h index b4d872b15..99802e287 100644 --- a/src/adapter.h +++ b/src/adapter.h @@ -246,6 +246,7 @@ enum kernel_features { KERNEL_SET_SYSTEM_CONFIG = 1 << 2, KERNEL_EXP_FEATURES = 1 << 3, KERNEL_HAS_RESUME_EVT = 1 << 4, + KERNEL_HAS_EXT_ADV_ADD_CMDS = 1 << 5, }; bool btd_has_kernel_features(uint32_t feature); diff --git a/src/advertising.c b/src/advertising.c index e5f25948d..ad2eeefb9 100644 --- a/src/advertising.c +++ b/src/advertising.c @@ -57,6 +57,7 @@ struct btd_adv_manager { uint8_t max_ads; uint32_t supported_flags; unsigned int instance_bitmap; + bool extended_add_cmds; }; #define AD_TYPE_BROADCAST 0 @@ -1426,6 +1427,8 @@ static struct btd_adv_manager *manager_create(struct btd_adapter *adapter, manager->mgmt_index = btd_adapter_get_index(adapter); manager->clients = queue_new(); manager->supported_flags = MGMT_ADV_FLAG_LOCAL_NAME; + manager->extended_add_cmds = + btd_has_kernel_features(KERNEL_HAS_EXT_ADV_ADD_CMDS); if (!g_dbus_register_interface(btd_get_dbus_connection(), adapter_get_path(manager->adapter), From patchwork Fri Sep 18 22:13:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Winkler X-Patchwork-Id: 252677 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5D8EC43464 for ; Fri, 18 Sep 2020 22:14:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 892322311C for ; Fri, 18 Sep 2020 22:14:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="oYoSpkGh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726285AbgIRWOT (ORCPT ); Fri, 18 Sep 2020 18:14:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726245AbgIRWOS (ORCPT ); Fri, 18 Sep 2020 18:14:18 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 834AEC0613CE for ; Fri, 18 Sep 2020 15:14:18 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id g189so6894050ybg.9 for ; Fri, 18 Sep 2020 15:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=lYHat5yuNdgK2r35k9Snf3w/9eMRmnd0NP1xrlEbnvo=; b=oYoSpkGhE0TUavlGl2zH9aae4F1lri8CSJUEKwp71c8PDGPDl/t+XrkdBa24bfztmc tc8QfOa2oomXU8qXK7hRl0VBvMlshl8ecL7UOuIc4sRw5MgZe19wXcODs/6gcb8IbuN9 YpJ4Un5XQd6HZdIZgHhHg0RZExxVK/WBlyf2aIs80PPGxxc3FkA8D4xM9F/K8pI+9oBa LL5hanKuq3kRq1g0dTOBn7lSifKJcatFGmr7v72wGYnPKwXCys9rBw69dufKIB9DJWRe UkrJgPRt+ABjCA7PJuDMatT4VK7FxKZNvLG26wf3Ue2tDupzHw3300s/J35qfg7uJHo1 e8Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=lYHat5yuNdgK2r35k9Snf3w/9eMRmnd0NP1xrlEbnvo=; b=Zigpe/2OGDrXVLG8UUJ/QcGwr9r+GXLj2UULf8QN4ktbykdN9YLSBOW5G63zKdWkoW uSFiSFlS+h48YFJ2Int2PnUfRHQppHbNJLDS3b/z1tA0ZPd3+oKaCdx1OYyHA42GpHel e4+4P8cnZthPXJDOM5/FiV+vFZZgtzTrlLOVYR9lpja8Nk2yyNYfeuxhd3KGQ4mvw0p2 KVWNh1To2GDRmjd1AmmYWDq07Kp+udawY730HvopTHoiMoOPV5FJxDpRWKQTdqdlQX2P FFC3n6FdE2fDpxMVGZrTrth6j8TjLxl2gQpsKV5Ww+4ubajBWdQE5HIgrRNcScWUaMdk 57og== X-Gm-Message-State: AOAM5315Bh0zJ/vGvPh1AL7Pi1Ze4imJ45U71egnZ08yrtIKSY7vmS+m THrSsqH41ujAsGcafQl5uK9WoTHtqUvTy7TgmLFL X-Google-Smtp-Source: ABdhPJxii+sQzb+fxsjADPDNPTBUXwumo9s7Jla1s8hwgJvkKfMazNb4Y+QccbDAoIXgef1lpdkUgXY1iXUNN52/Rr/+ Sender: "danielwinkler via sendgmr" X-Received: from danielwinkler-linux.mtv.corp.google.com ([2620:15c:202:201:f693:9fff:fef4:4e59]) (user=danielwinkler job=sendgmr) by 2002:a5b:b07:: with SMTP id z7mr5265825ybp.318.1600467257760; Fri, 18 Sep 2020 15:14:17 -0700 (PDT) Date: Fri, 18 Sep 2020 15:13:52 -0700 In-Reply-To: <20200918221357.3436905-1-danielwinkler@google.com> Message-Id: <20200918151041.Bluez.v2.5.Ia49df7ccded97ceb4ff1d1b0decc49d03d088a84@changeid> Mime-Version: 1.0 References: <20200918221357.3436905-1-danielwinkler@google.com> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog Subject: [Bluez PATCH v2 05/10] advertising: Use new mgmt interface for advertising add From: Daniel Winkler To: luiz.von.dentz@intel.com Cc: chromeos-bluetooth-upstreaming@chromium.org, linux-bluetooth@vger.kernel.org, Daniel Winkler , Sonny Sasaka , Alain Michaud Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patch allows bluetoothd to use the new extended advertising add mgmt interface if it is available. The new interface will be used by default, as it allows the client to set advertising intervals, and tx power if the controller and kernel support extended advertising. Each new registered advertisement will submit two requests to kernel; the first sets the advertising parameters for the advertising instance, and the second sets the advertising data and scan response for the instance. This change has been tested extensively on Hatch (extended advertising) and Kukui (no extended advertising) chromebooks. Manual tests do the following: - Configure advertisement with custom intervals, tx power with valid and invalid values and combinations - Ensure that with valid parameters, they are propagated and set in hci requests. With invalid parameters, ensure that the registration fails. Automatic tests verify 25 advertising usage scenarios involving single and multi-advertising registration, over-registration, parameter validation, etc. These tests don't test new intervals and tx power, but validate that the new MGMT interface does not regress compatibility in these 25 scenarios. Reviewed-by: Sonny Sasaka Reviewed-by: Alain Michaud --- Changes in v2: - Cleaned fail path in add_adv_params_callback lib/mgmt.h | 31 +++++++ src/advertising.c | 216 ++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 232 insertions(+), 15 deletions(-) diff --git a/lib/mgmt.h b/lib/mgmt.h index 46d894ae9..9874be004 100644 --- a/lib/mgmt.h +++ b/lib/mgmt.h @@ -713,6 +713,37 @@ struct mgmt_rp_remove_adv_monitor { uint16_t monitor_handle; } __packed; +#define MGMT_ADV_PARAM_DURATION (1 << 0) +#define MGMT_ADV_PARAM_TIMEOUT (1 << 1) +#define MGMT_ADV_PARAM_INTERVALS (1 << 2) +#define MGMT_ADV_PARAM_TX_POWER (1 << 3) + +#define MGMT_OP_ADD_EXT_ADV_PARAMS 0x0054 +struct mgmt_cp_add_ext_adv_params { + uint8_t instance; + uint32_t flags; + uint16_t params; + uint16_t duration; + uint16_t timeout; + uint32_t min_interval; + uint32_t max_interval; + int8_t tx_power; +} __packed; +struct mgmt_rp_add_ext_adv_params { + uint8_t instance; +} __packed; + +#define MGMT_OP_ADD_EXT_ADV_DATA 0x0055 +struct mgmt_cp_add_ext_adv_data { + uint8_t instance; + uint8_t adv_data_len; + uint8_t scan_rsp_len; + uint8_t data[0]; +} __packed; +struct mgmt_rp_add_ext_adv_data { + uint8_t instance; +} __packed; + #define MGMT_EV_CMD_COMPLETE 0x0001 struct mgmt_ev_cmd_complete { uint16_t opcode; diff --git a/src/advertising.c b/src/advertising.c index 3c173fef0..cab0b79de 100644 --- a/src/advertising.c +++ b/src/advertising.c @@ -91,6 +91,7 @@ struct btd_adv_client { uint32_t min_interval; uint32_t max_interval; int8_t tx_power; + mgmt_request_func_t refresh_done_func; }; struct dbus_obj_match { @@ -797,19 +798,9 @@ static uint8_t *generate_scan_rsp(struct btd_adv_client *client, return bt_ad_generate(client->scan, len); } -static int refresh_adv(struct btd_adv_client *client, mgmt_request_func_t func, - unsigned int *mgmt_id) +static int get_adv_flags(struct btd_adv_client *client) { - struct mgmt_cp_add_advertising *cp; - uint8_t param_len; - uint8_t *adv_data; - size_t adv_data_len; - uint8_t *scan_rsp; - size_t scan_rsp_len = -1; uint32_t flags = 0; - unsigned int mgmt_ret; - - DBG("Refreshing advertisement: %s", client->path); if (client->type == AD_TYPE_PERIPHERAL) { flags = MGMT_ADV_FLAG_CONNECTABLE; @@ -821,6 +812,26 @@ static int refresh_adv(struct btd_adv_client *client, mgmt_request_func_t func, flags |= client->flags; + return flags; +} + +static int refresh_legacy_adv(struct btd_adv_client *client, + mgmt_request_func_t func, + unsigned int *mgmt_id) +{ + struct mgmt_cp_add_advertising *cp; + uint8_t param_len; + uint8_t *adv_data; + size_t adv_data_len; + uint8_t *scan_rsp; + size_t scan_rsp_len = -1; + uint32_t flags = 0; + unsigned int mgmt_ret; + + DBG("Refreshing advertisement: %s", client->path); + + flags = get_adv_flags(client); + adv_data = generate_adv_data(client, &flags, &adv_data_len); if (!adv_data || (adv_data_len > calc_max_adv_len(client, flags))) { error("Advertising data too long or couldn't be generated."); @@ -873,6 +884,76 @@ static int refresh_adv(struct btd_adv_client *client, mgmt_request_func_t func, return 0; } +static void add_adv_params_callback(uint8_t status, uint16_t length, + const void *param, void *user_data); + +static int refresh_extended_adv(struct btd_adv_client *client, + mgmt_request_func_t func, unsigned int *mgmt_id) +{ + struct mgmt_cp_add_ext_adv_params cp; + uint32_t flags = 0; + uint16_t included_params = 0; + unsigned int mgmt_ret = 0; + + DBG("Refreshing advertisement parameters: %s", client->path); + + flags = get_adv_flags(client); + + memset(&cp, 0, sizeof(cp)); + cp.flags = htobl(flags); + cp.instance = client->instance; + + /* Not all advertising instances will use all possible parameters. The + * included_params bit field tells the kernel which parameters are + * relevant, and sensible defaults will be used for the rest + */ + + if (client->duration) { + cp.duration = client->duration; + included_params |= MGMT_ADV_PARAM_DURATION; + } + + if (client->min_interval && client->max_interval) { + cp.min_interval = client->min_interval; + cp.max_interval = client->max_interval; + included_params |= MGMT_ADV_PARAM_INTERVALS; + } + + if (client->tx_power != ADV_TX_POWER_NO_PREFERENCE) { + cp.tx_power = client->tx_power; + included_params |= MGMT_ADV_PARAM_TX_POWER; + } + + cp.params = included_params; + + mgmt_ret = mgmt_send(client->manager->mgmt, MGMT_OP_ADD_EXT_ADV_PARAMS, + client->manager->mgmt_index, sizeof(cp), &cp, + add_adv_params_callback, client, NULL); + + if (!mgmt_ret) { + error("Failed to request extended advertising parameters"); + return -EINVAL; + } + + /* Store callback, called after we set advertising data */ + client->refresh_done_func = func; + + if (mgmt_id) + *mgmt_id = mgmt_ret; + + + return 0; +} + +static int refresh_advertisement(struct btd_adv_client *client, + mgmt_request_func_t func, unsigned int *mgmt_id) +{ + if (client->manager->extended_add_cmds) + return refresh_extended_adv(client, func, mgmt_id); + + return refresh_legacy_adv(client, func, mgmt_id); +} + static gboolean client_discoverable_timeout(void *user_data) { struct btd_adv_client *client = user_data; @@ -883,7 +964,7 @@ static gboolean client_discoverable_timeout(void *user_data) bt_ad_clear_flags(client->data); - refresh_adv(client, NULL, NULL); + refresh_advertisement(client, NULL, NULL); return FALSE; } @@ -1057,7 +1138,8 @@ static void properties_changed(GDBusProxy *proxy, const char *name, continue; if (parser->func(iter, client)) { - refresh_adv(client, NULL, NULL); + refresh_advertisement(client, NULL, NULL); + break; } } @@ -1120,6 +1202,104 @@ done: add_client_complete(client, status); } +static void add_adv_params_callback(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + struct btd_adv_client *client = user_data; + const struct mgmt_rp_add_ext_adv_params *rp = param; + struct mgmt_cp_add_ext_adv_data *cp = NULL; + uint8_t param_len; + uint8_t *adv_data = NULL; + size_t adv_data_len; + uint8_t *scan_rsp = NULL; + size_t scan_rsp_len = -1; + uint32_t flags = 0; + unsigned int mgmt_ret; + + if (status) + goto fail; + + if (!param || length < sizeof(*rp)) { + status = MGMT_STATUS_FAILED; + goto fail; + } + + DBG("Refreshing advertisement data: %s", client->path); + + client->instance = rp->instance; + + flags = get_adv_flags(client); + + adv_data = generate_adv_data(client, &flags, &adv_data_len); + if (!adv_data || (adv_data_len > calc_max_adv_len(client, flags))) { + error("Advertising data too long or couldn't be generated."); + goto fail; + } + + scan_rsp = generate_scan_rsp(client, &flags, &scan_rsp_len); + if (!scan_rsp && scan_rsp_len) { + error("Scan data couldn't be generated."); + goto fail; + } + + param_len = sizeof(struct mgmt_cp_add_advertising) + adv_data_len + + scan_rsp_len; + + cp = malloc0(param_len); + if (!cp) { + error("Couldn't allocate for MGMT!"); + goto fail; + } + + cp->instance = client->instance; + cp->adv_data_len = adv_data_len; + cp->scan_rsp_len = scan_rsp_len; + memcpy(cp->data, adv_data, adv_data_len); + memcpy(cp->data + adv_data_len, scan_rsp, scan_rsp_len); + + free(adv_data); + free(scan_rsp); + adv_data = NULL; + scan_rsp = NULL; + + /* Submit request to update instance data */ + mgmt_ret = mgmt_send(client->manager->mgmt, MGMT_OP_ADD_EXT_ADV_DATA, + client->manager->mgmt_index, param_len, cp, + client->refresh_done_func, client, NULL); + + /* Clear the callback */ + client->refresh_done_func = NULL; + + if (!mgmt_ret) { + error("Failed to add Advertising Data"); + goto fail; + } + + if (client->add_adv_id) + client->add_adv_id = mgmt_ret; + + free(cp); + cp = NULL; + + return; + +fail: + if (adv_data) + free(adv_data); + + if (scan_rsp) + free(scan_rsp); + + if (cp) + free(cp); + + if (!status) + status = -EINVAL; + + /* Failure for any reason ends this advertising request */ + add_client_complete(client, status); +} + static DBusMessage *parse_advertisement(struct btd_adv_client *client) { struct adv_parser *parser; @@ -1178,7 +1358,9 @@ static DBusMessage *parse_advertisement(struct btd_adv_client *client) goto fail; } - err = refresh_adv(client, add_adv_callback, &client->add_adv_id); + err = refresh_advertisement(client, add_adv_callback, + &client->add_adv_id); + if (!err) return NULL; @@ -1257,6 +1439,8 @@ static struct btd_adv_client *client_create(struct btd_adv_manager *manager, client->min_interval = 0; client->max_interval = 0; + client->refresh_done_func = NULL; + return client; fail: @@ -1573,7 +1757,9 @@ void btd_adv_manager_destroy(struct btd_adv_manager *manager) static void manager_refresh(void *data, void *user_data) { - refresh_adv(data, user_data, NULL); + struct btd_adv_client *client = data; + + refresh_advertisement(client, user_data, NULL); } void btd_adv_manager_refresh(struct btd_adv_manager *manager) From patchwork Fri Sep 18 22:13:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Winkler X-Patchwork-Id: 252676 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 867EEC43464 for ; Fri, 18 Sep 2020 22:14:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4928F21734 for ; Fri, 18 Sep 2020 22:14:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="J/Bfsul9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726301AbgIRWOX (ORCPT ); Fri, 18 Sep 2020 18:14:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726245AbgIRWOW (ORCPT ); Fri, 18 Sep 2020 18:14:22 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F6ECC0613CE for ; Fri, 18 Sep 2020 15:14:22 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id v106so6975068ybi.6 for ; Fri, 18 Sep 2020 15:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=+UYsjiFI/CQBXYMas9iBIuEs/wH6yGhZNNWuNxXrA70=; b=J/Bfsul9xGv5hj9OBtPkKSnLS5qbnVUUGCAqAI2l9bu9FkpVBQnF7Ohs3YtRsH0QdG mjdLtDAcCaixXwgqdg20RwJLH1ZrKHVF1l2UPq7D3PjI1xFJ+7Jn77mHRVHSQqznLiX8 4hEYyC+HPEG0hhVHQQvK4r5fovcz74hmLBjkNPE27BXKcF889kn7CYtsyViCWKYbIEdJ KzFLi3TR8Jwof9iacKcFEjP3XwOyWtgJvB0GKY/cMCR9PNsj+QXrRhzA+1ItSAFaJZ0y 09bAUq/Ktx8QeHwqL3b4Ae2wmRIHcaH35/vac6unqnT8Xa8nb9YL2Z86M0WuJq927ZtL c9jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=+UYsjiFI/CQBXYMas9iBIuEs/wH6yGhZNNWuNxXrA70=; b=eMJK02E4J8XAj4J//EsjHyW63gaU8A1K/zsllX1cIwXsldhooFx19jqAXhdfG7Ic3k pNEm8PByp/aFaUYl803sH7ZIe2bnjkhlOsbc3KDKtHxKCwA/vZFdOp4xIPUYkr8kcuaa 7YQSdvrRh8mxJvjaNVd6n9OxqEiUjmlGSqsUmg0E6fA8Xw+BpUc3QUY37APm1NlEII2C m6RFMMKTOi4HewwVwMQF9wjz6EsbG6ctoju+i9vjsshdz88xt3P3B8gNJ0IqzvxuJ/n2 Y8IZKY8v6XI14m0m5MJS+pyt0bS91etqX+FANvh0rDGB8D/Bynd9Apk37OxurbS7m9MA YHeQ== X-Gm-Message-State: AOAM530Qyd3G20BasNZ5m0lx6PIhxF1fZxJoEeE31F0MJCx0MuO0AVPP DaIpBOZ5OBRhbxFNAnS4JLVfA7phxVMeJkjqwVx9 X-Google-Smtp-Source: ABdhPJz/spiKMlDvuZqviGpK3QGuRfLnbxYGhWF14vLgyCQE1DZyHyVO7eSRxCmF2M/Zw0+c+5FtUZVu1EXHLpa+LTWR Sender: "danielwinkler via sendgmr" X-Received: from danielwinkler-linux.mtv.corp.google.com ([2620:15c:202:201:f693:9fff:fef4:4e59]) (user=danielwinkler job=sendgmr) by 2002:a5b:d09:: with SMTP id y9mr21019625ybp.258.1600467261906; Fri, 18 Sep 2020 15:14:21 -0700 (PDT) Date: Fri, 18 Sep 2020 15:13:54 -0700 In-Reply-To: <20200918221357.3436905-1-danielwinkler@google.com> Message-Id: <20200918151041.Bluez.v2.7.I187f71748b9bd93f6bf97ec4a195216109c3ea06@changeid> Mime-Version: 1.0 References: <20200918221357.3436905-1-danielwinkler@google.com> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog Subject: [Bluez PATCH v2 07/10] advertising: Query LE TX range at manager initialization From: Daniel Winkler To: luiz.von.dentz@intel.com Cc: chromeos-bluetooth-upstreaming@chromium.org, linux-bluetooth@vger.kernel.org, Daniel Winkler , Sonny Sasaka , Alain Michaud Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patch calls the new MGMT command to get controller capabilities, and parses the min and max LE tx power range when the manager is initialized. This will be used to populate a client-facing dbus entry so that the client will know the advertising capabilities of the controller before registering an advertisement. This patch is tested by manually verifying the data is parsed correctly from the MGMT response. Reviewed-by: Sonny Sasaka Reviewed-by: Alain Michaud --- Changes in v2: None lib/mgmt.h | 8 +++++++ src/advertising.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) diff --git a/lib/mgmt.h b/lib/mgmt.h index 56f46ce93..558452e9c 100644 --- a/lib/mgmt.h +++ b/lib/mgmt.h @@ -744,6 +744,14 @@ struct mgmt_rp_add_ext_adv_data { uint8_t instance; } __packed; +#define MGMT_CAP_LE_TX_PWR_MIN 0x0000 +#define MGMT_CAP_LE_TX_PWR_MAX 0x0001 + +#define MGMT_OP_READ_CONTROLLER_CAP 0x0056 +struct mgmt_rp_read_controller_cap { + uint8_t capabilities[0]; /* mgmt_tlv */ +} __packed; + #define MGMT_EV_CMD_COMPLETE 0x0001 struct mgmt_ev_cmd_complete { uint16_t opcode; diff --git a/src/advertising.c b/src/advertising.c index c7deda1ad..a3e7f3d59 100644 --- a/src/advertising.c +++ b/src/advertising.c @@ -58,6 +58,8 @@ struct btd_adv_manager { uint32_t supported_flags; unsigned int instance_bitmap; bool extended_add_cmds; + int8_t min_tx_power; + int8_t max_tx_power; }; #define AD_TYPE_BROADCAST 0 @@ -1708,6 +1710,54 @@ static void tx_power_selected(uint16_t index, uint16_t length, DBUS_TYPE_INT16, &tx_power, NULL, NULL, NULL); } +static void read_controller_cap_complete(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + struct btd_adv_manager *manager = user_data; + const uint8_t *ptr = param; + uint16_t offset = 0; + + /* Both capabilities we care about are stored as int8_t. If we later + * want to track other types, this structure will need to change + */ + const struct { + struct mgmt_tlv entry; + int8_t value; + } __packed * cap; + + while (offset < length) { + /* Since TLV entries can have variable length, offset tracks how + * far into the member we are, so that cap is always pointing + * to the beginning of a valid struct + */ + cap = (void *)&ptr[offset]; + switch (cap->entry.type) { + case MGMT_CAP_LE_TX_PWR_MIN: + if (cap->entry.length != + sizeof(manager->min_tx_power)) { + error("TX power had unexpected length %d", + cap->entry.length); + break; + } + memcpy(&manager->min_tx_power, &cap->value, + cap->entry.length); + break; + case MGMT_CAP_LE_TX_PWR_MAX: + if (cap->entry.length != + sizeof(manager->min_tx_power)) { + error("TX power had unexpected length %d", + cap->entry.length); + break; + } + memcpy(&manager->max_tx_power, &cap->value, + cap->entry.length); + break; + } + + offset += sizeof(cap->entry) + cap->entry.length; + } +} + static struct btd_adv_manager *manager_create(struct btd_adapter *adapter, struct mgmt *mgmt) { @@ -1729,6 +1779,8 @@ static struct btd_adv_manager *manager_create(struct btd_adapter *adapter, manager->supported_flags = MGMT_ADV_FLAG_LOCAL_NAME; manager->extended_add_cmds = btd_has_kernel_features(KERNEL_HAS_EXT_ADV_ADD_CMDS); + manager->min_tx_power = ADV_TX_POWER_NO_PREFERENCE; + manager->max_tx_power = ADV_TX_POWER_NO_PREFERENCE; if (!g_dbus_register_interface(btd_get_dbus_connection(), adapter_get_path(manager->adapter), @@ -1750,6 +1802,13 @@ static struct btd_adv_manager *manager_create(struct btd_adapter *adapter, manager->mgmt_index, tx_power_selected, manager, NULL); + /* Query controller capabilities. This will be used to display valid + * advertising tx power range to the client. + */ + mgmt_send(manager->mgmt, MGMT_OP_READ_CONTROLLER_CAP, + manager->mgmt_index, 0, NULL, + read_controller_cap_complete, manager, NULL); + return manager; fail: From patchwork Fri Sep 18 22:13:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Winkler X-Patchwork-Id: 252675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36F9DC43464 for ; Fri, 18 Sep 2020 22:14:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 027FF21734 for ; Fri, 18 Sep 2020 22:14:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Pq8lYqFq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726307AbgIRWO0 (ORCPT ); Fri, 18 Sep 2020 18:14:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726192AbgIRWO0 (ORCPT ); Fri, 18 Sep 2020 18:14:26 -0400 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EF64C0613CE for ; Fri, 18 Sep 2020 15:14:26 -0700 (PDT) Received: by mail-pg1-x54a.google.com with SMTP id 24so186757pgm.8 for ; Fri, 18 Sep 2020 15:14:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=hBa/AroYAfFXZZcTqpW4A2vXre//hNzr99oZmnbGxrQ=; b=Pq8lYqFqir3rF0IxPvYdhbXhwXyoi4bmjIJYCOaSP9wiKYgzP4Qx0ysoqAwhGYalQa gDTrhWwlB4hIcXR/pJAv4iL3nXk49vRBRFPdAHbGUVYgf+3q6SdyzoA4uq15jQf+rH9t D1aiHFDEGhfkZ1zDVZI+ow6GKplhsG5K4RMxxvsMjEFeZMR87GfXfSYhy31ZKxrxEDxx v8vbKy6OlFqyEvxa6Lvu2Aahe/EflL+LEFFxZsBdozOa0t+08qnM0jdxclaGaRwJa+Hq 2HRAAKR5lds/Ccwk4gG+xr7Mm0mWCpkP4NHY8bXuHVVVtnx1iP8Q8y4PFyc5z91W03HJ K04A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=hBa/AroYAfFXZZcTqpW4A2vXre//hNzr99oZmnbGxrQ=; b=koQG4J0RZwhjRBy/YFWg7ZJiUShOxD8ulRxX9TiyS60fXrWmEzU2vf40u6J24m5TSZ wrSNEhLJIf2i1/TZ/qOOzyLop4/xHPTABUqzABZlJoMq3q6RsaIHE9ckMOXGQwmi/OKV uHf0jsyYHZfSynoeexPZr1vCiikgXw/i9Ve4LVxDgtnuAKqlNbVRiCv/Jyd1f59DlOsp +sHfSexbdvyD7iqfv2IegDvMNO6LlwlfH2jj5mPXlctYhN3b5piUpGtEuhhfFY9MxPA3 uDMHccnhI9ut0ZnZCBqi/cVBsbzMYk8fwqsMSv5vVx9YRAYXIoy0Y3ZfDgU1mwWiUIt1 Co1g== X-Gm-Message-State: AOAM5331IRWYgReaiVnUunmAYZbkPnzYZK9mpRKbEr6tMgGvclAoOCxL fx3g4qaDiH9+6iPFxXI8eU0btmBCt4lL4QSE9qBY X-Google-Smtp-Source: ABdhPJyzO3MizyV2jm3ejIn5Tdk/6NXv4+HhGlahhSSENSkSt6cc7dkPue0iRiX+NRQLuG/0Hwq9YnXzC7LCiyzeau3g Sender: "danielwinkler via sendgmr" X-Received: from danielwinkler-linux.mtv.corp.google.com ([2620:15c:202:201:f693:9fff:fef4:4e59]) (user=danielwinkler job=sendgmr) by 2002:aa7:9f04:0:b029:13e:d13d:a08c with SMTP id g4-20020aa79f040000b029013ed13da08cmr33080360pfr.35.1600467265920; Fri, 18 Sep 2020 15:14:25 -0700 (PDT) Date: Fri, 18 Sep 2020 15:13:56 -0700 In-Reply-To: <20200918221357.3436905-1-danielwinkler@google.com> Message-Id: <20200918151041.Bluez.v2.9.Ic9eec7749b769aa5bf73a0d8e9a31be83f232f1c@changeid> Mime-Version: 1.0 References: <20200918221357.3436905-1-danielwinkler@google.com> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog Subject: [Bluez PATCH v2 09/10] client: Add SupportedCapabilities to bluetoothctl From: Daniel Winkler To: luiz.von.dentz@intel.com Cc: chromeos-bluetooth-upstreaming@chromium.org, linux-bluetooth@vger.kernel.org, Daniel Winkler , Sonny Sasaka , Alain Michaud Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patch adds the new "SupportedCapabilities" property to the bluetoothctl "show" view. The change is tested by verifying bluetoothctl shows the desired properties. Reviewed-by: Sonny Sasaka Reviewed-by: Alain Michaud --- Changes in v2: None client/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/client/main.c b/client/main.c index 2b0243308..cb8ef54ad 100644 --- a/client/main.c +++ b/client/main.c @@ -954,6 +954,7 @@ static void cmd_show(int argc, char *argv[]) print_property(adapter->ad_proxy, "SupportedInstances"); print_property(adapter->ad_proxy, "SupportedIncludes"); print_property(adapter->ad_proxy, "SupportedSecondaryChannels"); + print_property(adapter->ad_proxy, "SupportedCapabilities"); } if (adapter->adv_monitor_proxy) {