Make attribute delete functions public and selective by UUID

* Make remote attribute delete functions public.

* Rename clear...() functions to delete...(), with ... equals Service(-s), Characteristic(-s) or Descriptor(-s), depending on what the function actually deletes
This commit is contained in:
h2zero
2020-05-29 21:21:56 -06:00
parent ffcb325aea
commit 143631d327
6 changed files with 95 additions and 21 deletions
+3 -1
View File
@@ -21,6 +21,7 @@
#if defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL)
#include "NimBLEAddress.h"
#include "NimBLEUUID.h"
#include "NimBLEAdvertisedDevice.h"
#include "NimBLERemoteService.h"
@@ -52,6 +53,8 @@ public:
std::vector<NimBLERemoteService*>::iterator end();
NimBLERemoteService* getService(const char* uuid);
NimBLERemoteService* getService(const NimBLEUUID &uuid);
void deleteServices();
size_t deleteService(const NimBLEUUID &uuid);
std::string getValue(const NimBLEUUID &serviceUUID, const NimBLEUUID &characteristicUUID);
bool setValue(const NimBLEUUID &serviceUUID, const NimBLEUUID &characteristicUUID,
const std::string &value);
@@ -82,7 +85,6 @@ private:
const struct ble_gatt_error *error,
const struct ble_gatt_svc *service,
void *arg);
void clearServices();
bool retrieveServices(const NimBLEUUID *uuid_filter = nullptr);
NimBLEAddress m_peerAddress = NimBLEAddress("");