Skip to content

Commit 1c71460

Browse files
committed
Initialize advertising complete callback in NimBLEAdvertising constructor.
* cleanup advertising start return.
1 parent b806b5a commit 1c71460

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/NimBLEAdvertising.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ void NimBLEAdvertising::reset() {
6868
m_advDataSet = false;
6969
// Set this to non-zero to prevent auto start if host reset before started by app.
7070
m_duration = BLE_HS_FOREVER;
71+
m_advCompCB = nullptr;
7172
} // reset
7273

7374

@@ -653,12 +654,8 @@ bool NimBLEAdvertising::start(uint32_t duration, void (*advCompleteCB)(NimBLEAdv
653654
break;
654655
}
655656

656-
if(rc != 0) {
657-
return false;
658-
}
659-
660657
NIMBLE_LOGD(LOG_TAG, "<< Advertising start");
661-
return true;
658+
return (rc == 0);
662659
} // start
663660

664661

0 commit comments

Comments
 (0)