Add service isStarted method, remove abort in NimBLEServer::start.

This commit is contained in:
h2zero 2024-06-14 14:10:37 -06:00 committed by h2zero
parent 792359b510
commit bd29e738bd
2 changed files with 4 additions and 2 deletions

View file

@ -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
}
}

View file

@ -44,7 +44,7 @@ public:
uint16_t getHandle();
std::string toString();
void dump();
bool isStarted() { return m_pSvcDef != nullptr; }
bool start();
NimBLECharacteristic* createCharacteristic(const char* uuid,