Diff between 6375533b7fed221a4d2df7c1ad25d4682e17c77e and 1b4a46fec31682843d849df219b1ee7cbef2c969

Changed Files

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

Full Patch

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 7d24e9a..3cf243d 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -113,6 +113,8 @@ struct btdev {
 	uint8_t  le_event_mask[8];
 	uint8_t  le_adv_data[31];
 	uint8_t  le_adv_data_len;
+	uint8_t  le_adv_type;
+	uint8_t  le_adv_own_addr;
 	uint8_t  le_scan_data[31];
 	uint8_t  le_scan_data_len;
 	uint8_t  le_scan_enable;
@@ -1498,6 +1500,7 @@ static void default_cmd(struct btdev *btdev, uint16_t opcode,
 	const struct bt_hci_cmd_set_event_mask_page2 *semp2;
 	const struct bt_hci_cmd_le_set_event_mask *lsem;
 	const struct bt_hci_cmd_le_set_random_address *lsra;
+	const struct bt_hci_cmd_le_set_adv_parameters *lsap;
 	const struct bt_hci_cmd_le_set_adv_data *lsad;
 	const struct bt_hci_cmd_le_set_scan_rsp_data *lssrd;
 	const struct bt_hci_cmd_setup_sync_conn *ssc;
@@ -2290,8 +2293,12 @@ static void default_cmd(struct btdev *btdev, uint16_t opcode,
 			goto unsupported;
 		if (btdev->le_adv_enable)
 			status = BT_HCI_ERR_COMMAND_DISALLOWED;
-		else
+		else {
 			status = BT_HCI_ERR_SUCCESS;
+			lsap = data;
+			btdev->le_adv_type = lsap->type;
+			btdev->le_adv_own_addr = lsap->own_addr_type;
+		}
 		cmd_complete(btdev, opcode, &status, sizeof(status));
 		break;