ESPHome 2026.7.4
Loading...
Searching...
No Matches
esphome::captive_portal Namespace Reference

Data Structures

class  CaptivePortal
 
class  DNSServer
 

Functions

struct esphome::captive_portal::DNSHeader __attribute__ ((packed))
 
const char * json_escape_into_buffer (std::span< char > buf, StringRef value)
 Copy value into buf, escaping the characters that cannot appear raw inside a JSON string literal.
 

Variables

constexpr uint8_t INDEX_GZ[] PROGMEM
 
CaptivePortalglobal_captive_portal = nullptr
 

Function Documentation

◆ __attribute__()

struct esphome::captive_portal::DNSAnswer esphome::captive_portal::__attribute__ ( (packed) )

◆ json_escape_into_buffer()

const char * esphome::captive_portal::json_escape_into_buffer ( std::span< char > buf,
StringRef value )
inline

Copy value into buf, escaping the characters that cannot appear raw inside a JSON string literal.

Escapes " and \ along with the control characters below 0x20, using the short forms where JSON defines one and \u00XX otherwise. Bytes >= 0x20 are copied verbatim, so text containing valid UTF-8 survives intact. The result is always null terminated; anything that would not fit is dropped rather than written partially. Returns buf so the call can be used directly as an argument.

To size buf so that no input is ever dropped, allow JSON_ESCAPE_MAX_EXPANSION bytes per input byte plus one for the null terminator.

Definition at line 23 of file json_escape.h.

Variable Documentation

◆ global_captive_portal

CaptivePortal * esphome::captive_portal::global_captive_portal = nullptr

Definition at line 143 of file captive_portal.cpp.

◆ PROGMEM

uint8_t INDEX_BR [] esphome::captive_portal::PROGMEM
constexpr

Definition at line 9 of file captive_index.h.