Skip to content

Commit 4b91721

Browse files
Change notify_callback typedef to enable the usage of member function as callback (#123)
With this change the callback function could be also a member function
1 parent ae3be89 commit 4b91721

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/NimBLERemoteCharacteristic.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@
2424
#include "NimBLERemoteDescriptor.h"
2525

2626
#include <vector>
27+
#include <functional>
2728

2829
class NimBLERemoteService;
2930
class NimBLERemoteDescriptor;
3031

3132

32-
typedef void (*notify_callback)(NimBLERemoteCharacteristic* pBLERemoteCharacteristic,
33-
uint8_t* pData, size_t length, bool isNotify);
33+
typedef std::function<void (NimBLERemoteCharacteristic* pBLERemoteCharacteristic,
34+
uint8_t* pData, size_t length, bool isNotify)> notify_callback;
3435

3536
typedef struct {
3637
const NimBLEUUID *uuid;

0 commit comments

Comments
 (0)