Diff between 9e0ddbe9a710e95ade10ad644ce10be6565f83a8 and d68010fb9d28bba99d64c6b2e8c6c33d7e14803b

Changed Files

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

Full Patch

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 77d2c33..a51f3c6 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;