diff --git a/src/WiFiConfig.cpp b/src/WiFiConfig.cpp index 31f0149..1ec7bdf 100644 --- a/src/WiFiConfig.cpp +++ b/src/WiFiConfig.cpp @@ -1,4 +1,7 @@ /* + * V6.2 - 12.12.2018- Nastaveni jmena zarizeni nadale NENI soucasti WiFiConfig a je treba ho pridat jako uzivatelsky parametr. Je to proto, protoze + * se ukazalo, ze jmeno zarizeni neni soucasti vsech projektu. + * * V6.1 - 11.12.2018- Sifrovani retezcu vytazeno mimo WiFiConfig do knihovny encipheredEEPROMStrings (dostupna na gitu) kvuli pristupu i jinych modulu * * V6.0 - 20.11.2018- Verze i pro ESP32 @@ -101,7 +104,7 @@ #define DNS_PORT 53 -char WiFiDeviceName[elementSize(wificonfigarea_t, devname)]; // misto pro jmeno zarizeni (dodane do DNS, DHCP NBNS apod...) +extern char WiFiDeviceName[]; enum { @@ -501,11 +504,6 @@ void WiFiConfig::_handleDisplayAP(void) s.replace(F("{p}"), String(FPSTR(VALUE)) + v + F("'")); else s.replace(F("{p}"), F("placeholder='password'")); - v = EES_readString(configBase + offsetof(wificonfigarea_t, devname), elementSize(wificonfigarea_t, devname)); - if (v.length()) - s.replace(F("{n}"), String(FPSTR(VALUE)) + v + F("'")); - else - s.replace(F("{n}"), F("placeholder='name'")); if (EEPROM.read(configBase + offsetof(wificonfigarea_t, mode)) == WIFIMODE_AP) s.replace(F("{a}"), FPSTR(CHECKED)); else @@ -563,9 +561,6 @@ void WiFiConfig::_handleSetAP(void) str = server->arg(F("_p")); EES_storeString(configBase + offsetof(wificonfigarea_t, pass), elementSize(wificonfigarea_t, pass), str); - str = server->arg(F("_n")); - EES_storeString(configBase + offsetof(wificonfigarea_t, devname), elementSize(wificonfigarea_t, devname), str); - str = server->arg(F("_a")); if (str.length() > 0) { @@ -620,9 +615,7 @@ void WiFiConfig::_handleSetAP(void) WiFi.disconnect(); // vsechno odpojime WiFi.persistent(true); // chceme, aby si modul zapamatoval konfiguraci - String s = EES_readString(configBase + offsetof(wificonfigarea_t, devname), elementSize(wificonfigarea_t, devname)); - strcpy(WiFiDeviceName, s.c_str()); - s = EES_readString(configBase + offsetof(wificonfigarea_t, ssid), elementSize(wificonfigarea_t, ssid)); + String s = EES_readString(configBase + offsetof(wificonfigarea_t, ssid), elementSize(wificonfigarea_t, ssid)); String pass = EES_readString(configBase + offsetof(wificonfigarea_t, pass), elementSize(wificonfigarea_t, pass)); switch (EEPROM.read(configBase + offsetof(wificonfigarea_t, mode))) @@ -770,8 +763,6 @@ bool WiFiConfig::_testWifi(wificonfig_cb cb) // nakonfigurujeme ESP dle nove nastavenych parametru WiFi.disconnect(); // vsechno odpojime - String s = EES_readString(configBase + offsetof(wificonfigarea_t, devname), elementSize(wificonfigarea_t, devname)); - strcpy(WiFiDeviceName, s.c_str()); s = EES_readString(configBase + offsetof(wificonfigarea_t, ssid), elementSize(wificonfigarea_t, ssid)); String pass = EES_readString(configBase + offsetof(wificonfigarea_t, pass), elementSize(wificonfigarea_t, pass)); @@ -871,9 +862,6 @@ wificonfigresult_t WiFiConfig::begin(int configarea, int forceConfigure, wificon else #endif { - String s = EES_readString(configBase + offsetof(wificonfigarea_t, devname), elementSize(wificonfigarea_t, devname)); - strcpy(WiFiDeviceName, s.c_str()); - switch (EEPROM.read(configBase + offsetof(wificonfigarea_t, mode))) { case WIFIMODE_STA: diff --git a/src/WiFiConfig.h b/src/WiFiConfig.h index 1c99200..4d579b8 100644 --- a/src/WiFiConfig.h +++ b/src/WiFiConfig.h @@ -48,7 +48,6 @@ typedef struct uint8_t ip; // konfigurace ip (staticka/DHCP) char ssid[32 + 2]; // SSID site char pass[64 + 2]; // heslo - char devname[32 + 2]; // jmeno zarizeni (pro NBNS plati jen 16 znaku) uint32_t ipaddr; // ip adresa v pripade staticke konfigurace uint32_t netmask; // sitova maska v pripade staticke konfigurace uint32_t gateway; // sitova brana v pripade staticke konfigurace @@ -143,8 +142,6 @@ uint32_t getEEPROMuint32(int start); */ void setEEPROMuint32(int start, uint32_t val); -extern char WiFiDeviceName[]; // jmeno zarizeni, pouzivane i pro DHCP - class WiFiConfigUsrParameter { public: diff --git a/src/embHTML.h b/src/embHTML.h index 6d6bf77..afe4430 100644 --- a/src/embHTML.h +++ b/src/embHTML.h @@ -37,7 +37,6 @@ static const char SSID_ITEM[] PROGMEM = R"=====( /* Zacatek formulare pro vyplneni {s} - SSID {p} - password -{n} - Netbios name {a} - AP mode (checkbox) {ch}- cislo kanalu AP {c} - staticka IP konfigurace (checkbox) @@ -50,7 +49,6 @@ static const char PAGE_INDEX2[] PROGMEM = R"=====(