summaryrefslogtreecommitdiff
path: root/emulator/le.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-12-17 14:26:53 +0100
committerMarcel Holtmann <marcel@holtmann.org>2014-12-17 14:26:53 +0100
commit907c8dac83568ba81427ca091e3f99f1ba203e4d (patch)
tree546f13482c78989a279dc1b0e67ead7d795e9d1a /emulator/le.c
parent7763bea0dfb442dd88a489a9db8a520e322b920d (diff)
downloadbluez-907c8dac83568ba81427ca091e3f99f1ba203e4d.tar.gz
emulator: Fix own address type handling for advertising parameters
Diffstat (limited to 'emulator/le.c')
-rw-r--r--emulator/le.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/emulator/le.c b/emulator/le.c
index 849b5368a..6a3b2aa77 100644
--- a/emulator/le.c
+++ b/emulator/le.c
@@ -379,10 +379,16 @@ static void send_adv_pkt(struct bt_le *hci)
memset(&pkt, 0, sizeof(pkt));
pkt.pdu_type = hci->le_adv_type;
pkt.tx_addr_type = hci->le_adv_own_addr_type;
- if (hci->le_adv_own_addr_type == 0x00)
+ switch (hci->le_adv_own_addr_type) {
+ case 0x00:
+ case 0x02:
memcpy(pkt.tx_addr, hci->bdaddr, 6);
- else
+ break;
+ case 0x01:
+ case 0x03:
memcpy(pkt.tx_addr, hci->le_random_addr, 6);
+ break;
+ }
pkt.rx_addr_type = hci->le_adv_direct_addr_type;
memcpy(pkt.rx_addr, hci->le_adv_direct_addr, 6);
pkt.adv_data_len = hci->le_adv_data_len;