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.
This commit is contained in:
h2zero 2021-01-13 18:34:49 -07:00
parent 5629f4d3e9
commit 6487225563

View file

@ -541,6 +541,9 @@ void NimBLEAdvertising::onHostSync() {
// If we were advertising forever, restart it now // If we were advertising forever, restart it now
if(m_duration == 0) { if(m_duration == 0) {
start(m_duration, m_advCompCB); start(m_duration, m_advCompCB);
} else {
// Otherwise we should tell the app that advertising stopped.
advCompleteCB();
} }
} }