Fixed firmare upload when web context is defined (#938)

This commit is contained in:
Gunnar Skjold
2025-03-24 08:59:52 +01:00
committed by GitHub
parent e8cf8a98ed
commit 8ee3f53714
5 changed files with 23 additions and 5 deletions

View File

@@ -242,6 +242,14 @@ bool AmsConfiguration::getWebConfig(WebConfig& config) {
}
bool AmsConfiguration::setWebConfig(WebConfig& config) {
WebConfig existing;
if(getWebConfig(existing)) {
webChanged |= strcmp(config.username, existing.username) != 0;
webChanged |= strcmp(config.password, existing.password) != 0;
webChanged |= strcmp(config.context, existing.context) != 0;
} else {
webChanged = true;
}
stripNonAscii((uint8_t*) config.username, 37);
stripNonAscii((uint8_t*) config.password, 37);
@@ -261,6 +269,14 @@ void AmsConfiguration::clearWebConfig(WebConfig& config) {
memset(config.context, 0, 37);
}
bool AmsConfiguration::isWebChanged() {
return webChanged;
}
void AmsConfiguration::ackWebChange() {
webChanged = false;
}
bool AmsConfiguration::getMeterConfig(MeterConfig& config) {
if(hasConfig()) {
EEPROM.begin(EEPROM_SIZE);