Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp745716pxk; Thu, 24 Sep 2020 18:14:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOAoADZZjtyBzrYaLvaW8QwlVcacPVqmDI9FhI+MQPxrqX6zP3Aj5nh3AMJYLyJcGtDm6G X-Received: by 2002:a17:906:c1c6:: with SMTP id bw6mr400880ejb.374.1600996496218; Thu, 24 Sep 2020 18:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600996496; cv=none; d=google.com; s=arc-20160816; b=n5mgO2bXWJiOPPuDcw9yBmEEwMRvFwp+mg+GRvxp0FBynXTwQqdOh8vFSA6y9reFgR J5JuszCETs0cAKsOb+Ca0UStmPauf2LFIS72knW6ER25fXHIf/Tf2f6KTY45d31YBrPN mFX0c9+aWRIMO7KvJ4ll+TCCan9oUjDt0nROxKu9uhSPrIWu2Mgay6orYGSdfXvP6KMF FSV0EAonCxuaaEZpWxuXvM2YFAe4bI0Rg3qHHAkylOIgp23Tiy3C4eOywmIBg0OQB7Ce LyI1aQmxfMBcZIPdjv5UwSvYxlTwySmy8dvrMnZymDTy/m2zC8ezhsZ9fyvgRJ7HyrEv kHOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :sender:dkim-signature; bh=esZ6mdnPKj7LnCrN12NDOxoAp0Ez7vV5cUu/bYcytjc=; b=xbHsW93h3LhA9TJPbqlxWWMRQbXJ19zBh7gliGB8BWIATQIxoE4oD5ytJTNew3g1wC SamPu/LKVhP9Zv/3UB1uQiFeJ40TzB4FjELEwX5EE4agk0+JxKfyDA/kFbURcOeJ61Wz 24bXLtWe1luRqQzzdITBPJ87Eb9PR5Yop7KTg4q+FIrnkq0VWdLruMrz0brvWiCk+A4X iqlnvJDKWr6dLk4Y6A2OHqeAeiStNr9EfVuKfPmH5+ehoUXaI7xbSiwIwX4W0xoGY4Q8 LzjQuNWSbedqvHT+b68nPRjq+WH0OMzhENQEzwe+fIgL0LGsO1CzIzgoL3HQukeHptvf Kekw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=OLrZW2kH; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c20si840385ejm.28.2020.09.24.18.14.15; Thu, 24 Sep 2020 18:14:56 -0700 (PDT) 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=@google.com header.s=20161025 header.b=OLrZW2kH; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726843AbgIYBN6 (ORCPT + 99 others); Thu, 24 Sep 2020 21:13:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726840AbgIYBN6 (ORCPT ); Thu, 24 Sep 2020 21:13:58 -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 1DE5CC0613CE for ; Thu, 24 Sep 2020 18:13:58 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id a7so1088822ybq.22 for ; Thu, 24 Sep 2020 18:13:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=esZ6mdnPKj7LnCrN12NDOxoAp0Ez7vV5cUu/bYcytjc=; b=OLrZW2kHhdh4DEoVzRiNW95yOcE/TNNQSZInB/HDKNfxyuYl/0INZ2U3Gl9O6ury1h FHspG5VcZjCx44SH+oBAenSjy+ulNz/9LW/SH1c4SWpVYiAxOKEvtBlaDQVkd4kqAQ1L KXctGsG/SA8wwyppDcGBrndDf1U0DDABvhdz7iewoXydehS+qSk6nPPFs+Kvba4uExwZ kEHsHBgLlDoP/UYQUtpCH/Fp1dCzyuloT3kOGJQhJqezc26dws4F21HHTg/E+kvN14Vw v3pvQYzY1Ra27wCzYvgYpLiHJRF8hooxShbA2v41ufaloqGyI23WWI7rvctGZKqgqpoH BkQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=esZ6mdnPKj7LnCrN12NDOxoAp0Ez7vV5cUu/bYcytjc=; b=BMFjT/v4E5uwD9Mh0BHnfkMtEPdp5PJ3usMFRfMp7HRfK0f2EfAjPtGowXHNknlgAU XH/jogGLR/HOtPDQgDOrrcg/b+fkDk8S5u5LY3yvIiUmmBP+Ph2zbn6mJ3yKJEsmnDZ9 0CLiwgzZndVBFg4fuENouXSRPymaAuOhOZg9NkXtX3O5p00uWS9VkKVPdhFnQZ+oJ4RI R95E8Mb+wJPgqqcG3QUkxqqgu+uwKG3vg5jc2R6U/kjDqg9GomU9yFMs34U8v9/rqrOa 12EpdXPe01xj3f6F5d8qOmmKavnW2ESbGKncheNiLZV7BZqp+A3g4LGAVW6Emh967dsl v2IA== X-Gm-Message-State: AOAM533GfWegE2GlYDkoJxeEN0Zinniu4QTvJ1hcjgAar9ZBCpsVs9QS ah+t8O6LtMIFej7GbeSQxIYNnwzFRfgNYXYEpt45 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:8389:: with SMTP id t9mr2307639ybk.471.1600996437324; Thu, 24 Sep 2020 18:13:57 -0700 (PDT) Date: Thu, 24 Sep 2020 18:13:38 -0700 Message-Id: <20200925011347.2478464-1-danielwinkler@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.28.0.709.gb0816b6eb0-goog Subject: [Bluez PATCH v3 0/9] Bluetooth: Add new MGMT interface for advertising add From: Daniel Winkler To: luiz.von.dentz@intel.com Cc: linux-bluetooth@vger.kernel.org, chromeos-bluetooth-upstreaming@chromium.org, Daniel Winkler Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Maintainers, This patch series defines the new two-call MGMT interface in userspace for adding advertising instances. Bluez will detect if kernel supports the new MGMT commands, and use them if so. Each new advertising instance will be configured by a MGMT call to set advertising parameters, followed by a MGMT call to set advertising data. The new data pipeline is meant to be unnoticeable from the clients' perspective, with the exception of new intervals and tx power support, and new exposed advertising manager properties. All changes have been tested on hatch (extended advertising) and kukui (no extended advertising) chromebooks with manual testing verifying correctness of parameters/data in btmon traces, and our automated test suite of 25 single- and multi-advertising usage scenarios. V2 of the series puts documentation at the front as requested. Thank you in advance for your review! Daniel Winkler Changes in v3: - Removed Tx Power Selected MGMT event - Changed Read Security Info cmd to Read Controller Capabilities - Added selected tx power to MGMT params response - Removed Tx Power Selected MGMT event from monitor Changes in v2: - Removed extra space in Add Extended Advertising Parameters API - Uses btd_has_kernel_features to detect kernel command support - Cleaned fail path in add_adv_params_callback Daniel Winkler (9): doc/advertising-api: update API with new interface doc/mgmt-api: Add new MGMT interfaces to mgmt-api advertising: Detect if extended advertising mgmt commands are supported advertising: Parse intervals and tx power from adv advertising: Use new mgmt interface for advertising add advertising: Query LE TX range at manager initialization advertising: Expose SupportedCapabilities for advertising client: Add SupportedCapabilities to bluetoothctl monitor: Add new MGMT adv commands and events to monitor client/main.c | 1 + doc/advertising-api.txt | 50 +++++ doc/mgmt-api.txt | 229 +++++++++++++++++++++- lib/mgmt.h | 47 ++++- monitor/packet.c | 79 +++++++- src/adapter.c | 4 + src/adapter.h | 1 + src/advertising.c | 423 ++++++++++++++++++++++++++++++++++++++-- tools/btmgmt.c | 12 +- 9 files changed, 813 insertions(+), 33 deletions(-) -- 2.28.0.709.gb0816b6eb0-goog