forked from h2zero/esp-nimble-cpp
Add clearAll parameter to deinit() (#22)
* Add clearAll parameter to deinit() Adds the ability to clear all resources consumed during BLE operation when deinitializing and shutting down BLE. Useful when BLE is used intermittently or in a task that initializes, performs operations then deinitializes. By setting the clearAll parameter to true all created BLE objects will be deleted, freeing the memory for other tasks. Warning: This will invalidate any pointers that may be referencing the deleted objects. * Add bool deleteCallbacks parameter to NimBLEServer::setCallbacks, if true (default) will delete the callback class when server is destructed. * Delete scan results when scan is destructed.
This commit is contained in:
+3
-1
@@ -44,7 +44,8 @@ public:
|
||||
void removeService(NimBLEService* service, bool deleteSvc = false);
|
||||
void addService(NimBLEService* service);
|
||||
NimBLEAdvertising* getAdvertising();
|
||||
void setCallbacks(NimBLEServerCallbacks* pCallbacks);
|
||||
void setCallbacks(NimBLEServerCallbacks* pCallbacks,
|
||||
bool deleteCallbacks = true);
|
||||
void startAdvertising();
|
||||
void stopAdvertising();
|
||||
void start();
|
||||
@@ -70,6 +71,7 @@ private:
|
||||
bool m_advertiseOnDisconnect;
|
||||
bool m_svcChanged;
|
||||
NimBLEServerCallbacks* m_pServerCallbacks;
|
||||
bool m_deleteCallbacks;
|
||||
std::vector<uint16_t> m_connectedPeersVec;
|
||||
|
||||
// uint16_t m_svcChgChrHdl; // Future use
|
||||
|
||||
Reference in New Issue
Block a user