From patchwork Wed Dec 23 00:26:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tedd Ho-Jeong An X-Patchwork-Id: 11987413 X-Patchwork-Delegate: luiz.dentz@gmail.com 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=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT 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 1305FC433E0 for ; Wed, 23 Dec 2020 00:27:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C5D7E22A83 for ; Wed, 23 Dec 2020 00:27:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725961AbgLWA1a (ORCPT ); Tue, 22 Dec 2020 19:27:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725931AbgLWA1a (ORCPT ); Tue, 22 Dec 2020 19:27:30 -0500 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5162FC0613D3 for ; Tue, 22 Dec 2020 16:26:50 -0800 (PST) Received: by mail-pf1-x42e.google.com with SMTP id 11so9382824pfu.4 for ; Tue, 22 Dec 2020 16:26:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WhaJfM0GPYUTenVkreTx0tBcGxFFAiF25O5tAuWQsQU=; b=SdmY1tJPlN/ofE50370H3+X/nFeKxw62qKNyktex4cPIjQ/5QM1y7EfxK+WTINlRG/ LwM1n8ZSqPSYo2cq0g9yozXbQuWDecWFkRcQWAL2TfsrqLIgz0gluUkUVkoVNFO0GmoM vQZzIE/PRkjB0nCpqonNvpsBAVhe+EtHgic5VFjlL2OCTdrIgZi9+r/br0ht5OjCszlt dmeh2ckr4xBGGFEvW+inx5IUCHAbYJVGxuN52wqWVWquEM6EBniRsjVv88N5dSKqX+me SYP3yYsVdqhhbKeH39On/W8moM9ovDmluHM0wZBLGdZZnzo73OyzJGJSjG0GVKXvOiOI cIMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WhaJfM0GPYUTenVkreTx0tBcGxFFAiF25O5tAuWQsQU=; b=XjUUEtn/NMuaK86Hu3LkGeyfEfrBwmy2SpFO0TAkaCQJEKHpW5J68pElDeSq1lzTYT uaJ/srkzYLnXyj/X1SuxonUxYEb5CFDT6PjQ6hWXiizMwnruKmpaLOX9jraqI+dZI/wc zzKqW8psxUZUDBSGXDQaFUVWylyTwuKm0ihVR7mFm84a+FU5pwI+GcmY1HlO/39Akz8N b2qutXCAbDUt6BW3+KELJYG2i8VejI/PI1Q/yalWCPdAwAj8nRYnp0Ff8CMiuQXahBxD Y0k2kC8LGPLkKPudnWl5gRuH0ktmxSLfNadE0nJx3ith9byS8sfuUAmX7z9h2/LOu2hx Ue2g== X-Gm-Message-State: AOAM532BHYd+l3XQz/HRzY8VRvkWsWXlLvLdjDMgm9XsNft82s2tNcfT l3PuUTZ4/kMuFfR7EvXeebUj/JNsF2E= X-Google-Smtp-Source: ABdhPJyJbN2AlCMCvtEkV+yMithIu5RZYt40pjxhscJUOR6SFf7NWva0itv0SKi3ypANGrOwoGesHg== X-Received: by 2002:a63:dc44:: with SMTP id f4mr22067642pgj.281.1608683209758; Tue, 22 Dec 2020 16:26:49 -0800 (PST) Received: from localhost.localdomain (c-73-164-224-32.hsd1.or.comcast.net. [73.164.224.32]) by smtp.gmail.com with ESMTPSA id 8sm5505566pfz.93.2020.12.22.16.26.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Dec 2020 16:26:48 -0800 (PST) From: Tedd Ho-Jeong An X-Google-Original-From: Tedd Ho-Jeong An To: linux-bluetooth@vger.kernel.org Cc: danielwinkler@google.com, tedd.an@intel.com Subject: [PATCH 1/3] tools/mgmt-tester: Update sample data for adv features Date: Tue, 22 Dec 2020 16:26:31 -0800 Message-Id: <20201223002633.187612-1-tedd.an@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patch updates the expected sample data for advertising feature to include the changes for tx power. --- tools/mgmt-tester.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c index bef506134..d9d7b3430 100644 --- a/tools/mgmt-tester.c +++ b/tools/mgmt-tester.c @@ -4162,7 +4162,7 @@ static const struct generic_data read_adv_features_invalid_index_test = { }; static const uint8_t read_adv_features_rsp_1[] = { - 0x7f, 0x00, 0x00, 0x00, /* supported flags */ + 0x7f, 0xf0, 0x00, 0x00, /* supported flags */ 0x1f, /* max_adv_data_len */ 0x1f, /* max_scan_rsp_len */ 0x05, /* max_instances */ @@ -4177,7 +4177,7 @@ static const struct generic_data read_adv_features_success_1 = { }; static const uint8_t read_adv_features_rsp_2[] = { - 0x7f, 0x00, 0x00, 0x00, /* supported flags */ + 0x7f, 0xf0, 0x00, 0x00, /* supported flags */ 0x1f, /* max_adv_data_len */ 0x1f, /* max_scan_rsp_len */ 0x05, /* max_instances */ @@ -7137,7 +7137,7 @@ static const struct generic_data set_appearance_success = { }; static const uint8_t read_adv_features_rsp_3[] = { - 0xff, 0x0f, 0x00, 0x00, /* supported flags */ + 0xff, 0xff, 0x00, 0x00, /* supported flags */ 0x1f, /* max_adv_data_len */ 0x1f, /* max_scan_rsp_len */ 0x01, /* max_instances */ From patchwork Wed Dec 23 00:26:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tedd Ho-Jeong An X-Patchwork-Id: 11987415 X-Patchwork-Delegate: luiz.dentz@gmail.com 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=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT 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 18894C433DB for ; Wed, 23 Dec 2020 00:27:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE16F22AAA for ; Wed, 23 Dec 2020 00:27:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725973AbgLWA1b (ORCPT ); Tue, 22 Dec 2020 19:27:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725931AbgLWA1b (ORCPT ); Tue, 22 Dec 2020 19:27:31 -0500 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EE9CC0613D6 for ; Tue, 22 Dec 2020 16:26:51 -0800 (PST) Received: by mail-pg1-x52f.google.com with SMTP id e2so9472071pgi.5 for ; Tue, 22 Dec 2020 16:26:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wHkAFeFGdVP0bN+3byL2TsVLZTpr3v8Y3XvQKnnn9Fo=; b=J8QbsTBgbaUeX1aRMZyX9YcjS/yaRckew8+z6zRBRLYyNuOfOPJdNpIZvd/5ERSIBA +6q7lKA+jQzeh1KqvZPPYPJHuCeC4nIRA9SbW/nxe0B8msAZMXzC8O+WdtK0/IWK02w8 HZAfgRjlpY3FbJzGzpr6iDct2n5HjiMahBcWtGZbsKl65aP0DTqXiesyYJOja4hmQ6gW D6rK1rzN0UtLhS/gC78ijx61UgrnpV+3uU5/HO7w/9i+PzAbDi/RrAsMyJGmpx418uvZ MDwBpixL40JfpLvs+EbDI7BFN/ybV4yY/4RLGs5ZSyRJJBZrNoV1bfV+5lUs5FPThjKf Hi/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wHkAFeFGdVP0bN+3byL2TsVLZTpr3v8Y3XvQKnnn9Fo=; b=bYgFXmFHon1NA8LN/C4eoYl2jyDJ8oymV/nQLsLoJHcdAzfjgmVrhUWjo70hliC8nK dR376DGpdOxs5xX8UHzCKn3MJUWWJCwhrG3/Ws8DAsI0qoDn/shbkWzwKpf88PjMW5Lk U4PU2BA2YeJ3d35Zbl23uV8bcSlwBvx7kfNPG1B+Rqxhj1kpnY8LPe48Lahwl3hY/bQc 7anB3agQogh9XEDRmK9R8OSepW6HrE2gfaPY7JOFSvMH9zZ34B2APMl6931LDWIW+Dcb Uh4ZkYDx3od0F+oKsNiCPDJuWXyCmO7LRW/zyRX8k0uK7km0Kmdhnt5ciNzk+lYZjD7y bDYg== X-Gm-Message-State: AOAM531sjIyGGX3wiBtEuT95s+kCa+mx6B8PQUrvlYrTw0v2cSmOvZQl ZCRObeIt9tDpZlgquqei0CGPjCnq6U4= X-Google-Smtp-Source: ABdhPJx2XcN685bsoFyRy8MEUS7AkwORDBkxvr/EFt+lhFca3KOWgw4+UrheLnq+G1W4RM0/QVG5cw== X-Received: by 2002:a65:458e:: with SMTP id o14mr16272005pgq.444.1608683210533; Tue, 22 Dec 2020 16:26:50 -0800 (PST) Received: from localhost.localdomain (c-73-164-224-32.hsd1.or.comcast.net. [73.164.224.32]) by smtp.gmail.com with ESMTPSA id 8sm5505566pfz.93.2020.12.22.16.26.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Dec 2020 16:26:50 -0800 (PST) From: Tedd Ho-Jeong An X-Google-Original-From: Tedd Ho-Jeong An To: linux-bluetooth@vger.kernel.org Cc: danielwinkler@google.com, tedd.an@intel.com Subject: [PATCH 2/3] emulator/btdev: Add support LE_READ_TX_POWER command Date: Tue, 22 Dec 2020 16:26:32 -0800 Message-Id: <20201223002633.187612-2-tedd.an@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201223002633.187612-1-tedd.an@intel.com> References: <20201223002633.187612-1-tedd.an@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patch adds support for LE_READ_TX_POWER command. It uses a random values for min and max tx power since these values is read from the controller. --- emulator/btdev.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/emulator/btdev.c b/emulator/btdev.c index ae382d9b9..17965f9b6 100644 --- a/emulator/btdev.c +++ b/emulator/btdev.c @@ -4170,6 +4170,22 @@ static int cmd_read_per_adv_list_size(struct btdev *dev, const void *data, return -ENOTSUP; } +static int cmd_read_tx_power(struct btdev *dev, const void *data, uint8_t len) +{ + struct bt_hci_rsp_le_read_tx_power rsp; + + memset(&rsp, 0, sizeof(rsp)); + + rsp.status = BT_HCI_ERR_SUCCESS; + /* a random default value */ + rsp.max_tx_power = 0x07; + rsp.min_tx_power = 0xDE; + + cmd_complete(dev, BT_HCI_CMD_LE_READ_TX_POWER, &rsp, sizeof(rsp)); + + return 0; +} + #define CMD_LE_50 \ CMD(BT_HCI_CMD_LE_SET_DEFAULT_PHY, cmd_set_default_phy, NULL), \ CMD(BT_HCI_CMD_LE_SET_ADV_SET_RAND_ADDR, cmd_set_adv_rand_addr, NULL), \ @@ -4205,7 +4221,8 @@ static int cmd_read_per_adv_list_size(struct btdev *dev, const void *data, NULL), \ CMD(BT_HCI_CMD_LE_CLEAR_PERIODIC_ADV_LIST, cmd_per_adv_clear, NULL), \ CMD(BT_HCI_CMD_LE_READ_PERIODIC_ADV_LIST_SIZE, \ - cmd_read_per_adv_list_size, NULL) + cmd_read_per_adv_list_size, NULL), \ + CMD(BT_HCI_CMD_LE_READ_TX_POWER, cmd_read_tx_power, NULL) static const struct btdev_cmd cmd_le_5_0[] = { CMD_COMMON_ALL, @@ -4240,6 +4257,7 @@ static void set_le_50_commands(struct btdev *btdev) btdev->commands[38] |= 0x10; /* LE Remove Periodic Adv List */ btdev->commands[38] |= 0x20; /* LE Clear Periodic Adv List */ btdev->commands[38] |= 0x40; /* LE Read Periodic Adv List Size */ + btdev->commands[38] |= 0x80; /* LE Read Transmit Power */ btdev->cmds = cmd_le_5_0; } From patchwork Wed Dec 23 00:26:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tedd Ho-Jeong An X-Patchwork-Id: 11987417 X-Patchwork-Delegate: luiz.dentz@gmail.com 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=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT 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 467CCC433E6 for ; Wed, 23 Dec 2020 00:27:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0902322AAC for ; Wed, 23 Dec 2020 00:27:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725994AbgLWA1c (ORCPT ); Tue, 22 Dec 2020 19:27:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725931AbgLWA1c (ORCPT ); Tue, 22 Dec 2020 19:27:32 -0500 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 303ADC061793 for ; Tue, 22 Dec 2020 16:26:52 -0800 (PST) Received: by mail-pg1-x529.google.com with SMTP id i5so1399273pgo.1 for ; Tue, 22 Dec 2020 16:26:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=C2pZOr5Pj/yxGUKqlwUvnOKWDpBqQvQqPWcy7JPxuP8=; b=p+JSTCVwq0H1WaVkb+hLCURtHdzs/HeuRdNHRkMfRtCvwzpTx0X4x5KJoKe0cadYw+ 2/AwGSOvGhdOQN9bitP8Or+7taV9hx8XPI2RMhP6+3kvpeaRkO8dREtvKOmPg2USCfHe B9l+fP6tv53B/BqGvF8uMqXzYW9Lz9sqHCYasrUUzhCO/2MNXJ1aXNq/6X0H4Ssf1SbF 3GpbhPuYefcWADl+OfIAlJynoS5qAd9dY86kjIhqxLQCpA7v6rEhWbE02w4dc7hXirEB 04PFeLyuvL3eBHgmGMCf3ZRoyTiLcmLpK0A3kZ+9VMHa9p6z0G1stvrKBYVSntmZBN83 H9Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C2pZOr5Pj/yxGUKqlwUvnOKWDpBqQvQqPWcy7JPxuP8=; b=qo4mVS6xTY49s5xhN5oLO3sz3UnTlK4cZQVwdS2M/A7nc9msWkob76Y7siCLoBU0ZB rL39sxfqLn3uKEb4XRogGm5EbSbfTn1GHzhII/0OoZi/SPoTcZyGJ3wTyTfkIlbCceTu szFc7JepO9zRS5JOBevQ3X9IK2D7CgIJCAKFKAYWF0gPN92X9AmGheQlW56xdMDvO7NF WWFNrfb3u7Qf1mM2947ZgO6NOjdFT7lq6RqxsOj7swk3utFrn0iU/3OK+OeI5pDufyeh zS05AIySOAWpXoLUAsZWDVTFNZPex6L/jI+OS+2GgL2mVQ8zdQQxbKAekYjFR6WA/jt4 EjQA== X-Gm-Message-State: AOAM530cQNmoGick6r9dBRzY/Wo8tCYgkZHTJe0krKi63PTv1cRFOngp /z4hGa9T+6CjF79MitKCqULt+6liJYY= X-Google-Smtp-Source: ABdhPJzkJpQmRvk8haYUac10trSgJrx0LmVz8CJJb7WO7mK64ZYUpfi1/Y+2zMmKPyWnS/rTq0DxrA== X-Received: by 2002:a63:5924:: with SMTP id n36mr10555382pgb.9.1608683211397; Tue, 22 Dec 2020 16:26:51 -0800 (PST) Received: from localhost.localdomain (c-73-164-224-32.hsd1.or.comcast.net. [73.164.224.32]) by smtp.gmail.com with ESMTPSA id 8sm5505566pfz.93.2020.12.22.16.26.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Dec 2020 16:26:50 -0800 (PST) From: Tedd Ho-Jeong An X-Google-Original-From: Tedd Ho-Jeong An To: linux-bluetooth@vger.kernel.org Cc: danielwinkler@google.com, tedd.an@intel.com Subject: [PATCH 3/3] tools/mgmt-tester: Adds new test data with updated tx power Date: Tue, 22 Dec 2020 16:26:33 -0800 Message-Id: <20201223002633.187612-3-tedd.an@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201223002633.187612-1-tedd.an@intel.com> References: <20201223002633.187612-1-tedd.an@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patch adds new test data for the ext advertising test cases that presets the advertising parameter and toggles the connectable flags. When the adv instance is created, it updates the default tx power with the value read from the controller. After toggling the connectable flag, the host uses the tx_power stored in the adv list cache, which is the value read from the controller, instead of the default tx power value(127). --- tools/mgmt-tester.c | 88 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 80 insertions(+), 8 deletions(-) diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c index d9d7b3430..fe73a6d89 100644 --- a/tools/mgmt-tester.c +++ b/tools/mgmt-tester.c @@ -7592,6 +7592,24 @@ static const struct generic_data add_ext_advertising_success_15 = { .expect_hci_len = sizeof(set_connectable_on_ext_adv_param), }; +static uint8_t preset_connectable_on_ext_adv_param[] = { + 0x01, /* Handle */ + 0x13, 0x00, /* Event type */ + 0x00, 0x08, 0x00, /* min_interval */ + 0x00, 0x08, 0x00, /* max_interval */ + 0x07, /* channel_map */ + 0x00, /* own_addr_type */ + 0x00, /* peer_addr_type */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* peer_addr */ + 0x00, /* filter_policy */ + 0x00, /* Tx power */ + 0x01, /* Primary PHY */ + 0x00, /* primary adv max skip */ + 0x01, /* Secondary PHY */ + 0x00, /* adv sid*/ + 0x00, /* Scan req notification */ +}; + static const struct generic_data add_ext_advertising_success_16 = { .send_opcode = MGMT_OP_SET_CONNECTABLE, .send_param = set_connectable_on_param, @@ -7600,8 +7618,26 @@ static const struct generic_data add_ext_advertising_success_16 = { .expect_param = set_connectable_settings_param_3, .expect_len = sizeof(set_connectable_settings_param_3), .expect_hci_command = BT_HCI_CMD_LE_SET_EXT_ADV_PARAMS, - .expect_hci_param = set_connectable_on_ext_adv_param, - .expect_hci_len = sizeof(set_connectable_on_ext_adv_param), + .expect_hci_param = preset_connectable_on_ext_adv_param, + .expect_hci_len = sizeof(preset_connectable_on_ext_adv_param), +}; + +static uint8_t preset_connectable_off_ext_adv_param[] = { + 0x01, /* Handle */ + 0x10, 0x00, /* Event type */ + 0x00, 0x08, 0x00, /* min_interval */ + 0x00, 0x08, 0x00, /* max_interval */ + 0x07, /* channel_map */ + 0x01, /* own_addr_type */ + 0x00, /* peer_addr_type */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* peer_addr */ + 0x00, /* filter_policy */ + 0x00, /* Tx power */ + 0x01, /* Primary PHY */ + 0x00, /* primary adv max skip */ + 0x01, /* Secondary PHY */ + 0x00, /* adv sid*/ + 0x00, /* Scan req notification */ }; static const struct generic_data add_ext_advertising_success_17 = { @@ -7612,8 +7648,8 @@ static const struct generic_data add_ext_advertising_success_17 = { .expect_param = set_le_settings_param_2, .expect_len = sizeof(set_le_settings_param_2), .expect_hci_command = BT_HCI_CMD_LE_SET_EXT_ADV_PARAMS, - .expect_hci_param = set_connectable_off_ext_adv_param, - .expect_hci_len = sizeof(set_connectable_off_ext_adv_param), + .expect_hci_param = preset_connectable_off_ext_adv_param, + .expect_hci_len = sizeof(preset_connectable_off_ext_adv_param), }; static const struct generic_data add_ext_advertising_le_off = { @@ -8240,6 +8276,24 @@ static void setup_add_advertising_1m(const void *test_data) NULL, NULL); } +static uint8_t preset_connectable_on_ext_pdu_adv_param[] = { + 0x01, /* Handle */ + 0x01, 0x00, /* Event type */ + 0x00, 0x08, 0x00, /* min_interval */ + 0x00, 0x08, 0x00, /* max_interval */ + 0x07, /* channel_map */ + 0x00, /* own_addr_type */ + 0x00, /* peer_addr_type */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* peer_addr */ + 0x00, /* filter_policy */ + 0x00, /* Tx power */ + 0x01, /* Primary PHY */ + 0x00, /* primary adv max skip */ + 0x01, /* Secondary PHY */ + 0x00, /* adv sid*/ + 0x00, /* Scan req notification */ +}; + static const struct generic_data add_ext_advertising_conn_on_1m = { .send_opcode = MGMT_OP_SET_CONNECTABLE, .send_param = set_connectable_on_param, @@ -8248,8 +8302,8 @@ static const struct generic_data add_ext_advertising_conn_on_1m = { .expect_param = set_connectable_settings_param_3, .expect_len = sizeof(set_connectable_settings_param_3), .expect_hci_command = BT_HCI_CMD_LE_SET_EXT_ADV_PARAMS, - .expect_hci_param = set_connectable_on_ext_pdu_adv_param, - .expect_hci_len = sizeof(set_connectable_on_ext_pdu_adv_param), + .expect_hci_param = preset_connectable_on_ext_pdu_adv_param, + .expect_hci_len = sizeof(preset_connectable_on_ext_pdu_adv_param), }; static void setup_add_advertising_connectable_1m(const void *test_data) @@ -8282,6 +8336,24 @@ static void setup_add_advertising_connectable_1m(const void *test_data) NULL, NULL); } +static uint8_t preset_connectable_off_ext_1m_adv_param[] = { + 0x01, /* Handle */ + 0x00, 0x00, /* Event type */ + 0x00, 0x08, 0x00, /* min_interval */ + 0x00, 0x08, 0x00, /* max_interval */ + 0x07, /* channel_map */ + 0x01, /* own_addr_type */ + 0x00, /* peer_addr_type */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* peer_addr */ + 0x00, /* filter_policy */ + 0x00, /* Tx power */ + 0x01, /* Primary PHY */ + 0x00, /* primary adv max skip */ + 0x01, /* Secondary PHY */ + 0x00, /* adv sid*/ + 0x00, /* Scan req notification */ +}; + static const struct generic_data add_ext_advertising_conn_off_1m = { .send_opcode = MGMT_OP_SET_CONNECTABLE, .send_param = set_connectable_off_param, @@ -8290,8 +8362,8 @@ static const struct generic_data add_ext_advertising_conn_off_1m = { .expect_param = set_le_settings_param_2, .expect_len = sizeof(set_le_settings_param_2), .expect_hci_command = BT_HCI_CMD_LE_SET_EXT_ADV_PARAMS, - .expect_hci_param = set_connectable_off_ext_1m_adv_param, - .expect_hci_len = sizeof(set_connectable_off_ext_1m_adv_param), + .expect_hci_param = preset_connectable_off_ext_1m_adv_param, + .expect_hci_len = sizeof(preset_connectable_off_ext_1m_adv_param), }; static const uint8_t get_phy_param[] = {