Skip to content

wps_softap_registrar/main/wps.c pin printout bug #18113

@MrMiracleMan111

Description

@MrMiracleMan111

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

The following code in wps_softap_registrar/main/wps.c

#if EXAMPLE_WPS_PIN_VALUE
	ESP_LOGI(TAG, "Staring WPS registrar with user specified pin %s", pin);
	snprintf((char *)pin, 9, "%08d", EXAMPLE_WPS_PIN_VALUE);
	ESP_ERROR_CHECK(esp_wifi_ap_wps_start(pin));

Should be changed to

#if EXAMPLE_WPS_PIN_VALUE
	snprintf((char *)pin, 9, "%08d", EXAMPLE_WPS_PIN_VALUE);
	ESP_LOGI(TAG, "Staring WPS registrar with user specified pin %s", pin);
	ESP_ERROR_CHECK(esp_wifi_ap_wps_start(pin));

The pin variable will not be populated until the snprintf call so the snprintf call should precede the ESP_LOGI(TAG, "Staring WPS registrar with user specified pin %s", pin);.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions