mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-02-10 18:31:01 +00:00
Factory reset and splitted HTML into head, content and footer files to reduce memory footprint while parsing HTML templates
This commit is contained in:
@@ -72,6 +72,13 @@ void AmsConfiguration::setWifiHostname(const char* wifiHostname) {
|
||||
strcpy(config.wifiHostname, wifiHostname);
|
||||
}
|
||||
|
||||
void AmsConfiguration::clearWifi() {
|
||||
setWifiSsid("");
|
||||
setWifiPassword("");
|
||||
setWifiHostname("");
|
||||
clearWifiIp();
|
||||
}
|
||||
|
||||
void AmsConfiguration::clearWifiIp() {
|
||||
setWifiIp("");
|
||||
setWifiGw("");
|
||||
@@ -262,6 +269,24 @@ void AmsConfiguration::setSubstituteMissing(bool substituteMissing) {
|
||||
config.substituteMissing = substituteMissing;
|
||||
}
|
||||
|
||||
bool AmsConfiguration::isSendUnknown() {
|
||||
return config.sendUnknown;
|
||||
}
|
||||
|
||||
void AmsConfiguration::setSendUnknown(bool sendUnknown) {
|
||||
config.sendUnknown = sendUnknown;
|
||||
}
|
||||
|
||||
void AmsConfiguration::clearMeter() {
|
||||
setMeterType(0);
|
||||
setDistributionSystem(0);
|
||||
setMainFuse(0);
|
||||
setProductionCapacity(0);
|
||||
setSubstituteMissing(false);
|
||||
setSendUnknown(false);
|
||||
}
|
||||
|
||||
|
||||
bool AmsConfiguration::isDebugTelnet() {
|
||||
return config.debugTelnet;
|
||||
}
|
||||
@@ -475,6 +500,23 @@ void AmsConfiguration::ackDomoChange() {
|
||||
domoChanged = false;
|
||||
}
|
||||
|
||||
void AmsConfiguration::clear() {
|
||||
clearMeter();
|
||||
clearWifi();
|
||||
clearMqtt();
|
||||
clearAuth();
|
||||
clearDomo();
|
||||
|
||||
int address = EEPROM_CONFIG_ADDRESS;
|
||||
|
||||
EEPROM.begin(EEPROM_SIZE);
|
||||
while(address < EEPROM_CONFIG_ADDRESS+EEPROM_SIZE) {
|
||||
EEPROM.put(address++, 0);
|
||||
}
|
||||
EEPROM.commit();
|
||||
EEPROM.end();
|
||||
}
|
||||
|
||||
bool AmsConfiguration::hasConfig() {
|
||||
if(configVersion == 0) {
|
||||
EEPROM.begin(EEPROM_SIZE);
|
||||
@@ -768,7 +810,8 @@ int AmsConfiguration::readByte(int address, byte *value) {
|
||||
|
||||
void AmsConfiguration::print(Print* debugger)
|
||||
{
|
||||
debugger->println("Configuration:");
|
||||
debugger->print("Configuration size: ");
|
||||
debugger->println(sizeof(config));
|
||||
debugger->println("-----------------------------------------------");
|
||||
debugger->printf("WiFi SSID: '%s'\r\n", this->getWifiSsid());
|
||||
debugger->printf("WiFi Psk: '%s'\r\n", this->getWifiPassword());
|
||||
|
||||
Reference in New Issue
Block a user