From c163146e41d858bcd94331e0e16e049ba35c1f6c Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 17 Aug 2020 18:39:05 +0200 Subject: [PATCH] hci: track outgoing connection address also for connect with whitelist --- src/hci.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/hci.c b/src/hci.c index bc498bca1..db02a096c 100644 --- a/src/hci.c +++ b/src/hci.c @@ -3812,10 +3812,6 @@ static bool hci_run_general_pending_commands(void){ default: #ifdef ENABLE_BLE #ifdef ENABLE_LE_CENTRAL - // track outgoing connection - hci_stack->outgoing_addr_type = connection->address_type; - (void)memcpy(hci_stack->outgoing_addr, - connection->address, 6); log_info("sending hci_le_create_connection"); hci_send_cmd(&hci_le_create_connection, hci_stack->le_connection_scan_interval, // conn scan interval @@ -4375,6 +4371,9 @@ int hci_send_cmd_packet(uint8_t *packet, int size){ log_error("Invalid initiator_filter_policy in LE Create Connection %u", initiator_filter_policy); break; } + // track outgoing connection + hci_stack->outgoing_addr_type = packet[8]; // peer addres type + reverse_bd_addr( &packet[9], hci_stack->outgoing_addr); // peer address break; case HCI_OPCODE_HCI_LE_CREATE_CONNECTION_CANCEL: hci_stack->le_connecting_state = LE_CONNECTING_IDLE;