mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-25 11:56:04 +00:00
Configurable buffer size and patch of GUI dependencies
This commit is contained in:
@@ -213,6 +213,7 @@ bool AmsConfiguration::getMeterConfig(MeterConfig& config) {
|
||||
EEPROM.begin(EEPROM_SIZE);
|
||||
EEPROM.get(CONFIG_METER_START, config);
|
||||
EEPROM.end();
|
||||
if(config.bufferSize < 1 || config.bufferSize > 64) config.bufferSize = 4;
|
||||
return true;
|
||||
} else {
|
||||
clearMeter(config);
|
||||
@@ -231,6 +232,7 @@ bool AmsConfiguration::setMeterConfig(MeterConfig& config) {
|
||||
meterChanged |= config.productionCapacity != existing.productionCapacity;
|
||||
meterChanged |= strcmp((char*) config.encryptionKey, (char*) existing.encryptionKey);
|
||||
meterChanged |= strcmp((char*) config.authenticationKey, (char*) existing.authenticationKey);
|
||||
meterChanged |= config.bufferSize != existing.bufferSize;
|
||||
} else {
|
||||
meterChanged = true;
|
||||
}
|
||||
@@ -256,6 +258,7 @@ void AmsConfiguration::clearMeter(MeterConfig& config) {
|
||||
config.accumulatedMultiplier = 0;
|
||||
config.source = 1; // Serial
|
||||
config.parser = 0; // Auto
|
||||
config.bufferSize = 1; // 64 bytes
|
||||
}
|
||||
|
||||
bool AmsConfiguration::isMeterChanged() {
|
||||
|
||||
Reference in New Issue
Block a user