Renamed several methods from Sample to Simple

This commit is contained in:
Thomas Basler 2022-10-03 13:14:31 +02:00
parent b2a30621db
commit 6cbcfacac6
5 changed files with 13 additions and 13 deletions

View File

@ -47,7 +47,7 @@ void HoymilesClass::loop()
}
// Fetch dev info (but first fetch stats)
if (iv->Statistics()->getLastUpdate() > 0 && (iv->DevInfo()->getLastUpdateAll() == 0 || iv->DevInfo()->getLastUpdateSample() == 0)) {
if (iv->Statistics()->getLastUpdate() > 0 && (iv->DevInfo()->getLastUpdateAll() == 0 || iv->DevInfo()->getLastUpdateSimple() == 0)) {
Serial.println(F("Request device info"));
iv->sendDevInfoRequest(_radio.get());
}

View File

@ -28,6 +28,6 @@ bool DevInfoSimpleCommand::handleResponse(InverterAbstract* inverter, fragment_t
inverter->DevInfo()->appendFragmentSimple(offs, fragment[i].fragment, fragment[i].len);
offs += (fragment[i].len);
}
inverter->DevInfo()->setLastUpdateSample(millis());
inverter->DevInfo()->setLastUpdateSimple(millis());
return true;
}

View File

@ -69,9 +69,9 @@ bool HM_Abstract::sendDevInfoRequest(HoymilesRadio* radio)
cmdAll->setTime(now);
cmdAll->setTargetAddress(serial());
DevInfoSimpleCommand* cmdSample = radio->enqueCommand<DevInfoSimpleCommand>();
cmdSample->setTime(now);
cmdSample->setTargetAddress(serial());
DevInfoSimpleCommand* cmdSimple = radio->enqueCommand<DevInfoSimpleCommand>();
cmdSimple->setTime(now);
cmdSimple->setTargetAddress(serial());
return true;
}

View File

@ -26,7 +26,7 @@ void DevInfoParser::clearBufferSimple()
void DevInfoParser::appendFragmentSimple(uint8_t offset, uint8_t* payload, uint8_t len)
{
if (offset + len > DEV_INFO_SIZE) {
Serial.printf("FATAL: (%s, %d) dev info Sample packet too large for buffer\n", __FILE__, __LINE__);
Serial.printf("FATAL: (%s, %d) dev info Simple packet too large for buffer\n", __FILE__, __LINE__);
return;
}
memcpy(&_payloadDevInfoSimple[offset], payload, len);
@ -44,14 +44,14 @@ void DevInfoParser::setLastUpdateAll(uint32_t lastUpdate)
setLastUpdate(lastUpdate);
}
uint32_t DevInfoParser::getLastUpdateSample()
uint32_t DevInfoParser::getLastUpdateSimple()
{
return _lastUpdateSample;
return _lastUpdateSimple;
}
void DevInfoParser::setLastUpdateSample(uint32_t lastUpdate)
void DevInfoParser::setLastUpdateSimple(uint32_t lastUpdate)
{
_lastUpdateSample = lastUpdate;
_lastUpdateSimple = lastUpdate;
setLastUpdate(lastUpdate);
}

View File

@ -15,8 +15,8 @@ public:
uint32_t getLastUpdateAll();
void setLastUpdateAll(uint32_t lastUpdate);
uint32_t getLastUpdateSample();
void setLastUpdateSample(uint32_t lastUpdate);
uint32_t getLastUpdateSimple();
void setLastUpdateSimple(uint32_t lastUpdate);
uint16_t getFwBuildVersion();
time_t getFwBuildDateTime();
@ -29,7 +29,7 @@ private:
time_t timegm(struct tm* tm);
uint32_t _lastUpdateAll = 0;
uint32_t _lastUpdateSample = 0;
uint32_t _lastUpdateSimple = 0;
uint8_t _payloadDevInfoAll[DEV_INFO_SIZE] = {};
uint8_t _devInfoAllLength = 0;