forked from h2zero/esp-nimble-cpp
Add register for notify without callback
* Add subscribe() and unsubscribe() methods to replace registerForNotify() in NimBLERemoteCharacteristic. * registerForNotify() remains as a (depreciated) method.
This commit is contained in:
1 parent
7983c0e50e
commit
f624deacb5
2 files changed
+65
-25
No files matched your search
@@ -78,9 +78,13 @@ public:
|
||||
return *((T *)pData);
|
||||
}
|
||||
|
||||
bool registerForNotify(notify_callback _callback,
|
||||
bool subscribe(bool notifications = true,
|
||||
bool response = true,
|
||||
notify_callback notifyCallback = nullptr);
|
||||
bool unsubscribe(bool response = true);
|
||||
bool registerForNotify(notify_callback notifyCallback,
|
||||
bool notifications = true,
|
||||
bool response = true);
|
||||
bool response = true) __attribute__ ((deprecated));
|
||||
bool writeValue(const uint8_t* data,
|
||||
size_t length,
|
||||
bool response = false);
|
||||
@@ -100,6 +104,7 @@ private:
|
||||
friend class NimBLERemoteDescriptor;
|
||||
|
||||
// Private member functions
|
||||
bool setNotify(uint16_t val, bool response = true, notify_callback notifyCallback = nullptr);
|
||||
bool retrieveDescriptors(const NimBLEUUID *uuid_filter = nullptr);
|
||||
static int onReadCB(uint16_t conn_handle, const struct ble_gatt_error *error,
|
||||
struct ble_gatt_attr *attr, void *arg);
|
||||
|
||||
Reference in new issue
Block a user