[Server] Implement remove Characteristics/Descriptors. (#54)

This allows for adding and removing of characteristics and descriptors after initial setup of the server.
When used it will send a service changed notification to all clients.
The changes will not take effect until all clients have disconnected and advertising restarted.
This commit is contained in:
h2zero
2021-07-30 20:56:52 -06:00
committed by GitHub
parent 0a2714c169
commit 6be6a111d0
8 changed files with 195 additions and 55 deletions
+2
View File
@@ -99,6 +99,7 @@ public:
NimBLEDescriptor* getDescriptorByUUID(const char* uuid);
NimBLEDescriptor* getDescriptorByUUID(const NimBLEUUID &uuid);
NimBLEDescriptor* getDescriptorByHandle(uint16_t handle);
void removeDescriptor(NimBLEDescriptor *pDescriptor, bool deleteDsc = false);
std::string getValue(time_t *timestamp = nullptr);
size_t getDataLength();
@@ -152,6 +153,7 @@ private:
std::vector<NimBLEDescriptor*> m_dscVec;
portMUX_TYPE m_valMux;
time_t m_timestamp;
uint8_t m_removed;
std::vector<std::pair<uint16_t, uint16_t>> m_subscribedVec;
}; // NimBLECharacteristic