I’m trying to compile some sample code for ESP32. I assume this code compiles under ESP-IDF, and I would like it to compile under PlatformIO.
Here is the code:
wifi_config_t wifi_config = {
.sta =
{
.ssid = ssid,
.password = password,
.threshold.authmode = WIFI_AUTH_WPA2_PSK,
.pmf_cfg = {.capable = true, .required = false},
},
};
I get an error when the ssid and password fields are being copied in, and another when setting .threshold.authmode
It compiles if I made the following changes:
wifi_config_t wifi_config = {
.sta =
{
.threshold = {
.authmode = WIFI_AUTH_WPA2_PSK,
},
.pmf_cfg = {.capable = true, .required = false},
},
};
strcpy((char *)wifi_config.sta.ssid, ssid);
strcpy((char *)wifi_config.sta.password, password);
I’m assuming that the sample code works as-is, and would like to figure out what I need to do to make it work using PlatformIO.
I already have this build flag:
build_flags =
-std=gnu++11