From b7c6120f3b2ea4d5446cb5171e624ca8461ab199 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Wed, 19 Mar 2025 17:54:37 +0100 Subject: [PATCH] fix(HCI): SetAdvertise only if enabled Signed-off-by: Frederic Pillon --- src/utility/HCI.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utility/HCI.cpp b/src/utility/HCI.cpp index 1f933c1c..af73ead2 100644 --- a/src/utility/HCI.cpp +++ b/src/utility/HCI.cpp @@ -832,7 +832,10 @@ void HCIClass::handleEventPkt(uint8_t /*plen*/, uint8_t pdata[]) ATT.removeConnection(disconnComplete->handle, disconnComplete->reason); L2CAPSignaling.removeConnection(disconnComplete->handle, disconnComplete->reason); - HCI.leSetAdvertiseEnable(0x01); + if (GAP.advertising()) + { + HCI.leSetAdvertiseEnable(0x01); + } } else if (eventHdr->evt == EVT_ENCRYPTION_CHANGE) {