Implemented country
This commit is contained in:
@@ -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));
|
||||
|
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user