mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-04 18:49:00 +00:00
#561 Add escapes to strings
This commit is contained in:
parent
17297db2b1
commit
5249608dce
@ -927,7 +927,11 @@ void handleScanNetworks(HTTPRequest *req, HTTPResponse *res)
|
|||||||
|
|
||||||
for (int i = 0; i < n; ++i) {
|
for (int i = 0; i < n; ++i) {
|
||||||
char ssidArray[50];
|
char ssidArray[50];
|
||||||
String(WiFi.SSID(i)).toCharArray(ssidArray, WiFi.SSID(i).length());
|
String ssidString = String(WiFi.SSID(i));
|
||||||
|
//String ssidString = String(WiFi.SSID(i)).toCharArray(ssidArray, WiFi.SSID(i).length());
|
||||||
|
ssidString.replace("\"", "\\\"");
|
||||||
|
ssidString.toCharArray(ssidArray, 50);
|
||||||
|
|
||||||
|
|
||||||
if (WiFi.encryptionType(i) != WIFI_AUTH_OPEN) {
|
if (WiFi.encryptionType(i) != WIFI_AUTH_OPEN) {
|
||||||
//res->println("{\"ssid\": \"%s\",\"rssi\": -75}, ", String(WiFi.SSID(i).c_str() );
|
//res->println("{\"ssid\": \"%s\",\"rssi\": -75}, ", String(WiFi.SSID(i).c_str() );
|
||||||
@ -939,7 +943,7 @@ void handleScanNetworks(HTTPRequest *req, HTTPResponse *res)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Yield some cpu cycles to IP stack.
|
// Yield some cpu cycles to IP stack.
|
||||||
// This is important in case the list is large and it takes us tome to return
|
// This is important in case the list is large and it takes us time to return
|
||||||
// to the main loop.
|
// to the main loop.
|
||||||
yield();
|
yield();
|
||||||
}
|
}
|
||||||
|
@ -40,8 +40,8 @@ bool isWifiAvailable()
|
|||||||
|
|
||||||
// strcpy(radioConfig.preferences.wifi_ssid, "");
|
// strcpy(radioConfig.preferences.wifi_ssid, "");
|
||||||
// strcpy(radioConfig.preferences.wifi_password, "");
|
// strcpy(radioConfig.preferences.wifi_password, "");
|
||||||
strcpy(radioConfig.preferences.wifi_ssid, "meshtastic");
|
// strcpy(radioConfig.preferences.wifi_ssid, "meshtastic");
|
||||||
strcpy(radioConfig.preferences.wifi_password, "meshtastic!");
|
// strcpy(radioConfig.preferences.wifi_password, "meshtastic!");
|
||||||
|
|
||||||
if (*wifiName && *wifiPsw) {
|
if (*wifiName && *wifiPsw) {
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user