Skip to content

Commit

Permalink
Merge pull request #928 from bdring/ExtendedSSID
Browse files Browse the repository at this point in the history
Allow 8-bit characters in SSIDs
  • Loading branch information
MitchBradley committed Jun 26, 2023
2 parents 674eae3 + de5171c commit cc3ab17
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 32 deletions.
34 changes: 3 additions & 31 deletions FluidNC/src/WebUI/WifiConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,7 @@ namespace WebUI {
MIN_PASSWORD_LENGTH,
MAX_PASSWORD_LENGTH,
(bool (*)(char*))WiFiConfig::isPasswordValid);
wifi_ap_ssid = new StringSetting(
"AP SSID", WEBSET, WA, "ESP105", "AP/SSID", DEFAULT_AP_SSID, MIN_SSID_LENGTH, MAX_SSID_LENGTH, (bool (*)(char*))WiFiConfig::isSSIDValid);
wifi_ap_ssid = new StringSetting("AP SSID", WEBSET, WA, "ESP105", "AP/SSID", DEFAULT_AP_SSID, MIN_SSID_LENGTH, MAX_SSID_LENGTH, NULL);
wifi_ap_country = new EnumSetting("AP regulatory domain", WEBSET, WA, NULL, "AP/Country", WiFiCountry01, &wifiContryOptions, NULL);
wifi_sta_netmask = new IPaddrSetting("Station Static Mask", WEBSET, WA, NULL, "Sta/Netmask", DEFAULT_STA_MK, NULL);
wifi_sta_gateway = new IPaddrSetting("Station Static Gateway", WEBSET, WA, NULL, "Sta/Gateway", DEFAULT_STA_GW, NULL);
Expand All @@ -356,15 +355,8 @@ namespace WebUI {
MIN_PASSWORD_LENGTH,
MAX_PASSWORD_LENGTH,
(bool (*)(char*))WiFiConfig::isPasswordValid);
wifi_sta_ssid = new StringSetting("Station SSID",
WEBSET,
WA,
"ESP100",
"Sta/SSID",
DEFAULT_STA_SSID,
MIN_SSID_LENGTH,
MAX_SSID_LENGTH,
(bool (*)(char*))WiFiConfig::isSSIDValid);
wifi_sta_ssid =
new StringSetting("Station SSID", WEBSET, WA, "ESP100", "Sta/SSID", DEFAULT_STA_SSID, MIN_SSID_LENGTH, MAX_SSID_LENGTH, NULL);

wifi_mode = new EnumSetting("WiFi mode", WEBSET, WA, "ESP116", "WiFi/Mode", WiFiFallback, &wifiModeOptions, NULL);

Expand Down Expand Up @@ -469,26 +461,6 @@ namespace WebUI {
return true;
}

/**
* Check if SSID string is valid
*/

bool WiFiConfig::isSSIDValid(const char* ssid) {
//limited size
//char c;
// length is checked automatically by string setting
//only printable
if (!ssid) {
return true;
}
for (int i = 0; i < strlen(ssid); i++) {
if (!isPrintable(ssid[i])) {
return false;
}
}
return true;
}

/**
* Check if password string is valid
*/
Expand Down
1 change: 0 additions & 1 deletion FluidNC/src/WebUI/WifiConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ namespace WebUI {

static bool isValidIP(const char* string);
static bool isPasswordValid(const char* password);
static bool isSSIDValid(const char* ssid);
static bool isHostnameValid(const char* hostname);

static std::string Hostname() { return _hostname; }
Expand Down

0 comments on commit cc3ab17

Please sign in to comment.