Err class

Wrapper around ESP_ERR to simplify usage and reduce boilerplate code.

Public types

enum Flag: unsigned { ErrFAIL = 0x000, ErrOK = 0x001, NO_MEM = 0x002, INVALID_ARG = 0x004, INVALID_STATE = 0x008, INVALID_SIZE = 0x010, NOT_FOUND = 0x020, NOT_SUPPORTED = 0x040, TIMEOUT = 0x080, INVALID_RESPONSE = 0x100, INVALID_CRC = 0x200, INVALID_VERSION = 0x400, INVALID_MAC = 0x800 }

Public static functions

static auto convert(esp_err_t err, Flag valid = ErrOK) -> Flag

Constructors, destructors, conversion operators

Err(Flag value)
Err(esp_err_t err, Flag valid = ErrOK)
operator uint16_t() const
operator bool() const

Enum documentation

enum Err::Flag: unsigned

The main error flags.

Function documentation

static Flag Err::convert(esp_err_t err, Flag valid = ErrOK)

Parameters
err the original ESP error
valid bitwise OR-ed valid Flags
Returns the Flag representation of esp_err_t

Converts an esp_err_t to a Flag.

Err::Err(Flag value)

Parameters
value the Flag

Creates an error directly from a Flag.

Err::Err(esp_err_t err, Flag valid = ErrOK)

Parameters
err the ESP error
valid bitwise OR-ed Flags indicating a valid response

Creates an error from a C-style esp_err_t.

Err::operator uint16_t() const

Returns this value as uint16_t

Converts this error to uint16_t.

Err::operator bool() const

Returns whether this is an error or not

Converts this error to a boolean for easy checking.