From patchwork Wed Oct 6 20:12:58 2021 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: 12540501 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C070C433EF for ; Wed, 6 Oct 2021 20:13:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D8A061090 for ; Wed, 6 Oct 2021 20:13:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229922AbhJFUOz (ORCPT ); Wed, 6 Oct 2021 16:14:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbhJFUOy (ORCPT ); Wed, 6 Oct 2021 16:14:54 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76B56C061746 for ; Wed, 6 Oct 2021 13:13:02 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id b22so2447535pls.1 for ; Wed, 06 Oct 2021 13:13:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=Tb8KnJ3skiflfLlObqVQY/XrKpSYGl1Yg0t7YexW514=; b=UNv7c6/HjOmwW4hboyu4sR/NwfgPIdedZmCbF3t4ASiNeKseoaUWnus+UEO6cpOHyy C+QMC8bbqvKSQtaLi4dmwRu3VfZJbtin9RW/okmpQwyPRLi8DMt2dD1soBKZjQ56UAhF QV/iSSpjJL2jWEI4J9eJYlS1SrQztsE7LnIaah//hFFNmSRSIKa5A47mpbUe/z+iClLv Yed0Nvev6MS83MVyV6SImvsjgXdUCkAEcC1TwbdBmq4mSUPWA7FBNuyK+1GKPOn7ORDY XRcsI6iiNPKrJrFLXMG2xnSWiZNwyDtOM5M8LQVbPruGC1ZGZLjnHSLIYG96SFLNAQ7p jEXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=Tb8KnJ3skiflfLlObqVQY/XrKpSYGl1Yg0t7YexW514=; b=MldhVi/YPTNHTKLvQ+9KtQn2DpLQZLvgDtH284S6jeu/dbOYaFIWnFAQ4fWD9URXGl IiYjfNjGVU+cN+03x2FRs4O921m8UWzh8NF7CkdZG4tPWeSfNR22UC9IYPJ+Dvfm1v6u Y0GwQ8frd3hPWn1pScH3SjvUbFIYIrOXpd1okTj8954lKzCcQCKvTzjL3t2GZ/Gbv0c0 wDywmsT72BxESoQk5P38bfRFKVi9OGmPfAp2rPkFvDmSbDDvm8LL5sFrJ00TbQ9yoX4V 0PvRaEnBsZXk5hB9HpEixsNhf2WpG5UjgTncz427e68TH0T+widwaqtn7YG29Tp96A16 x5dg== X-Gm-Message-State: AOAM531lOwnS3CJy4nAydywzGMoJs1Bk8PNc+29mfUyFqNLQef2UY/3W 0vxokvmnLUQp+s3JFnpHr2/6kUUSdgTV0w== X-Google-Smtp-Source: ABdhPJztyK1QRUhflyMA9WOeq/3+KGWqb3VLjyVtGOY2gNLjjG1+EKgBS9/Z6mPJz8MFLwsaTl5TzQ== X-Received: by 2002:a17:902:9a49:b0:13a:430d:7e8b with SMTP id x9-20020a1709029a4900b0013a430d7e8bmr12995091plv.50.1633551181546; Wed, 06 Oct 2021 13:13:01 -0700 (PDT) Received: from han1-NUC8i7BEH.hsd1.or.comcast.net ([2601:1c0:6a01:d830:8e4c:2d64:6206:9120]) by smtp.gmail.com with ESMTPSA id b10sm16202006pfl.200.2021.10.06.13.13.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 13:13:00 -0700 (PDT) From: Tedd Ho-Jeong An To: linux-bluetooth@vger.kernel.org Subject: [BlueZ PATCH 1/3] doc/tester-config: Enable Runtime Debugging Feature Date: Wed, 6 Oct 2021 13:12:58 -0700 Message-Id: <20211006201300.186055-1-hj.tedd.an@gmail.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 From: Tedd Ho-Jeong An This patch adds CONFIG_BT_FEATURE_DEBUG=y in tester config to enable the runtime debug option. --- doc/tester.config | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/tester.config b/doc/tester.config index 892fd5eb3..011475661 100644 --- a/doc/tester.config +++ b/doc/tester.config @@ -32,6 +32,7 @@ CONFIG_BT_LE=y CONFIG_BT_HS=y CONFIG_BT_MSFTEXT=y CONFIG_BT_AOSPEXT=y +CONFIG_BT_FEATURE_DEBUG=y CONFIG_BT_HCIVHCI=y From patchwork Wed Oct 6 20:12:59 2021 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: 12540503 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AD66C433FE for ; Wed, 6 Oct 2021 20:13:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C34261152 for ; Wed, 6 Oct 2021 20:13:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230138AbhJFUO4 (ORCPT ); Wed, 6 Oct 2021 16:14:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229998AbhJFUOz (ORCPT ); Wed, 6 Oct 2021 16:14:55 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F294C061746 for ; Wed, 6 Oct 2021 13:13:03 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id w14so2444614pll.2 for ; Wed, 06 Oct 2021 13:13:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=+XKnD4GJOUG4ZpJH3cxocRx3+YDLNLBV8VWzd6UmmAI=; b=Wtol52tYm6eTDflwfr6E/kwuzqLo9m1yUCgfTYTwcjmtGls2ACuFo9/Rx61tu9DNLA OxODj+qr9+UChFj6JQfO3EzrHY3sUhGY1jTiQFnMZilpH9ThsA+gCBL25G+87tSyp3rN +DMJQtQCzUAnlUhrqVJlIzVV18Wq3zb+FrTgxTZKJh8uGFKSKBC3KoZWQhf7MwDzKKcS 2m/mSEysVOBqlOSnpunflMo3y9g57pD9720A3iy+kGJiLf6Z65YyPcPr5yJOyWJrMYMM TibdQOu7R7u8XmlfxPIb5DIexsMre2YH2gcZ0tctSodfbIjxiqvaG+TpWgzp+5/ISoKd 0jEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+XKnD4GJOUG4ZpJH3cxocRx3+YDLNLBV8VWzd6UmmAI=; b=aFZCkXK7LszY+LO/i2elC8vVn26aBTs8k6nj/G3Ech9UpKOYmaz3LBnjvenl/ymRhP Rc1rKqxCCBvmsF1CmefPkPxhb+bb8KwzeVUyBEtdD0f7YtUXVUjclAy76dYC2tB3Gm6g 38EKerVqfZNPW3wRCWoBu2rBq2HrUL8kSvEQQm3AokFbPl+RYalVfTYKF7bj35Noc1vl oSVvI323STv69Fhur/K1jiXuHPWjkEgDLdhPDDhBcMXrofbOzrEVauD5B7loKd0BOFGC bNdhchZDGJLspTbUh1QGPrz21AQauqH4daCtVpo1CTvjfTD0oFIzyodN+taQWI2eWRYd r6YA== X-Gm-Message-State: AOAM532bM1u93o2N3btNfwsYfvf+zH/0FeYDqozrLeXE3tLv+H+GD3BI kr3MFeAUcPYZyVXS6+dEc0tTkp4dtNB5hg== X-Google-Smtp-Source: ABdhPJxkiwUE3G7Zs2sDcS0tukaXKEIj28GG4tUERsdM2Fn5m800wCrQbRq2wIFx3DlPdhDyWjwgqg== X-Received: by 2002:a17:902:934c:b0:13d:c685:229b with SMTP id g12-20020a170902934c00b0013dc685229bmr207702plp.25.1633551182562; Wed, 06 Oct 2021 13:13:02 -0700 (PDT) Received: from han1-NUC8i7BEH.hsd1.or.comcast.net ([2601:1c0:6a01:d830:8e4c:2d64:6206:9120]) by smtp.gmail.com with ESMTPSA id b10sm16202006pfl.200.2021.10.06.13.13.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 13:13:01 -0700 (PDT) From: Tedd Ho-Jeong An To: linux-bluetooth@vger.kernel.org Subject: [BlueZ PATCH 2/3] tools/mgmt-tester: Updates Experimental Feature test cases Date: Wed, 6 Oct 2021 13:12:59 -0700 Message-Id: <20211006201300.186055-2-hj.tedd.an@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211006201300.186055-1-hj.tedd.an@gmail.com> References: <20211006201300.186055-1-hj.tedd.an@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Tedd Ho-Jeong An This patch updates/adds test cases for Read and Set Experimental Feature commands. --- tools/mgmt-tester.c | 92 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 3 deletions(-) diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c index 1a2aba7fd..84d81c8ca 100644 --- a/tools/mgmt-tester.c +++ b/tools/mgmt-tester.c @@ -390,8 +390,8 @@ static void debug_exp_feature(struct test_data *data) tester_print("Enabling Debug feature"); mgmt_send(data->mgmt, MGMT_OP_SET_EXP_FEATURE, MGMT_INDEX_NONE, - sizeof(set_exp_feat_param_debug), set_exp_feat_param_debug, - debug_exp_callback, NULL, NULL); + sizeof(set_exp_feat_param_debug), set_exp_feat_param_debug, + debug_exp_callback, NULL, NULL); } static void read_index_list_callback(uint8_t status, uint16_t length, @@ -9702,6 +9702,23 @@ static const struct generic_data read_exp_feat_success = { .expect_len = sizeof(read_exp_feat_param_success), }; + +static const uint8_t read_exp_feat_param_success_index_none[] = { + 0x01, 0x00, /* Feature Count */ + 0x1c, 0xda, 0x47, 0x1c, 0x48, 0x6c, /* UUID - Debug */ + 0x01, 0xab, 0x9f, 0x46, 0xec, 0xb9, + 0x30, 0x25, 0x99, 0xd4, + 0x00, 0x00, 0x00, 0x00, /* Flags */ +}; + +static const struct generic_data read_exp_feat_success_index_none = { + .send_index_none = true, + .send_opcode = MGMT_OP_READ_EXP_FEATURES_INFO, + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = read_exp_feat_param_success_index_none, + .expect_len = sizeof(read_exp_feat_param_success_index_none), +}; + static uint16_t settings_powered_le_privacy[] = { MGMT_OP_SET_LE, MGMT_OP_SET_PRIVACY, MGMT_OP_SET_POWERED, 0 }; @@ -9720,6 +9737,20 @@ static const uint8_t set_exp_feat_rsp_param_ll_privacy[] = { 0x03, 0x00, 0x00, 0x00, /* Action - enable */ }; +static const uint8_t set_exp_feat_param_offload_codec[] = { + 0xaf, 0x29, 0xc6, 0x66, 0xac, 0x5f, /* UUID - Codec Offload */ + 0x1a, 0x88, 0xb9, 0x4f, 0x7f, 0xee, + 0xce, 0x5a, 0x69, 0xa6, + 0x01, /* Action - enable */ +}; + +static const uint8_t set_exp_feat_rsp_param_offload_codec[] = { + 0xaf, 0x29, 0xc6, 0x66, 0xac, 0x5f, /* UUID - Codec Offload */ + 0x1a, 0x88, 0xb9, 0x4f, 0x7f, 0xee, + 0xce, 0x5a, 0x69, 0xa6, + 0x01, 0x00, 0x00, 0x00, /* Action - enable */ +}; + static const struct generic_data set_exp_feat_enable_ll_privacy = { .send_opcode = MGMT_OP_SET_EXP_FEATURE, .send_param = set_exp_feat_param_ll_privacy, @@ -9727,6 +9758,44 @@ static const struct generic_data set_exp_feat_enable_ll_privacy = { .expect_status = MGMT_STATUS_SUCCESS, .expect_param = set_exp_feat_rsp_param_ll_privacy, .expect_len = sizeof(set_exp_feat_rsp_param_ll_privacy), + .expect_alt_ev = MGMT_EV_EXP_FEATURE_CHANGE, + .expect_alt_ev_len = sizeof(struct mgmt_ev_exp_feature_changed), +}; + +static void read_exp_feature_callback(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + if (status != MGMT_STATUS_SUCCESS) { + tester_setup_failed(); + return; + } + + tester_print("Received Read Experimental Features Info"); + + tester_setup_complete(); +} + +static void setup_set_exp_feature_alt(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + /* Send the Read Experiemental Features Information command to receive + * the Experiemental Feature Changed event + */ + mgmt_send(data->mgmt_alt, MGMT_OP_READ_EXP_FEATURES_INFO, + data->mgmt_index, 0, NULL, + read_exp_feature_callback, NULL, NULL); +} + +static const struct generic_data set_exp_feat_offload_codec = { + .send_opcode = MGMT_OP_SET_EXP_FEATURE, + .send_param = set_exp_feat_param_offload_codec, + .send_len = sizeof(set_exp_feat_param_offload_codec), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = set_exp_feat_rsp_param_offload_codec, + .expect_len = sizeof(set_exp_feat_rsp_param_offload_codec), + .expect_alt_ev = MGMT_EV_EXP_FEATURE_CHANGE, + .expect_alt_ev_len = sizeof(struct mgmt_ev_exp_feature_changed), }; static const uint8_t set_exp_feat_param_disable[17] = { 0x00 }; @@ -12434,12 +12503,29 @@ int main(int argc, char *argv[]) test_bredrle50("Read Exp Feature - Success", &read_exp_feat_success, NULL, test_command_generic); + + /* MGMT_OP_READ_EXP_FEATURE + * Read Experimental features - success (Index None) + */ + test_bredrle50("Read Exp Feature - Success (Index None)", + &read_exp_feat_success_index_none, + NULL, test_command_generic); + /* MGMT_OP_SET_EXP_FEATURE * Enable LL Privacy */ test_bredrle50("Set Exp Feature - Enable LL Privacy", &set_exp_feat_enable_ll_privacy, - NULL, test_command_generic); + setup_set_exp_feature_alt, + test_command_generic); + + /* MGMT_OP_SET_EXP_FEATURE + * Offload Codec + */ + test_bredrle50("Set Exp Feature - Offload Codec", + &set_exp_feat_offload_codec, + setup_set_exp_feature_alt, + test_command_generic); /* MGMT_OP_SET_EXP_FEATURE * Disable all features by sending zero UUID From patchwork Wed Oct 6 20:13:00 2021 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: 12540505 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B350C433F5 for ; Wed, 6 Oct 2021 20:13:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8053E61152 for ; Wed, 6 Oct 2021 20:13:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230148AbhJFUO5 (ORCPT ); Wed, 6 Oct 2021 16:14:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230055AbhJFUO4 (ORCPT ); Wed, 6 Oct 2021 16:14:56 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11DC3C061746 for ; Wed, 6 Oct 2021 13:13:04 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id e7so3497393pgk.2 for ; Wed, 06 Oct 2021 13:13:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=78BcLNH5YsPrph0Xf3fOGBXV8okVPDtTAt2sMI3mByQ=; b=jgXMK42X8WwbSYFQo0VPRrwbBiPdIiGbOCS5sOAtZJoCMEOeeGG2UfcYb4BlOs67ey OgUAY4QBq1gizK9gtD6bJjKZTJfRs1d7ERIZnCmzykSDzx7aEi4JuelPbUgOd3E5uefc e96RUe8l5gSq/LzLblb8pFyNRN98bcvG6oHw3dXoqvd2fLRolbF11TszCeG68rBfbcjo yKZpksnEe/nugU1zoahOK1/xy2noy+xhEKB/BtDaPp1UaPkhpYk53Au3o+piXlhOostL KYIXiMLnyi2U+KitwVtxRW2xy80dC0KKtjXpPhzxbW4QeFiYWhdMdihXyB6rVHnM3xtu 7iUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=78BcLNH5YsPrph0Xf3fOGBXV8okVPDtTAt2sMI3mByQ=; b=aNxaEJ27tyIxMoTBQwLtg7qLEyEfH9z7OK+zSu9mzAI1obTh+HJIUoLdUc6W3SVG+b NlnRioPN8rpmriIEmPSuYJF18wwO5hyBo0Q1kjr7bgnXM113GMPc5plFov/ejG6o4RhK U9//3Nmy/xkaBPqtKrAjIB7PO9nLNEd6GG7s1W2L4yMnnr0EXFVC8CtZmnvc4Om0/cMY M2aXmoHHMu5+KQH5QsiI+V2wzK9zqEWXTuEfX1L+8FZnyP0SkZE6V7JWhGubszeXobYm rXo9t9/0sGlLt5ImND2xdXnqKmTARJnHfnwGfVPmDRjwXh7rM+EDgPb0bsaRVbFmJk9I oLdg== X-Gm-Message-State: AOAM530O9sRok0Zh1R04+Lb6f/vkG1a5scCwCjaGTxNatLdXjya7o23q WOvWa60KgSa6ONUDyNyWjYLO/Y7zKMZFoA== X-Google-Smtp-Source: ABdhPJxcdU++qXDsMbt0CLplY21QXoNP/Qd9yq40qktzU0XyK0AqYVItKGLei1jLOoQMMYEvtHry+w== X-Received: by 2002:a63:2bc3:: with SMTP id r186mr34083pgr.385.1633551183457; Wed, 06 Oct 2021 13:13:03 -0700 (PDT) Received: from han1-NUC8i7BEH.hsd1.or.comcast.net ([2601:1c0:6a01:d830:8e4c:2d64:6206:9120]) by smtp.gmail.com with ESMTPSA id b10sm16202006pfl.200.2021.10.06.13.13.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 13:13:02 -0700 (PDT) From: Tedd Ho-Jeong An To: linux-bluetooth@vger.kernel.org Subject: [BlueZ PATCH 3/3] tools/mgmt-tester: Add test case for suspend while discovering Date: Wed, 6 Oct 2021 13:13:00 -0700 Message-Id: <20211006201300.186055-3-hj.tedd.an@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211006201300.186055-1-hj.tedd.an@gmail.com> References: <20211006201300.186055-1-hj.tedd.an@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Tedd Ho-Jeong An This patch adds a test case for suspend while discovering state. --- tools/mgmt-tester.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c index 84d81c8ca..8fd82487d 100644 --- a/tools/mgmt-tester.c +++ b/tools/mgmt-tester.c @@ -10722,6 +10722,27 @@ static void test_suspend_resume_success_7(const void *test_data) test_command_generic(test_data); } +static const struct generic_data suspend_resume_success_8 = { + .setup_settings = settings_powered_le, + .send_opcode = MGMT_OP_START_DISCOVERY, + .send_param = start_discovery_le_param, + .send_len = sizeof(start_discovery_le_param), + .expect_status = MGMT_STATUS_SUCCESS, + .expect_param = start_discovery_le_param, + .expect_len = sizeof(start_discovery_le_param), + .expect_hci_command = BT_HCI_CMD_LE_SET_EXT_SCAN_ENABLE, + .expect_hci_param = start_discovery_valid_ext_scan_enable, + .expect_hci_len = sizeof(start_discovery_valid_ext_scan_enable), + .expect_alt_ev = MGMT_EV_CONTROLLER_SUSPEND, + .expect_alt_ev_param = suspend_state_param_disconnect, + .expect_alt_ev_len = sizeof(suspend_state_param_disconnect), +}; + +static void test_suspend_resume_success_8(const void *test_data) +{ + test_command_generic(test_data); + tester_wait(1, trigger_force_suspend, NULL); +} int main(int argc, char *argv[]) { @@ -12497,6 +12518,15 @@ int main(int argc, char *argv[]) &suspend_resume_success_7, NULL, test_suspend_resume_success_7); + /* Suspend/Resume + * Setup : Power on + * Run: Start discover and enable suspend + * Expect: Receive the Suspend Event + */ + test_bredrle50_full("Suspend/Resume - Success 8 (Discovering)", + &suspend_resume_success_8, + NULL, test_suspend_resume_success_8, 4); + /* MGMT_OP_READ_EXP_FEATURE * Read Experimental features - success */