Added remote debugging

This commit is contained in:
Gunnar Skjold
2020-03-24 20:17:44 +01:00
parent d747c84a14
commit 73d00f786a
11 changed files with 346 additions and 243 deletions

View File

@@ -241,6 +241,30 @@ void AmsConfiguration::setProductionCapacity(int productionCapacity) {
this->productionCapacity = productionCapacity;
}
bool AmsConfiguration::isDebugTelnet() {
return this->debugTelnet;
}
void AmsConfiguration::setDebugTelnet(bool debugTelnet) {
this->debugTelnet = debugTelnet;
}
bool AmsConfiguration::isDebugSerial() {
return this->debugSerial;
}
void AmsConfiguration::setDebugSerial(bool debugSerial) {
this->debugSerial = debugSerial;
}
int AmsConfiguration::getDebugLevel() {
return this->debugLevel;
}
void AmsConfiguration::setDebugLevel(int debugLevel) {
this->debugLevel = debugLevel;
}
bool AmsConfiguration::hasConfig() {
if(configVersion == 0) {
@@ -338,6 +362,10 @@ bool AmsConfiguration::loadConfig72(int address) {
ackWifiChange();
setDebugLevel(5); // 5=Error
setDebugTelnet(false);
setDebugSerial(false);
return true;
}
@@ -405,6 +433,10 @@ bool AmsConfiguration::loadConfig75(int address) {
ackWifiChange();
setDebugLevel(5); // 5=Error
setDebugTelnet(false);
setDebugSerial(false);
return true;
}
@@ -476,6 +508,10 @@ bool AmsConfiguration::loadConfig80(int address) {
ackWifiChange();
setDebugLevel(5); // 5=Error
setDebugTelnet(false);
setDebugSerial(false);
return true;
}
@@ -557,6 +593,15 @@ bool AmsConfiguration::loadConfig81(int address) {
address += readInt(address, &i);
setProductionCapacity(i);
bool debugTelnet = false;
address += readBool(address, &debugTelnet);
setDebugTelnet(debugTelnet);
bool debugSerial = false;
address += readBool(address, &debugSerial);
setDebugSerial(debugSerial);
address += readInt(address, &i);
setDebugLevel(i);
ackWifiChange();
return true;
@@ -612,6 +657,10 @@ bool AmsConfiguration::save() {
address += saveInt(address, mainFuse);
address += saveInt(address, productionCapacity);
address += saveBool(address, debugTelnet);
address += saveBool(address, debugSerial);
address += saveInt(address, debugLevel);
bool success = EEPROM.commit();
EEPROM.end();
@@ -704,7 +753,7 @@ template <class T> int AmsConfiguration::readAnything(int ee, T& value) {
return i;
}
void AmsConfiguration::print(Stream* debugger)
void AmsConfiguration::print(Print* debugger)
{
debugger->println("Configuration:");
debugger->println("-----------------------------------------------");