mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2026-01-27 17:42:24 +01:00
Add new getServer() method.
Previously we used createServer() to get a reference to the server instance. This was problematic when using advertising only as it would create a server when starting advertising. This prevents that and provides better semantics.
This commit is contained in:
@@ -77,6 +77,15 @@ NimBLESecurityCallbacks* NimBLEDevice::m_securityCallbacks = nullptr;
|
||||
|
||||
return m_pServer;
|
||||
} // createServer
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get the instance of the server.
|
||||
* @return A pointer to the server instance.
|
||||
*/
|
||||
/* STATIC */ NimBLEServer* NimBLEDevice::getServer() {
|
||||
return m_pServer;
|
||||
} // getServer
|
||||
#endif // #if defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user