Skip to content

Commit cd97131

Browse files
me-no-devSuGlider
andauthored
Fix WPS example config initialization (#10399)
* fix(wps): fixes wps struct initialization C99 complaint * fix(wps): adds memset to 0 --------- Co-authored-by: Rodrigo Garcia <[email protected]>
1 parent 84ddf0a commit cd97131

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: libraries/WiFi/examples/WPS/WPS.ino

+9-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,15 @@ WPS (pin is 00000000)
2525
#define ESP_WPS_MODE WPS_TYPE_PBC
2626

2727
void wpsStart() {
28-
esp_wps_config_t config = WPS_CONFIG_INIT_DEFAULT(ESP_WPS_MODE);
28+
esp_wps_config_t config;
29+
memset(&config, 0, sizeof(esp_wps_config_t));
30+
//Same as config = WPS_CONFIG_INIT_DEFAULT(ESP_WPS_MODE);
31+
config.wps_type = ESP_WPS_MODE;
32+
strcpy(config.factory_info.manufacturer, "ESPRESSIF");
33+
strcpy(config.factory_info.model_number, CONFIG_IDF_TARGET);
34+
strcpy(config.factory_info.model_name, "ESPRESSIF IOT");
35+
strcpy(config.factory_info.device_name, "ESP DEVICE");
36+
strcpy(config.pin, "00000000");
2937
esp_err_t err = esp_wifi_wps_enable(&config);
3038
if (err != ESP_OK) {
3139
Serial.printf("WPS Enable Failed: 0x%x: %s\n", err, esp_err_to_name(err));

0 commit comments

Comments
 (0)