summaryrefslogtreecommitdiff
path: root/emulator
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2021-02-26 17:00:49 -0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2021-03-02 16:22:25 -0800
commit9e627576f0ce8933143df7fd51d19971f9ae53dd (patch)
tree14fcaf5534224bf4fe24cf9a7e58e3d1ec555425 /emulator
parentc4aec697076a986d5a6e9e57b4f03572d27c6c2d (diff)
downloadbluez-9e627576f0ce8933143df7fd51d19971f9ae53dd.tar.gz
btdev: Add support Read Local Supported Controller Delay
> HCI Event: Command Complete (0x0e) plen 68 Read Local Supported Commands (0x04|0x0002) ncmd 1 Status: Success (0x00) Commands: 168 entries ... Read Local Supported Controller Delay (Octet 45 - Bit 4)
Diffstat (limited to 'emulator')
-rw-r--r--emulator/btdev.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/emulator/btdev.c b/emulator/btdev.c
index efc9e411b..3d0d422b6 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -4661,6 +4661,22 @@ static int cmd_read_local_codec_caps(struct btdev *dev, const void *data,
return 0;
}
+static int cmd_read_local_ctrl_delay(struct btdev *dev, const void *data,
+ uint8_t len)
+{
+ const struct bt_hci_cmd_read_local_ctrl_delay *cmd = data;
+ struct bt_hci_rsp_read_local_ctrl_delay 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_CTRL_DELAY, &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), \
@@ -4687,7 +4703,9 @@ static int cmd_read_local_codec_caps(struct btdev *dev, const void *data,
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_CODEC_CAPS, cmd_read_local_codec_caps, 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)
static const struct btdev_cmd cmd_le_5_2[] = {
CMD_COMMON_ALL,
@@ -4723,6 +4741,7 @@ static void set_le_52_commands(struct btdev *btdev)
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->commands[45] |= 0x10; /* Read Local Supported Ctrl Delay */
btdev->cmds = cmd_le_5_2;
}