Diff between 9180ceb0c36a65971596fb3efc70b2e958f2327b and a0d075072dbc21f005408bbeafc68ba26991e80e

Changed Files

File Additions Deletions Status
emulator/btdev.c +19 -1 modified

Full Patch

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 7fc8efe..c4b132a 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -4645,6 +4645,22 @@ static int cmd_read_local_codecs_v2(struct btdev *dev, const void *data,
 	return 0;
 }
 
+static int cmd_read_local_codec_caps(struct btdev *dev, const void *data,
+						uint8_t len)
+{
+	const struct bt_hci_cmd_read_local_codec_caps *cmd = data;
+	struct bt_hci_rsp_read_local_codec_caps rsp;
+
+	memset(&rsp, 0, sizeof(rsp));
+
+	if (cmd->codec_id > 0x05)
+		rsp.status = BT_HCI_ERR_INVALID_PARAMETERS;
+
+	cmd_complete(dev, BT_HCI_CMD_READ_LOCAL_CODEC_CAPS, &rsp, sizeof(rsp));
+
+	return 0;
+}
+
 #define CMD_LE_52 \
 	CMD(BT_HCI_CMD_LE_READ_BUFFER_SIZE_V2, cmd_read_size_v2, NULL), \
 	CMD(BT_HCI_CMD_LE_READ_ISO_TX_SYNC, cmd_read_iso_tx_sync, NULL), \
@@ -4670,7 +4686,8 @@ static int cmd_read_local_codecs_v2(struct btdev *dev, const void *data,
 					NULL), \
 	CMD(BT_HCI_CMD_LE_ISO_TEST_END, cmd_iso_test_end, NULL), \
 	CMD(BT_HCI_CMD_LE_SET_HOST_FEATURE, cmd_set_host_feature, NULL), \
-	CMD(BT_HCI_CMD_READ_LOCAL_CODECS_V2, cmd_read_local_codecs_v2, NULL)
+	CMD(BT_HCI_CMD_READ_LOCAL_CODECS_V2, cmd_read_local_codecs_v2, NULL), \
+	CMD(BT_HCI_CMD_READ_LOCAL_CODEC_CAPS, cmd_read_local_codec_caps, NULL)
 
 static const struct btdev_cmd cmd_le_5_2[] = {
 	CMD_COMMON_ALL,
@@ -4705,6 +4722,7 @@ static void set_le_52_commands(struct btdev *btdev)
 	btdev->commands[44] |= 0x01;	/* LE ISO Test End */
 	btdev->commands[44] |= 0x02;	/* LE ISO Set Host Feature */
 	btdev->commands[45] |= 0x04;	/* Read Local Supported Codecs v2 */
+	btdev->commands[45] |= 0x08;	/* Read Local Supported Codecs Caps */
 	btdev->cmds = cmd_le_5_2;
 }