Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WiFiSetting] Fixed an issue where SSID and PASSWD were not printed correctly if they exceeded 14 characters. #153

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions examples/Advanced/WIFI/WiFiSetting/WiFiSetting.ino
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ restoreConfig() { /* Check whether there is wifi configuration information
wifi_password = preferences.getString("WIFI_PASSWD");
M5.Lcd.printf(
"WIFI-SSID: %s\n",
wifi_ssid); // Screen print format string. 屏幕打印格式化字符串
M5.Lcd.printf("WIFI-PASSWD: %s\n", wifi_password);
wifi_ssid.c_str()); // Screen print format string. 屏幕打印格式化字符串
M5.Lcd.printf("WIFI-PASSWD: %s\n", wifi_password.c_str());
WiFi.begin(wifi_ssid.c_str(), wifi_password.c_str());

if (wifi_ssid.length() > 0) {
Expand Down Expand Up @@ -130,9 +130,9 @@ void startWebServer() { // Open the web service. 打开Web服务
});
webServer.on("/setap", []() {
String ssid = urlDecode(webServer.arg("ssid"));
M5.Lcd.printf("SSID: %s\n", ssid);
M5.Lcd.printf("SSID: %s\n", ssid.c_str());
String pass = urlDecode(webServer.arg("pass"));
M5.Lcd.printf("Password: %s\n\nWriting SSID to EEPROM...\n", pass);
M5.Lcd.printf("Password: %s\n\nWriting SSID to EEPROM...\n", pass.c_str());

// Store wifi config. 存储wifi配置信息
M5.Lcd.println("Writing Password to nvr...");
Expand Down Expand Up @@ -248,4 +248,4 @@ String urlDecode(String input) {
s.replace("%5F", "-");
s.replace("%60", "`");
return s;
}
}
Loading
Loading