From 1b4a46fec31682843d849df219b1ee7cbef2c969 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 11 Mar 2014 14:10:49 +0200 Subject: [PATCH] emulator/btdev: Store LE adv params for later use --- emulator/btdev.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/emulator/btdev.c b/emulator/btdev.c index 7d24e9a9f..3cf243db8 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; -- 2.47.3