diff --git a/src/NimBLEService.cpp b/src/NimBLEService.cpp index 02195ac..8055869 100644 --- a/src/NimBLEService.cpp +++ b/src/NimBLEService.cpp @@ -434,4 +434,13 @@ NimBLEServer* NimBLEService::getServer() { return NimBLEDevice::getServer(); }// getServer + +/** + * @brief Checks if the service has been started. + * @return True if the service has been started. + */ +bool NimBLEService::isStarted() { + return m_pSvcDef != nullptr; +} + #endif /* CONFIG_BT_ENABLED && CONFIG_BT_NIMBLE_ROLE_PERIPHERAL */ diff --git a/src/NimBLEService.h b/src/NimBLEService.h index 6f33016..73cbd87 100644 --- a/src/NimBLEService.h +++ b/src/NimBLEService.h @@ -44,7 +44,7 @@ public: uint16_t getHandle(); std::string toString(); void dump(); - bool isStarted() { return m_pSvcDef != nullptr; } + bool isStarted(); bool start(); NimBLECharacteristic* createCharacteristic(const char* uuid,