Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp779879pxx; Thu, 29 Oct 2020 14:24:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLpK7kZLGLgGCg9T6luzQp8zfr8eFsj6yr3pwwIIEyvCTA9L9IL8PiwpJFwqwwKwdvgJ5l X-Received: by 2002:a17:906:c095:: with SMTP id f21mr6343091ejz.108.1604006678587; Thu, 29 Oct 2020 14:24:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604006678; cv=none; d=google.com; s=arc-20160816; b=0tGMA1oO5dqg+RveBdHJJLichUGuh0sWC8OtgxYek/owWV0GyM/xy1X8pSyDTJn0Lt qqV+DnS2wEC5iHtZZN/ACRwuDA0W/uirGVgBTSfzk30PhdPAttKKYy9mCGCz/7nSBuzK o4A5ayzfJHtkZChADRDPs9GIO0RB9+AE4lhdZE5WQgM7psbeqdcEtCY9ZNm5SG6rc6vr +nTWP4V8cFH7j6C0qSStDNA8J1DXf8LEICYhHqHsSdXsYTHq60qWTvRdClXTfZZ1N9A0 QUd0mJ6gZ8bwPyhk1pNZkDpOItaZ7PkL2Wx1jbjcVyVJCWzcx5k9i2PeV6XqN3b/Z7rB ykHA== 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=WyDGRz2pbkNZwiLvOIQy45H0kIvS2ltU85WXGIWP/yQ=; b=OzcobFs7HWzzmAFPk+wkzenkfq5cpljNxLp7l1DBwYNA5T7c1CvkICLIOQ8wQWwKqI M/CitnpyjztvM0gC6i768lrPqaUtychq9HK1RlcCZ+rTACm45MJsjAquUC0I8w4kGuAY 5Xq/8i0t9qwUaO8NinrXMxZ5IJFj2w6bnq1MZd+ExSzdmYmyejm6xyP96vMNja64l9V7 uPCHAav0I870pZRfrxeBjFGe2CqawrEuXSEtTA+p90+PwiHSF1QBDkyGxD/I/iuGqs6v 0gwpdl9qk6ecyIF8KXPwbONqypzgIuw6lgrHlTB5ciIwJwfym/MXzYgRZesRodm5pzzN 9qLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="uzwVuPq/"; 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 n10si2592893eja.436.2020.10.29.14.23.58; Thu, 29 Oct 2020 14:24:38 -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="uzwVuPq/"; 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 S1726190AbgJ2VXq (ORCPT + 99 others); Thu, 29 Oct 2020 17:23:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725948AbgJ2VXq (ORCPT ); Thu, 29 Oct 2020 17:23:46 -0400 Received: from mail-qv1-xf49.google.com (mail-qv1-xf49.google.com [IPv6:2607:f8b0:4864:20::f49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 012CDC0613CF for ; Thu, 29 Oct 2020 14:23:45 -0700 (PDT) Received: by mail-qv1-xf49.google.com with SMTP id eh4so2545239qvb.12 for ; Thu, 29 Oct 2020 14:23:45 -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=WyDGRz2pbkNZwiLvOIQy45H0kIvS2ltU85WXGIWP/yQ=; b=uzwVuPq/le2AMhNgDudVXSjx2dWhjpxsiSSlKSTmkgtoLz5VaAucFdcnxklbC1vb8J 3Ao3EN/TJFzVtDqq+kpSt7ksNNwExyUVu0vshKBzaVcbSbOX6VOdbfvf2nP9dpdwRdsa ZX9VtY+PEA5yTDFnT5NMn2nst0kzZbqr0HzB8q4CaRIdKqz21EFvTne5vonmBJkkN9Xm xIGUbFK038fFBE3YsVazG6LQrc5vDKcuzXU8iGZtcLEcj2tkjewypDTRJXWNVdAD7XF+ y5pzjeWLq+1IcdFLOGY3KlF+Yp1Jn+xnxSWPD1TPAMASVCXRdH0ZP58s7djiFD5qZOrd GNXQ== 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=WyDGRz2pbkNZwiLvOIQy45H0kIvS2ltU85WXGIWP/yQ=; b=G3w9lNnzp7b7vTlPEue/RHG0VSviDwTk1XcDiao40g02KuHpgy6lMIyr0TcXPOhv3c Bye9SrGehstPHUcspcnoQyzXCboLNzixtEhG/SH+KAqQFRMwjAiIuBxv+x8a+5jlZg6l 6omnpwcfSiY0l1P3IY8o1A+/f+Hu48lMIc3yCCnuOSqDUd1eHOYZke+pEWXgF18F0MrA eBsQ6u1KRri7RFu8CIt+8cYp5bDt0fYMjX12CK58+onk3x4A7gXQh/iZOVh7xmJFLanZ 3vLzSZkpEmg52ql31prqIWDNUV0CjsnFAbI6Yv5T+Nn/SD0+U53vncVPL62I3jCHWqL+ F24g== X-Gm-Message-State: AOAM531ZLOsnefNyINDPJWwAmJ4TiyPL4l71U4NE+McI0q97Kf1zXsuH yeC0yZmmq0KiooqNEJ/XLbEdQlarmt0IIXbiVMUQ 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:a0c:85e3:: with SMTP id o90mr5878142qva.46.1604006624988; Thu, 29 Oct 2020 14:23:44 -0700 (PDT) Date: Thu, 29 Oct 2020 14:23:25 -0700 Message-Id: <20201029212336.3283410-1-danielwinkler@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.29.1.341.ge80a0c044ae-goog Subject: [Bluez PATCH v5 00/10] 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 v5: - Changed interval API from jiffies to milliseconds for clarity - Changed new dbus endpoints to be experimental - Only parse new properties if experimental flag is set - Verify capabilities MGMT command is supported before calling it - Make SupportedCapabilities experimental Changes in v4: - mgmt-api: moved optional params into 'flags' field - mgmt-api: added info for new return parameters for max data size - mgmt-api: Move Controller Capabilities MGMT doc into new patch - mgmt-api: Tx Power range put into single capabilities entry - Moved optional params into flags field - Use returned max data length in adv data length check - Move tx power range into single capability field 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 (10): doc/advertising-api: update API with new interface doc/mgmt-api: Add new Advertising MGMT interfaces to mgmt-api doc/mgmt-api: Update controller capabilities MGMT command in 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 | 48 +++++ doc/mgmt-api.txt | 238 +++++++++++++++++++++- lib/mgmt.h | 46 ++++- monitor/packet.c | 69 ++++++- src/adapter.c | 8 + src/adapter.h | 2 + src/advertising.c | 428 ++++++++++++++++++++++++++++++++++++++-- tools/btmgmt.c | 12 +- 9 files changed, 819 insertions(+), 33 deletions(-) -- 2.29.1.341.ge80a0c044ae-goog