From d68010fb9d28bba99d64c6b2e8c6c33d7e14803b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 7 Sep 2013 16:35:22 -0700 Subject: [PATCH] emulator: Add support for host buffer size and LE rand commands --- emulator/btdev.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/emulator/btdev.c b/emulator/btdev.c index 77d2c33bb..a51f3c6af 100644 --- a/emulator/btdev.c +++ b/emulator/btdev.c @@ -1030,6 +1030,7 @@ static void default_cmd(struct btdev *btdev, uint16_t opcode, struct bt_hci_rsp_le_read_adv_tx_power lratp; struct bt_hci_rsp_le_read_supported_states lrss; struct bt_hci_rsp_le_read_white_list_size lrwls; + struct bt_hci_rsp_le_rand lr; struct bt_hci_rsp_remote_name_request_cancel rnrc_rsp; uint8_t status, page; @@ -1324,6 +1325,11 @@ static void default_cmd(struct btdev *btdev, uint16_t opcode, cmd_complete(btdev, opcode, &status, sizeof(status)); break; + case BT_HCI_CMD_HOST_BUFFER_SIZE: + status = BT_HCI_ERR_SUCCESS; + cmd_complete(btdev, opcode, &status, sizeof(status)); + break; + case BT_HCI_CMD_READ_INQUIRY_MODE: if (btdev->type == BTDEV_TYPE_LE) goto unsupported; @@ -1641,7 +1647,7 @@ static void default_cmd(struct btdev *btdev, uint16_t opcode, case BT_HCI_CMD_LE_READ_WHITE_LIST_SIZE: if (btdev->type == BTDEV_TYPE_BREDR) goto unsupported; - lrwls.status = 0; + lrwls.status = BT_HCI_ERR_SUCCESS; lrwls.size = 0; cmd_complete(btdev, opcode, &lrwls, sizeof(lrwls)); break; @@ -1664,6 +1670,21 @@ static void default_cmd(struct btdev *btdev, uint16_t opcode, cmd_complete(btdev, opcode, &status, sizeof(status)); break; + case BT_HCI_CMD_LE_RAND: + if (btdev->type == BTDEV_TYPE_BREDR) + goto unsupported; + lr.status = BT_HCI_ERR_SUCCESS; + lr.number[0] = rand(); + lr.number[1] = rand(); + lr.number[2] = rand(); + lr.number[3] = rand(); + lr.number[4] = rand(); + lr.number[5] = rand(); + lr.number[6] = rand(); + lr.number[7] = rand(); + cmd_complete(btdev, opcode, &lr, sizeof(lr)); + break; + case BT_HCI_CMD_SETUP_SYNC_CONN: ssc = data; status = BT_HCI_ERR_SUCCESS; -- 2.47.3