mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2024-12-25 12:10:47 +01:00
Initialize advertising complete callback in NimBLEAdvertising constructor.
* cleanup advertising start return.
This commit is contained in:
parent
a4403fe6b8
commit
96459073a4
1 changed files with 2 additions and 5 deletions
|
@ -69,6 +69,7 @@ void NimBLEAdvertising::reset() {
|
|||
m_advDataSet = false;
|
||||
// Set this to non-zero to prevent auto start if host reset before started by app.
|
||||
m_duration = BLE_HS_FOREVER;
|
||||
m_advCompCB = nullptr;
|
||||
} // reset
|
||||
|
||||
|
||||
|
@ -654,12 +655,8 @@ bool NimBLEAdvertising::start(uint32_t duration, void (*advCompleteCB)(NimBLEAdv
|
|||
break;
|
||||
}
|
||||
|
||||
if(rc != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
NIMBLE_LOGD(LOG_TAG, "<< Advertising start");
|
||||
return true;
|
||||
return (rc == 0);
|
||||
} // start
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue