From a83d698f5aa5cdf571ad043d406748c4e9f5a41a Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 26 Feb 2014 19:10:52 +0200 Subject: [PATCH] emulator: Add HCI_LE_Set_Random_Address support --- emulator/btdev.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/emulator/btdev.c b/emulator/btdev.c index c7231ddb4..e39b0cc7f 100644 --- a/emulator/btdev.c +++ b/emulator/btdev.c @@ -81,6 +81,7 @@ struct btdev { uint16_t acl_max_pkt; uint8_t country_code; uint8_t bdaddr[6]; + uint8_t random_addr[6]; uint8_t le_features[8]; uint8_t le_states[8]; @@ -1493,6 +1494,7 @@ static void default_cmd(struct btdev *btdev, uint16_t opcode, const struct bt_hci_cmd_write_secure_conn_support *wscs; 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_data *lsad; const struct bt_hci_cmd_setup_sync_conn *ssc; const struct bt_hci_cmd_write_ssp_debug_mode *wsdm; @@ -2269,6 +2271,15 @@ static void default_cmd(struct btdev *btdev, uint16_t opcode, cmd_complete(btdev, opcode, &lrlf, sizeof(lrlf)); break; + case BT_HCI_CMD_LE_SET_RANDOM_ADDRESS: + if (btdev->type == BTDEV_TYPE_BREDR) + goto unsupported; + lsra = data; + memcpy(btdev->random_addr, lsra->addr, 6); + status = BT_HCI_ERR_SUCCESS; + cmd_complete(btdev, opcode, &status, sizeof(status)); + break; + case BT_HCI_CMD_LE_SET_ADV_PARAMETERS: if (btdev->type == BTDEV_TYPE_BREDR) goto unsupported; -- 2.47.3