How to use: esp_wifi_get_country(wifi_country_t *country)

hml9083@hotmail.com
Posts: 17
Joined: Mon Nov 30, 2015 12:58 pm

How to use: esp_wifi_get_country(wifi_country_t *country)

Postby hml9083@hotmail.com » Thu Jun 20, 2019 12:41 pm

I can execute the command for esp_err_t esp_wifi_set_country(const wifi_country_t *country)
I have set the country to "US" with out getting an error.
I can not execute the command esp_err_t esp_wifi_get_country(const wifi_country_t *country)
country variable type I use is char*.
Are there any examples of retrieving the country code using the Arduino IDE?
I always get errors trying to get the country code

boarchuz
Posts: 606
Joined: Tue Aug 21, 2018 5:28 am

Re: How to use: esp_wifi_get_country(wifi_country_t *country)

Postby boarchuz » Thu Jun 20, 2019 5:50 pm

Try something like this.

Code: Select all

wifi_country_t myCountry;
if(esp_wifi_get_country(&myCountry) == ESP_OK){
  Serial.print("Country Code: ");
  Serial.println(myCountry.cc);
 }

hml9083@hotmail.com
Posts: 17
Joined: Mon Nov 30, 2015 12:58 pm

Re: How to use: esp_wifi_get_country(wifi_country_t *country)

Postby hml9083@hotmail.com » Fri Jun 21, 2019 9:53 pm

Thank you boarchuz, got it working now.

Who is online

Users browsing this forum: No registered users and 118 guests