linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kiran K <kiran.k@intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: ravishankar.srivatsa@intel.com, chethan.tumkur.narayan@intel.com,
	luiz.von.dentz@intel.com, Kiran K <kiran.k@intel.com>
Subject: [PATCH v2 3/9] mgmt: Set MSFT offload codec feature
Date: Fri, 19 Nov 2021 15:12:29 +0530	[thread overview]
Message-ID: <20211119094235.2432-3-kiran.k@intel.com> (raw)
In-Reply-To: <20211119094235.2432-1-kiran.k@intel.com>

Add support to toggle msft offload codec feature.
---
 tools/btmgmt.c | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/tools/btmgmt.c b/tools/btmgmt.c
index 42ef9acefaea..3d76269b178a 100644
--- a/tools/btmgmt.c
+++ b/tools/btmgmt.c
@@ -2597,6 +2597,46 @@ static void cmd_exp_offload_codecs(int argc, char **argv)
 	}
 }
 
+static void exp_msft_offload_rsp(uint8_t status, uint16_t len,
+				 const void *param, void *user_data)
+{
+	if (status != 0)
+		error("Set MSFT offload codec failed with status 0x%02x (%s)",
+		      status, mgmt_errstr(status));
+	else
+		print("MSFT Offload codec feature successfully set");
+
+	bt_shell_noninteractive_quit(EXIT_SUCCESS);
+}
+
+static void cmd_exp_msft_offload_codecs(int argc, char **argv)
+{
+	/* 0cc2131f-96f0-4cd1-b313-b97e7cbc8335 */
+	static const uint8_t uuid[16] = {
+				0x35, 0x83, 0xbc, 0x7c, 0x7e, 0xb9, 0x13, 0xb3,
+				0xd1, 0x4c, 0xf0, 0x96, 0x1f, 0x13, 0xc2, 0x0c,
+	};
+	struct mgmt_cp_set_exp_feature cp;
+	uint8_t val;
+	uint16_t index;
+
+	if (parse_setting(argc, argv, &val) == false)
+		return bt_shell_noninteractive_quit(EXIT_FAILURE);
+
+	index = mgmt_index;
+	if (index == MGMT_INDEX_NONE)
+		index = 0;
+
+	memset(&cp, 0, sizeof(cp));
+	memcpy(cp.uuid, uuid, 16);
+	cp.action = val;
+
+	if (mgmt_send(mgmt, MGMT_OP_SET_EXP_FEATURE, index, sizeof(cp), &cp,
+		      exp_msft_offload_rsp, NULL, NULL) == 0) {
+		error("Unable to send msft offload codecs feature cmd");
+		return bt_shell_noninteractive_quit(EXIT_FAILURE);
+	}
+}
 static void class_rsp(uint16_t op, uint16_t id, uint8_t status, uint16_t len,
 							const void *param)
 {
@@ -5640,6 +5680,8 @@ static const struct bt_shell_menu main_menu = {
 		"Set bluetooth quality report feature"			},
 	{ "exp-offload",		"<on/off>",
 		cmd_exp_offload_codecs,	"Toggle codec support"		},
+	{ "exp-msft-offload",		"<on/off>",
+		cmd_exp_msft_offload_codecs, "Toggle msft codec support"},
 	{ "read-sysconfig",	NULL,
 		cmd_read_sysconfig,	"Read System Configuration"	},
 	{ "set-sysconfig",	"<-v|-h> [options...]",
-- 
2.17.1


  parent reply	other threads:[~2021-11-19  9:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19  9:42 [PATCH v2 1/9] adapter: Enable MSFT a2dp offload codec when Experimental is set Kiran K
2021-11-19  9:42 ` [PATCH v2 2/9] shared/util: Decode MSFT offload codec UUID Kiran K
2021-11-19  9:42 ` Kiran K [this message]
2021-11-19  9:42 ` [PATCH v2 4/9] adapter: API to check if MSFT a2dp codec is enabled Kiran K
2021-11-19  9:42 ` [PATCH v2 5/9] avdtp: Add a flag in struct avdtp to control MSFT a2dp offload Kiran K
2021-11-19  9:42 ` [PATCH v2 6/9] avdtp: Add support for offload MSFT open command Kiran K
2021-11-19  9:42 ` [PATCH v2 7/9] avdtp: Add support for MSFT offload start command Kiran K
2021-11-19  9:42 ` [PATCH v2 8/9] avdtp: Add support for MSFT offload suspend command Kiran K
2021-11-19  9:42 ` [PATCH v2 9/9] avdtp: Add support for MSFT offload close command Kiran K
2021-11-19  9:55 ` [v2,1/9] adapter: Enable MSFT a2dp offload codec when Experimental is set bluez.test.bot
2021-11-19 10:06 ` [PATCH v2 1/9] " Marcel Holtmann
2021-11-19 10:10   ` K, Kiran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211119094235.2432-3-kiran.k@intel.com \
    --to=kiran.k@intel.com \
    --cc=chethan.tumkur.narayan@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.von.dentz@intel.com \
    --cc=ravishankar.srivatsa@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).