Skip to content

Commit

Permalink
Add service isStarted method, remove abort in NimBLEServer::start.
Browse files Browse the repository at this point in the history
  • Loading branch information
h2zero committed Jun 15, 2024
1 parent 068419d commit 7f6959c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/NimBLEServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ void NimBLEServer::start() {
if(svc->m_removed == 0) {
rc = ble_gatts_find_svc(&svc->getUUID().getNative()->u, &svc->m_handle);
if(rc != 0) {
abort();
NIMBLE_LOGW(LOG_TAG, "GATT Server started without service: %s, Service %s",
svc->getUUID().toString().c_str(), svc->isStarted() ? "missing" : "not started");
continue; // Skip this service as it was not started
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/NimBLEService.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class NimBLEService {
uint16_t getHandle();
std::string toString();
void dump();

bool isStarted() { return m_pSvcDef != nullptr; }
bool start();

NimBLECharacteristic* createCharacteristic(const char* uuid,
Expand Down

0 comments on commit 7f6959c

Please sign in to comment.