Renamed several methods from Sample to Simple
This commit is contained in:
parent
b2a30621db
commit
6cbcfacac6
@ -47,7 +47,7 @@ void HoymilesClass::loop()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fetch dev info (but first fetch stats)
|
// 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"));
|
Serial.println(F("Request device info"));
|
||||||
iv->sendDevInfoRequest(_radio.get());
|
iv->sendDevInfoRequest(_radio.get());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,6 +28,6 @@ bool DevInfoSimpleCommand::handleResponse(InverterAbstract* inverter, fragment_t
|
|||||||
inverter->DevInfo()->appendFragmentSimple(offs, fragment[i].fragment, fragment[i].len);
|
inverter->DevInfo()->appendFragmentSimple(offs, fragment[i].fragment, fragment[i].len);
|
||||||
offs += (fragment[i].len);
|
offs += (fragment[i].len);
|
||||||
}
|
}
|
||||||
inverter->DevInfo()->setLastUpdateSample(millis());
|
inverter->DevInfo()->setLastUpdateSimple(millis());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -69,9 +69,9 @@ bool HM_Abstract::sendDevInfoRequest(HoymilesRadio* radio)
|
|||||||
cmdAll->setTime(now);
|
cmdAll->setTime(now);
|
||||||
cmdAll->setTargetAddress(serial());
|
cmdAll->setTargetAddress(serial());
|
||||||
|
|
||||||
DevInfoSimpleCommand* cmdSample = radio->enqueCommand<DevInfoSimpleCommand>();
|
DevInfoSimpleCommand* cmdSimple = radio->enqueCommand<DevInfoSimpleCommand>();
|
||||||
cmdSample->setTime(now);
|
cmdSimple->setTime(now);
|
||||||
cmdSample->setTargetAddress(serial());
|
cmdSimple->setTargetAddress(serial());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,7 @@ void DevInfoParser::clearBufferSimple()
|
|||||||
void DevInfoParser::appendFragmentSimple(uint8_t offset, uint8_t* payload, uint8_t len)
|
void DevInfoParser::appendFragmentSimple(uint8_t offset, uint8_t* payload, uint8_t len)
|
||||||
{
|
{
|
||||||
if (offset + len > DEV_INFO_SIZE) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
memcpy(&_payloadDevInfoSimple[offset], payload, len);
|
memcpy(&_payloadDevInfoSimple[offset], payload, len);
|
||||||
@ -44,14 +44,14 @@ void DevInfoParser::setLastUpdateAll(uint32_t lastUpdate)
|
|||||||
setLastUpdate(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);
|
setLastUpdate(lastUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,8 +15,8 @@ public:
|
|||||||
uint32_t getLastUpdateAll();
|
uint32_t getLastUpdateAll();
|
||||||
void setLastUpdateAll(uint32_t lastUpdate);
|
void setLastUpdateAll(uint32_t lastUpdate);
|
||||||
|
|
||||||
uint32_t getLastUpdateSample();
|
uint32_t getLastUpdateSimple();
|
||||||
void setLastUpdateSample(uint32_t lastUpdate);
|
void setLastUpdateSimple(uint32_t lastUpdate);
|
||||||
|
|
||||||
uint16_t getFwBuildVersion();
|
uint16_t getFwBuildVersion();
|
||||||
time_t getFwBuildDateTime();
|
time_t getFwBuildDateTime();
|
||||||
@ -29,7 +29,7 @@ private:
|
|||||||
time_t timegm(struct tm* tm);
|
time_t timegm(struct tm* tm);
|
||||||
|
|
||||||
uint32_t _lastUpdateAll = 0;
|
uint32_t _lastUpdateAll = 0;
|
||||||
uint32_t _lastUpdateSample = 0;
|
uint32_t _lastUpdateSimple = 0;
|
||||||
|
|
||||||
uint8_t _payloadDevInfoAll[DEV_INFO_SIZE] = {};
|
uint8_t _payloadDevInfoAll[DEV_INFO_SIZE] = {};
|
||||||
uint8_t _devInfoAllLength = 0;
|
uint8_t _devInfoAllLength = 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user