From 6487225563f2ef8c56b1d007848d29bd2637687b Mon Sep 17 00:00:00 2001 From: h2zero Date: Wed, 13 Jan 2021 18:34:49 -0700 Subject: [PATCH] Call advertising stopped callback when the host re-synced. If the stack was reset and duration was not indefinite the callback for advertising stopped should be called when re-synced. --- src/NimBLEAdvertising.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/NimBLEAdvertising.cpp b/src/NimBLEAdvertising.cpp index b38ed16..710d073 100644 --- a/src/NimBLEAdvertising.cpp +++ b/src/NimBLEAdvertising.cpp @@ -541,6 +541,9 @@ void NimBLEAdvertising::onHostSync() { // If we were advertising forever, restart it now if(m_duration == 0) { start(m_duration, m_advCompCB); + } else { + // Otherwise we should tell the app that advertising stopped. + advCompleteCB(); } }