From 4dbe0476f2747f7334f34bae9fdeb5c33940f1cd Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 5 Apr 2024 13:52:43 +0200 Subject: [PATCH] gap: emit GAP_SUBEVENT_LE_CONNECTION_COMPLETE for failed outgoing connections --- CHANGELOG.md | 1 + src/hci.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4959fe715..1385b30f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - GAP: allow use of own address type different from gap_random_set_mode() incl. RPA in LE Extended Advertising +- GAP: emit GAP_SUBEVENT_LE_CONNECTION_COMPLETE for failed outgoing connections - SM: abort pairing with invalid parameter error for encryption key size > 16 - SM: ignore Security Request after re-encryption has started - SM: respond to Pairing Request after Identity Resolution failed diff --git a/src/hci.c b/src/hci.c index 26ef7ec28..319896c0e 100644 --- a/src/hci.c +++ b/src/hci.c @@ -3362,7 +3362,10 @@ static void hci_handle_le_connection_complete_event(const uint8_t * hci_event){ btstack_linked_list_remove(&hci_stack->connections, (btstack_linked_item_t *) conn); btstack_memory_hci_connection_free( conn ); } - return; + + // emit GAP_SUBEVENT_LE_CONNECTION_COMPLETE for error case + hci_emit_event(gap_event, sizeof(gap_event), 1); + return; } #endif