mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2025-12-19 08:42:34 +01:00
Remove RequestType and place handling of response in the command class
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "RealTimeRunDataCommand.h"
|
||||
#include "inverters/InverterAbstract.h"
|
||||
|
||||
RealTimeRunDataCommand::RealTimeRunDataCommand(uint64_t target_address, uint64_t router_address, time_t time)
|
||||
: MultiDataCommand(target_address, router_address)
|
||||
@@ -6,4 +7,16 @@ RealTimeRunDataCommand::RealTimeRunDataCommand(uint64_t target_address, uint64_t
|
||||
setTime(time);
|
||||
setDataType(0x0b);
|
||||
setTimeout(200);
|
||||
}
|
||||
|
||||
void RealTimeRunDataCommand::handleResponse(InverterAbstract* inverter, fragment_t fragment[], uint8_t max_fragment_id)
|
||||
{
|
||||
// Move all fragments into target buffer
|
||||
uint8_t offs = 0;
|
||||
inverter->Statistics()->clearBuffer();
|
||||
for (uint8_t i = 0; i < max_fragment_id; i++) {
|
||||
inverter->Statistics()->appendFragment(offs, fragment[i].fragment, fragment[i].len);
|
||||
offs += (fragment[i].len);
|
||||
}
|
||||
inverter->Statistics()->setLastUpdate(millis());
|
||||
}
|
||||
Reference in New Issue
Block a user