18#ifndef NIMBLE_CPP_UTILS_H_
19#define NIMBLE_CPP_UTILS_H_
22#if defined(CONFIG_BT_ENABLED)
33 NimBLETaskData(
void* pInstance =
nullptr,
int flags = 0,
void* buf =
nullptr);
35 void* m_pInstance{
nullptr};
36 mutable int m_flags{0};
37 void* m_pBuf{
nullptr};
40 mutable void* m_pHandle{
nullptr};
50 static std::string
dataToHexString(
const uint8_t* source, uint8_t length);
A BLE device address.
Definition NimBLEAddress.h:41
A BLE Utility class with methods for debugging and general purpose use.
Definition NimBLEUtils.h:47
static std::string dataToHexString(const uint8_t *source, uint8_t length)
Create a hexadecimal string representation of the input data.
Definition NimBLEUtils.cpp:546
static bool taskWait(const NimBLETaskData &taskData, uint32_t timeout)
Blocks the calling task until released or timeout.
Definition NimBLEUtils.cpp:90
static NimBLEAddress generateAddr(bool nrpa)
Generate a random BLE address.
Definition NimBLEUtils.cpp:565
static const char * advTypeToString(uint8_t advType)
Convert the advertising type flag to a string.
Definition NimBLEUtils.cpp:428
static void taskRelease(const NimBLETaskData &taskData, int rc=0)
Release a task.
Definition NimBLEUtils.cpp:117
static const char * returnCodeToString(int rc)
Converts a return code from the NimBLE stack to a text string.
Definition NimBLEUtils.cpp:133
static const char * gapEventToString(uint8_t eventType)
Convert a GAP event type to a string representation.
Definition NimBLEUtils.cpp:455
A structure to hold data for a task that is waiting for a response.
Definition NimBLEUtils.h:32
~NimBLETaskData()
Destructor.
Definition NimBLEUtils.cpp:75