From 4ecfaad99c08ce66379769e8c784ea30c8522eb8 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 2 Mar 2021 15:09:13 -0800 Subject: [PATCH] btdev: Add support for Configure Data Path > HCI Event: Command Complete (0x0e) plen 68 Read Local Supported Commands (0x04|0x0002) ncmd 1 Status: Success (0x00) Commands: 169 entries ... Configure Data Path (Octet 45 - Bit 5) Signed-off-by: Anuj Jain Signed-off-by: Ayush Garg --- emulator/btdev.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/emulator/btdev.c b/emulator/btdev.c index 3d0d422..93c038e 100755 --- a/emulator/btdev.c +++ b/emulator/btdev.c @@ -4677,6 +4677,20 @@ static int cmd_read_local_ctrl_delay(struct btdev *dev, const void *data, return 0; } +static int cmd_config_data_path(struct btdev *dev, const void *data, + uint8_t len) +{ + const struct bt_hci_cmd_config_data_path *cmd = data; + uint8_t status = BT_HCI_ERR_SUCCESS; + + if (cmd->id > 0x05) + status = BT_HCI_ERR_INVALID_PARAMETERS; + + cmd_complete(dev, BT_HCI_CMD_CONFIG_DATA_PATH, &status, sizeof(status)); + + 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), \ @@ -4705,7 +4719,9 @@ static int cmd_read_local_ctrl_delay(struct btdev *dev, const void *data, 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), \ - CMD(BT_HCI_CMD_READ_LOCAL_CTRL_DELAY, cmd_read_local_ctrl_delay, NULL) + CMD(BT_HCI_CMD_READ_LOCAL_CTRL_DELAY, cmd_read_local_ctrl_delay, \ + NULL), \ + CMD(BT_HCI_CMD_CONFIG_DATA_PATH, cmd_config_data_path, NULL) static const struct btdev_cmd cmd_le_5_2[] = { CMD_COMMON_ALL, @@ -4742,6 +4758,7 @@ static void set_le_52_commands(struct btdev *btdev) btdev->commands[45] |= 0x04; /* Read Local Supported Codecs v2 */ btdev->commands[45] |= 0x08; /* Read Local Supported Codecs Caps */ btdev->commands[45] |= 0x10; /* Read Local Supported Ctrl Delay */ + btdev->commands[45] |= 0x20; /* Config Data Path */ btdev->cmds = cmd_le_5_2; } -- 2.7.4