Implemented country

This commit is contained in:
2021-11-01 23:22:58 +01:00
parent b447ce5de0
commit c07c900a1b
2 changed files with 5 additions and 0 deletions

View File

@@ -2055,6 +2055,10 @@ esp_err_t wifi_sync_mode(const config &config)
if (const auto result = esp_wifi_set_protocol(WIFI_IF_AP, WIFI_PROTOCOL_LR); result != ESP_OK)
ESP_LOGE(TAG, "esp_wifi_set_protocol() for AP long range failed with %s", esp_err_to_name(result));
if (config.country)
if (const auto result = esp_wifi_set_country(&*config.country); result != ESP_OK)
ESP_LOGE(TAG, "esp_wifi_set_country_code() failed with %s", esp_err_to_name(result));
if (const auto result = wifi_start(); result != ESP_OK)
{
ESP_LOGE(TAG, "wifi_start() failed with %s", esp_err_to_name(result));

View File

@@ -216,6 +216,7 @@ struct config
#ifdef CONFIG_ETH_ENABLED
std::optional<eth_config> eth;
#endif
std::optional<wifi_country_t> country;
friend bool operator==(const config &left, const config &right)
{