diff --git a/src/espwifiutils.cpp b/src/espwifiutils.cpp index 26fe4fc..d97b347 100644 --- a/src/espwifiutils.cpp +++ b/src/espwifiutils.cpp @@ -200,6 +200,24 @@ const char * toString(wifi_err_reason_t reason) return "UNKNOWN"; } +#ifdef CONFIG_PPP_SUPPORT +std::string toString(esp_netif_auth_type_t authType) +{ + switch (authType) + { + case NETIF_PPP_AUTHTYPE_NONE: return "NONE"; + case NETIF_PPP_AUTHTYPE_PAP: return "PAP"; + case NETIF_PPP_AUTHTYPE_CHAP: return "CHAP"; + case NETIF_PPP_AUTHTYPE_MSCHAP: return "MSCHAP"; + case NETIF_PPP_AUTHTYPE_MSCHAP_V2: return "MSCHAP_V2"; + case NETIF_PPP_AUTHTYPE_EAP: return "EAP"; + } + + ESP_LOGW(TAG, "Unknown esp_netif_auth_type_t(%i)", std::to_underlying(authType)); + return fmt::format("Unknown esp_netif_auth_type_t({})", std::to_underlying(authType)); +} +#endif + template<> std::expected fromString(std::string_view str) { mac_t result{}; diff --git a/src/espwifiutils.h b/src/espwifiutils.h index 7d42a65..88e5cfe 100644 --- a/src/espwifiutils.h +++ b/src/espwifiutils.h @@ -13,6 +13,9 @@ #include #include #include +#ifdef CONFIG_PPP_SUPPORT +#include +#endif namespace wifi_stack { bool wifi_ap_config_equal(const wifi_ap_config_t& lhs, const wifi_ap_config_t& rhs); @@ -24,6 +27,9 @@ std::string toString(wifi_bandwidth_t bandwidth); std::string toString(esp_interface_t interface); std::string toString(esp_netif_dhcp_status_t status); const char * toString(wifi_err_reason_t reason); +#ifdef CONFIG_PPP_SUPPORT +std::string toString(esp_netif_auth_type_t); +#endif template std::expected fromString(std::string_view str) = delete;