WiFi Access Point (AP)

The WiFi access point enables the ESP to host its own WiFi network to which other devices can connect.

API Reference

Header File

Classes

class WifiAp : public espp::BaseComponent

WiFi Access Point (AP)

see https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/wifi.html#esp32-wi-fi-ap-general-scenario

WiFi Access Point Example

    espp::WifiAp wifi_ap({.ssid = CONFIG_ESP_WIFI_SSID, .password = CONFIG_ESP_WIFI_PASSWORD});

Note

If CONFIG_ESP32_WIFI_NVS_ENABLED is set to y (which is the default), then you must ensure that you call nvs_flash_init() prior to creating the WiFi Access Point.

Public Functions

inline explicit WifiAp(const Config &config)

Initialize the WiFi Access Point (AP)

Parameters

configWifiAp::Config structure with initialization information.

inline const std::string &get_name() const

Get the name of the component

Note

This is the tag of the logger

Returns

A const reference to the name of the component

inline void set_log_tag(const std::string_view &tag)

Set the tag for the logger

Parameters

tag – The tag to use for the logger

inline espp::Logger::Verbosity get_log_level() const

Get the log level for the logger

Returns

The verbosity level of the logger

inline void set_log_level(espp::Logger::Verbosity level)

Set the log level for the logger

Parameters

level – The verbosity level to use for the logger

inline void set_log_verbosity(espp::Logger::Verbosity level)

Set the log verbosity for the logger

See also

set_log_level

Note

This is a convenience method that calls set_log_level

Parameters

level – The verbosity level to use for the logger

inline espp::Logger::Verbosity get_log_verbosity() const

Get the log verbosity for the logger

See also

get_log_level

Note

This is a convenience method that calls get_log_level

Returns

The verbosity level of the logger

inline void set_log_rate_limit(std::chrono::duration<float> rate_limit)

Set the rate limit for the logger

Note

Only calls to the logger that have _rate_limit suffix will be rate limited

Parameters

rate_limit – The rate limit to use for the logger

struct Config

Public Members

std::string ssid

SSID for the access point.

std::string password

Password for the access point. If empty, the AP will be open / have no security.

uint8_t channel = {1}

WiFi channel, range [1,13].

uint8_t max_number_of_stations = {4}

Max number of connected stations to this AP.

Logger::Verbosity log_level = {Logger::Verbosity::WARN}

Verbosity of WifiAp logger.