esp-nimble-cpp  1.4.1
NimBLEUtils Class Reference

A BLE Utility class with methods for debugging and general purpose use. More...

Static Public Member Functions

static void dumpGapEvent (ble_gap_event *event, void *arg)
 Utility function to log the gap event info. More...
 
static const char * gapEventToString (uint8_t eventType)
 Convert a GAP event type to a string representation. More...
 
static char * buildHexData (uint8_t *target, const uint8_t *source, uint8_t length)
 Create a hex representation of data. More...
 
static const char * advTypeToString (uint8_t advType)
 Convert the advertising type flag to a string. More...
 
static const char * returnCodeToString (int rc)
 Converts a return code from the NimBLE stack to a text string. More...
 
static int checkConnParams (ble_gap_conn_params *params)
 A function for checking validity of connection parameters. More...
 

Detailed Description

A BLE Utility class with methods for debugging and general purpose use.

Member Function Documentation

◆ advTypeToString()

const char * NimBLEUtils::advTypeToString ( uint8_t  advType)
static

Convert the advertising type flag to a string.

Parameters
advTypeThe type to convert.
Returns
A string representation of the advertising flags.

◆ buildHexData()

char * NimBLEUtils::buildHexData ( uint8_t *  target,
const uint8_t *  source,
uint8_t  length 
)
static

Create a hex representation of data.

Parameters
[in]targetWhere to write the hex string. If this is null, we malloc storage.
[in]sourceThe start of the binary data.
[in]lengthThe length of the data to convert.
Returns
A pointer to the formatted buffer.

◆ checkConnParams()

int NimBLEUtils::checkConnParams ( ble_gap_conn_params *  params)
static

A function for checking validity of connection parameters.

Parameters
[in]paramsA pointer to the structure containing the parameters to check.
Returns
valid == 0 or error code.

◆ dumpGapEvent()

void NimBLEUtils::dumpGapEvent ( ble_gap_event *  event,
void *  arg 
)
static

Utility function to log the gap event info.

Parameters
[in]eventA pointer to the gap event structure.
[in]argUnused.

◆ gapEventToString()

const char * NimBLEUtils::gapEventToString ( uint8_t  eventType)
static

Convert a GAP event type to a string representation.

Parameters
[in]eventTypeThe type of event.
Returns
A string representation of the event type.

◆ returnCodeToString()

const char * NimBLEUtils::returnCodeToString ( int  rc)
static

Converts a return code from the NimBLE stack to a text string.

Parameters
[in]rcThe return code to convert.
Returns
A string representation of the return code.