From patchwork Thu Mar 4 20:24:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Winkler X-Patchwork-Id: 12116771 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=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,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 279A0C43381 for ; Thu, 4 Mar 2021 20:26:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F14D664F69 for ; Thu, 4 Mar 2021 20:26:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229547AbhCDUZ5 (ORCPT ); Thu, 4 Mar 2021 15:25:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbhCDUZm (ORCPT ); Thu, 4 Mar 2021 15:25:42 -0500 Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD87DC06175F for ; Thu, 4 Mar 2021 12:25:01 -0800 (PST) Received: by mail-qt1-x84a.google.com with SMTP id k1so19897373qtp.12 for ; Thu, 04 Mar 2021 12:25:01 -0800 (PST) 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=BiFY7vOowpTr5WqeUR2ASOa9EfK24Kg3HZihoCznWvQ=; b=R/R78kSxKxfwlhF7gBfJpxFXY+d/qTbfj1TO0HocePBQI/H7LEmbDDUWrSN5IjX3Ss Ba+uavHQPbxj1Wsxs/L0UjS5tmbCgcaA8JS+WEh6mukLJ02YY4hPC3/6+aAPsYMWgbmy YrPcTJ8wzcLH2Yy85iYcieml6IXTF5H1iQwDNTPaRiX6zoMQ0W6Fv9xoliTHXRTSPMOI 1tUoiK06UAxA6bUnbyDYHlkAsJpSQKhQo4EOXBKBAiuPF44B4ruDIXv8wFwjDyk0XYV7 p6PqqHdHajyNb5cw81MKSLCSTYPkLPStNXznPoDl+KYIOjwf488tk/Jk9Tc6lAvFxPbz lSTw== 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=BiFY7vOowpTr5WqeUR2ASOa9EfK24Kg3HZihoCznWvQ=; b=s0Pg/4pqwA9McnGk8WrOjomuVgHMeBie0GsrVto9WNOMxRLpDOOgDN1PVumw8Nn222 xBLvspszLjtT2u48Bqj19bMB5QO0CaYTe4XtHeK0LhVXfz7FTFgrHd6eq2L1/N63/N74 My9IL6APMMTiqDo0IH3M7Isz8S7Yq4wBn8km5x6zWgwvkRkXlqVpREx/4fmbTn3cFn8C 1Cjo4UucucMO98EHHMsVJEiw45MsyU/Ekfmt98jfbV3KQZCrA36Gq8NoIlT+NfSXoyJP pBJTcbuW+SBRVW1JHbibTB0evNsla7oF7hU+pa8K9OUdlBPHfQ0ReHcLT8Nz/dsK/E1c AEIw== X-Gm-Message-State: AOAM532bbH7ALXNypeKXDfNY/pfo1F1UMF98gEX8EM2vei+6ngzBUYel ZkLnH3ncyLMOt8NpAwzwbflpKe3ZHRXGo4cH+IG5apaM4uDGSQ18+PfDuo96cYj9PcHV6juXObi jcQ1VfdqLgw4Kl560m4ctf81djr5C4k8gJSfYTlcKbZ248yEA2ukl2+vt7fZEgdo/YeL0anOOG3 rzrG+8aEI9YpFgI+8U X-Google-Smtp-Source: ABdhPJwzZjGNAxyGpLNSyFMPlcKQ+lWgHu8zOb83ehCliwjgjbbFK7557UdqtseAoZU6HeNbnrVFVSZF6942rVAN92w/ Sender: "danielwinkler via sendgmr" X-Received: from danielwinkler-linux.mtv.corp.google.com ([2620:15c:202:201:a873:4408:c731:b8f2]) (user=danielwinkler job=sendgmr) by 2002:a0c:b617:: with SMTP id f23mr5806060qve.44.1614889500871; Thu, 04 Mar 2021 12:25:00 -0800 (PST) Date: Thu, 4 Mar 2021 12:24:50 -0800 In-Reply-To: <20210304202452.1998022-1-danielwinkler@google.com> Message-Id: <20210304122005.Bluez.v2.1.I1411482bfff45aecdec1bc8c895fc7148ee3f50c@changeid> Mime-Version: 1.0 References: <20210304202452.1998022-1-danielwinkler@google.com> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog Subject: [Bluez PATCH v2 1/3] advertising: Generate advertising data earlier in pipeline From: Daniel Winkler To: linux-bluetooth@vger.kernel.org, luiz.dentz@gmail.com Cc: chromeos-bluetooth-upstreaming@chromium.org, Daniel Winkler , Alain Michaud , Sonny Sasaka Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This change moves the advertising data generation to the beginning of the registration pipeline. This is necessary for the following patch, which will need to know whether the scan response data is existent so that the parameter request can be populated correctly. Reviewed-by: Alain Michaud Reviewed-by: Sonny Sasaka --- Changes in v2: None src/advertising.c | 79 +++++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/src/advertising.c b/src/advertising.c index 15a343e52..f3dc357a1 100644 --- a/src/advertising.c +++ b/src/advertising.c @@ -80,6 +80,10 @@ struct btd_adv_client { uint32_t flags; struct bt_ad *data; struct bt_ad *scan; + uint8_t *adv_data; + uint8_t *scan_rsp; + size_t adv_data_len; + size_t scan_rsp_len; uint8_t instance; uint32_t min_interval; uint32_t max_interval; @@ -141,6 +145,16 @@ static void client_free(void *data) bt_ad_unref(client->data); bt_ad_unref(client->scan); + if (client->adv_data) { + free(client->adv_data); + client->adv_data = NULL; + } + + if (client->scan_rsp) { + free(client->scan_rsp); + client->scan_rsp = NULL; + } + g_dbus_proxy_unref(client->proxy); if (client->owner) @@ -915,6 +929,22 @@ static int refresh_extended_adv(struct btd_adv_client *client, flags |= MGMT_ADV_PARAM_TX_POWER; } + client->adv_data = generate_adv_data(client, &flags, + &client->adv_data_len); + if (!client->adv_data || + (client->adv_data_len > calc_max_adv_len(client, flags))) { + error("Advertising data too long or couldn't be generated."); + return -EINVAL; + } + + client->scan_rsp = generate_scan_rsp(client, &flags, + &client->scan_rsp_len); + if (!client->scan_rsp && client->scan_rsp_len) { + error("Scan data couldn't be generated."); + free(client->adv_data); + return -EINVAL; + } + cp.flags = htobl(flags); mgmt_ret = mgmt_send(client->manager->mgmt, MGMT_OP_ADD_EXT_ADV_PARAMS, @@ -1222,11 +1252,6 @@ static void add_adv_params_callback(uint8_t status, uint16_t length, 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; dbus_int16_t tx_power; @@ -1248,23 +1273,8 @@ static void add_adv_params_callback(uint8_t status, uint16_t length, 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 > rp->max_adv_data_len)) { - 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) || - scan_rsp_len > rp->max_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; + param_len = sizeof(struct mgmt_cp_add_advertising) + + client->adv_data_len + client->scan_rsp_len; cp = malloc0(param_len); if (!cp) { @@ -1273,15 +1283,11 @@ static void add_adv_params_callback(uint8_t status, uint16_t length, } 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; + cp->adv_data_len = client->adv_data_len; + cp->scan_rsp_len = client->scan_rsp_len; + memcpy(cp->data, client->adv_data, client->adv_data_len); + memcpy(cp->data + client->adv_data_len, client->scan_rsp, + client->scan_rsp_len); /* Submit request to update instance data */ mgmt_ret = mgmt_send(client->manager->mgmt, MGMT_OP_ADD_EXT_ADV_DATA, @@ -1305,12 +1311,6 @@ static void add_adv_params_callback(uint8_t status, uint16_t length, return; fail: - if (adv_data) - free(adv_data); - - if (scan_rsp) - free(scan_rsp); - if (cp) free(cp); @@ -1454,6 +1454,11 @@ static struct btd_adv_client *client_create(struct btd_adv_manager *manager, if (!client->scan) goto fail; + client->adv_data = NULL; + client->scan_rsp = NULL; + client->adv_data_len = 0; + client->scan_rsp_len = 0; + client->manager = manager; client->appearance = UINT16_MAX; client->tx_power = ADV_TX_POWER_NO_PREFERENCE; From patchwork Thu Mar 4 20:24:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Winkler X-Patchwork-Id: 12116767 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=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,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 1FF45C433E9 for ; Thu, 4 Mar 2021 20:26:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D548B64F51 for ; Thu, 4 Mar 2021 20:26:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231533AbhCDUZ6 (ORCPT ); Thu, 4 Mar 2021 15:25:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229650AbhCDUZo (ORCPT ); Thu, 4 Mar 2021 15:25:44 -0500 Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5E15C061760 for ; Thu, 4 Mar 2021 12:25:03 -0800 (PST) Received: by mail-qv1-xf4a.google.com with SMTP id b15so13343473qvz.15 for ; Thu, 04 Mar 2021 12:25:03 -0800 (PST) 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=B4e7SmHOZkqh/Hs71+KSM2Oz1ObvmdMgmfIEeDwkkGs=; b=uP9WBDwTr7fvhGYU/6XmcCNGc9DWsqPxZk8IOdsFXCTjeeywppawb7h/rEUQzsi7My 8beW924VmkYCCNnmiH0wm9HmBKHYbgeEX9A0M7W5SIdKfP9rqLZ+OgwXQ9ZYkV0BOFMJ l+SLWdaDrykded/R+v/4ARKRRoIShL+SDPY3Z/t2tUejJuk+Yca+XhZCdEyJsf/V6hda h6npmiEoTYIuEubOAKA8HXbnpxqp6jzxsOoaTW8xf41Wz/ZvjMQfmA6dlthAEIpvHQ1E b6EmBy2/8E8/Y8T1hsifS+A578qC3/yZsL3UnpP3fQIqxJh9nYLdE7y+NocvokT7MxTc 9sDQ== 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=B4e7SmHOZkqh/Hs71+KSM2Oz1ObvmdMgmfIEeDwkkGs=; b=APd3Q9p2Hgtz2hV9x8tZEWzfAXZD3GPkCgz6T0j/zB1PAL4V5FfX7W05/I+PCtDbSO NS/Mk4W+It7oiVr7RjKVXHxXQzdxLEF3TC/uSgGWTvH1CngEZyQ9tZTmilmNVKRJqjfV PKq0ePhacucow1ddRp0/hEH5Ppq+IPLoaBZmdduo8S/Q0/DuE1dcSKikLoaAZBZHv2yP ODovzwm0E3UamzKDa5XGARY+hTlUxxV+TVTnzdyrw9ngmMn98GwnboIoH/xSDd6FcVyN E2GGq66PZ18/3QfXzfozXnoP2A5nIBlaVMyGbiEw3Mg+ndz0DQdGCh8948Etp8N1P5YY 6tYg== X-Gm-Message-State: AOAM532MlfKKv4fXKkq7YNOTYDyThbEFH1fwIpeURnqBjI1orYqTWhHb tbIIftAoV0zhxY3UEtWwIH/OD6WD7w+mI9GgvYGjXRF/lQJ2+SOz6i/rBONRaq0yx7V2tUrQ4mH 7T78Nq3Fl69eSx3WWuU7V29SGQ9ph9LUGz/aP0DdzxdVchii6gaTlwccicYZaDQcjY91uNu8NYl DJewACSwZjovyEta5k X-Google-Smtp-Source: ABdhPJzLD8n5jhWune5wnbXjkex1ptGEQJE/WSaTSOueIGpWj3ni1lYy5Df5VLllWscE2mfX8y1hwMYHHYXYNVSWtfGk Sender: "danielwinkler via sendgmr" X-Received: from danielwinkler-linux.mtv.corp.google.com ([2620:15c:202:201:a873:4408:c731:b8f2]) (user=danielwinkler job=sendgmr) by 2002:ad4:4ab0:: with SMTP id i16mr5520768qvx.1.1614889502952; Thu, 04 Mar 2021 12:25:02 -0800 (PST) Date: Thu, 4 Mar 2021 12:24:51 -0800 In-Reply-To: <20210304202452.1998022-1-danielwinkler@google.com> Message-Id: <20210304122005.Bluez.v2.2.I45b896f4512038309cbeab7a01f51e503141edab@changeid> Mime-Version: 1.0 References: <20210304202452.1998022-1-danielwinkler@google.com> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog Subject: [Bluez PATCH v2 2/3] advertising: Create and use scannable adv param flag From: Daniel Winkler To: linux-bluetooth@vger.kernel.org, luiz.dentz@gmail.com Cc: chromeos-bluetooth-upstreaming@chromium.org, Daniel Winkler , Alain Michaud , Sonny Sasaka Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org In order for the advertising parameters hci request to indicate that an advertising set uses a scannable PDU, we pass a scannable flag along with the initial parameters MGMT request. Without this patch, a broadcast advertisement with a scan response will either be rejected by the controller, or will ignore the requested scan response. The patch is tested by performing the above and confirming that the scan response is retrievable from a peer as expected. Reviewed-by: Alain Michaud Reviewed-by: Sonny Sasaka --- Changes in v2: - Check kernel supports flag before setting it lib/mgmt.h | 1 + src/advertising.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/mgmt.h b/lib/mgmt.h index 76a03c9c2..7b1b9ab54 100644 --- a/lib/mgmt.h +++ b/lib/mgmt.h @@ -507,6 +507,7 @@ struct mgmt_rp_add_advertising { #define MGMT_ADV_PARAM_TIMEOUT (1 << 13) #define MGMT_ADV_PARAM_INTERVALS (1 << 14) #define MGMT_ADV_PARAM_TX_POWER (1 << 15) +#define MGMT_ADV_PARAM_SCAN_RSP (1 << 16) #define MGMT_OP_REMOVE_ADVERTISING 0x003F struct mgmt_cp_remove_advertising { diff --git a/src/advertising.c b/src/advertising.c index f3dc357a1..cdf06154d 100644 --- a/src/advertising.c +++ b/src/advertising.c @@ -945,7 +945,13 @@ static int refresh_extended_adv(struct btd_adv_client *client, return -EINVAL; } - cp.flags = htobl(flags); + /* Indicate that this instance will be configured as scannable */ + if (client->scan_rsp_len && + client->manager->supported_flags & MGMT_ADV_PARAM_SCAN_RSP) { + flags |= MGMT_ADV_PARAM_SCAN_RSP; + } + + cp.flags = cpu_to_le32(flags); mgmt_ret = mgmt_send(client->manager->mgmt, MGMT_OP_ADD_EXT_ADV_PARAMS, client->manager->mgmt_index, sizeof(cp), &cp, From patchwork Thu Mar 4 20:24:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Winkler X-Patchwork-Id: 12116769 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=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,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 E9725C433DB for ; Thu, 4 Mar 2021 20:26:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BCBE564F6B for ; Thu, 4 Mar 2021 20:26:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231791AbhCDUZ6 (ORCPT ); Thu, 4 Mar 2021 15:25:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229794AbhCDUZq (ORCPT ); Thu, 4 Mar 2021 15:25:46 -0500 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 AF73BC061761 for ; Thu, 4 Mar 2021 12:25:05 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id u1so31915730ybu.14 for ; Thu, 04 Mar 2021 12:25:05 -0800 (PST) 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=1PoslpW4l0xkZy0dHIQi6TTICf9LKwPQujXAUBIUG7I=; b=Q9h+JO4O6P1pviiq5rZy14T3Q6xmdGcexjPsKT+L13jWDx2D9EA3ifGLWv2J35zWn8 xasliXWfDnCoAm5UxOHdEVYj9iRjaq+hK/bt/+FKoalRUyg9t4CVvpDQoGIoKP9yQQoo eb2FY2MVoWZnH3u9+e3Q5V1ZbWm+VvwyP5nmf5CEs9BoglsvkCDuMNYO/Dz1w4RnCJui RFpn5Tqp8vxisGmi1tXxLHP6cdkLZ61XzwCIf+a8G6Zh+OPOr0NCjtkb6XnC5AX6K7ZP cV/ycypW+F/5RHUaG7aYK7kB1/0lLZrNELIG3N6sDiByrT/TsqpS9WWZtJnAYz8gtH4m TXhg== 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=1PoslpW4l0xkZy0dHIQi6TTICf9LKwPQujXAUBIUG7I=; b=k/gX5BgsjSVQuebfHgiaybd6QBfRXvnUu0IjZYt7Tb9ve/aV3MzZSZLM06ajwqbeZY cnaT3wqL7VS4ZbdiLxnXQxTuQmlwAe20FxSh+ACeQKZC1Rdny1806tcR90vrePEQDXpg 4aSNFDtu6k8I5XTN1mJT4KbviMXaJoCVSR4+v1omK2Jkqkv9R5ZDROBhrlRncuEbehKd ljdZkFsJMPt/z3n46xJqADgSj6AWvlMSPEdQtwnlR4cKMwfx4rCAi4LonziVjZ1wX0XE bo6z5CcmAkQ+iFqMz8DSlCbVozd+CxMOLl+UoB2gPxFuYuquKsT7Q67AOdrhrf6Jrilt ULWA== X-Gm-Message-State: AOAM5334pAREN+Z/uiibqnfpNIdlINBtul6qkl7vYZ3DF5BJ1g0Sb045 58iHtFA30PMshbki8ypzJmQ9/4C60zTaTfCZoCNzFvWZ2kqbesx7MlgkLPWP3ALsw35CEhYGmiu 9EohFTLo7qkymunr9B3OeIDmd2uRsTB7EF2ayF/FRZVZkWfKxTiUXkUyC94mnlXAA+co3ZbJSLo FTJo+KOufp58zGJRf/ X-Google-Smtp-Source: ABdhPJwFAem1+XgYuvZIppypCtxcUdFMxJRaxoSh20ipfhqzZskBi8GChVmFX2eoH6sR5vvuEt6x0c8XkE7j2FS92el8 Sender: "danielwinkler via sendgmr" X-Received: from danielwinkler-linux.mtv.corp.google.com ([2620:15c:202:201:a873:4408:c731:b8f2]) (user=danielwinkler job=sendgmr) by 2002:a25:6952:: with SMTP id e79mr8730307ybc.142.1614889504958; Thu, 04 Mar 2021 12:25:04 -0800 (PST) Date: Thu, 4 Mar 2021 12:24:52 -0800 In-Reply-To: <20210304202452.1998022-1-danielwinkler@google.com> Message-Id: <20210304122005.Bluez.v2.3.I87c7524ba1da470e9ff6ebdf9eef9ef715a9616d@changeid> Mime-Version: 1.0 References: <20210304202452.1998022-1-danielwinkler@google.com> X-Mailer: git-send-email 2.30.1.766.gb4fecdf3b7-goog Subject: [Bluez PATCH v2 3/3] doc/mgmt-api: Update documentation for scan_rsp param flag From: Daniel Winkler To: linux-bluetooth@vger.kernel.org, luiz.dentz@gmail.com Cc: chromeos-bluetooth-upstreaming@chromium.org, Daniel Winkler , Alain Michaud , Sonny Sasaka Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patch adds the new scannable flag to the Add Extended Advertising Parameters MGMT API documentation. Reviewed-by: Alain Michaud Reviewed-by: Sonny Sasaka --- Changes in v2: None doc/mgmt-api.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt index 1736ef009..cab1fffc5 100644 --- a/doc/mgmt-api.txt +++ b/doc/mgmt-api.txt @@ -3632,6 +3632,7 @@ Add Extended Advertising Parameters Command 13 The Timeout parameter should be used 14 The Interval parameters should be used 15 The Tx Power parameter should be used + 16 The advertisement will contain a scan response When the connectable flag is set, then the controller will use undirected connectable advertising. The value of the connectable @@ -3708,6 +3709,10 @@ Add Extended Advertising Parameters Command chosen by the controller. If the requested Tx Power is outside the valid range, the registration will fail. + When flag bit 16 is enabled, it indicates that the subsequent request + to set advertising data will contain a scan response, and that the + parameters should set a PDU type that is scannable. + Re-adding an already existing instance (i.e. issuing the Add Extended Advertising Parameters command with an Instance identifier of an existing instance) will update that instance's configuration. In this