General utilities.
More...
#include <GeneralUtils.h>
|
static bool | base64Decode (const std::string &in, std::string *out) |
| Decode a chunk of data that is base64 encoded. More...
|
|
static bool | base64Encode (const std::string &in, std::string *out) |
| Encode a string into base 64. More...
|
|
static void | dumpInfo () |
| Dump general info to the log. Data includes: More...
|
|
static bool | endsWith (std::string str, char c) |
| Does the string end with a specific character? More...
|
|
static const char * | errorToString (esp_err_t errCode) |
| Convert an ESP error code to a string. More...
|
|
static const char * | wifiErrorToString (uint8_t value) |
| Convert a wifi_err_reason_t code to a string. More...
|
|
static void | hexDump (const uint8_t *pData, uint32_t length) |
| Dump a representation of binary data to the console. More...
|
|
static std::string | ipToString (uint8_t *ip) |
| Convert an IP address to string. More...
|
|
static std::vector< std::string > | split (std::string source, char delimiter) |
| Split a string into parts based on a delimiter. More...
|
|
static std::string | toLower (std::string &value) |
| Convert a string to lower case. More...
|
|
static std::string | trim (const std::string &str) |
| Remove white space from a string.
|
|
bool GeneralUtils::base64Decode |
( |
const std::string & |
in, |
|
|
std::string * |
out |
|
) |
| |
|
static |
Decode a chunk of data that is base64 encoded.
- Parameters
-
[in] | in | The string to be decoded. |
[out] | out | The resulting data. |
bool GeneralUtils::base64Encode |
( |
const std::string & |
in, |
|
|
std::string * |
out |
|
) |
| |
|
static |
Encode a string into base 64.
- Parameters
-
void GeneralUtils::dumpInfo |
( |
| ) |
|
|
static |
Dump general info to the log. Data includes:
bool GeneralUtils::endsWith |
( |
std::string |
str, |
|
|
char |
c |
|
) |
| |
|
static |
Does the string end with a specific character?
- Parameters
-
[in] | str | The string to examine. |
[in] | c | The character to look form. |
- Returns
- True if the string ends with the given character.
const char * GeneralUtils::errorToString |
( |
esp_err_t |
errCode | ) |
|
|
static |
Convert an ESP error code to a string.
- Parameters
-
[in] | errCode | The errCode to be converted. |
- Returns
- A string representation of the error code.
void GeneralUtils::hexDump |
( |
const uint8_t * |
pData, |
|
|
uint32_t |
length |
|
) |
| |
|
static |
Dump a representation of binary data to the console.
- Parameters
-
[in] | pData | Pointer to the start of data to be logged. |
[in] | length | Length of the data (in bytes) to be logged. |
- Returns
- N/A.
std::string GeneralUtils::ipToString |
( |
uint8_t * |
ip | ) |
|
|
static |
Convert an IP address to string.
- Parameters
-
- Returns
- A string representation of the IP address.
std::vector< std::string > GeneralUtils::split |
( |
std::string |
source, |
|
|
char |
delimiter |
|
) |
| |
|
static |
Split a string into parts based on a delimiter.
- Parameters
-
[in] | source | The source string to split. |
[in] | delimiter | The delimiter characters. |
- Returns
- A vector of strings that are the split of the input.
std::string GeneralUtils::toLower |
( |
std::string & |
value | ) |
|
|
static |
Convert a string to lower case.
- Parameters
-
[in] | value | The string to convert to lower case. |
- Returns
- A lower case representation of the string.
const char * GeneralUtils::wifiErrorToString |
( |
uint8_t |
errCode | ) |
|
|
static |
Convert a wifi_err_reason_t code to a string.
- Parameters
-
[in] | errCode | The errCode to be converted. |
- Returns
- A string representation of the error code.
- Note
- : wifi_err_reason_t values as of April 2018 are: (1-24, 200-204) and are defined in ~/esp-idf/components/esp32/include/esp_wifi_types.h.
The documentation for this class was generated from the following files: