Changed BLE notify_callback from raw function pointer to std::function (#4737)

This commit is contained in:
Michael 2021-02-16 21:10:04 +01:00 committed by GitHub
parent 9be784f69b
commit 1ab550f6f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,7 @@
#if defined(CONFIG_BT_ENABLED)
#include <string>
#include <functional>
#include <esp_gattc_api.h>
@ -21,8 +22,7 @@
class BLERemoteService;
class BLERemoteDescriptor;
typedef void (*notify_callback)(BLERemoteCharacteristic* pBLERemoteCharacteristic, uint8_t* pData, size_t length, bool isNotify);
typedef std::function<void(BLERemoteCharacteristic* pBLERemoteCharacteristic, uint8_t* pData, size_t length, bool isNotify)> notify_callback;
/**
* @brief A model of a remote %BLE characteristic.
*/