mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2025-12-20 09:12:49 +01:00
Code Refactoring: Add inverter reference to each command
Instead of just adding the target_address to a command this patch adds a reference to the whole inverter instance
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* Copyright (C) 2022-2023 Thomas Basler and others
|
||||
* Copyright (C) 2022-2024 Thomas Basler and others
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -22,8 +22,8 @@ ID Target Addr Source Addr Idx DT ? Time Gap Pa
|
||||
#include "Hoymiles.h"
|
||||
#include "inverters/InverterAbstract.h"
|
||||
|
||||
RealTimeRunDataCommand::RealTimeRunDataCommand(const uint64_t target_address, const uint64_t router_address, const time_t time)
|
||||
: MultiDataCommand(target_address, router_address)
|
||||
RealTimeRunDataCommand::RealTimeRunDataCommand(InverterAbstract* inv, const uint64_t router_address, const time_t time)
|
||||
: MultiDataCommand(inv, router_address)
|
||||
{
|
||||
setTime(time);
|
||||
setDataType(0x0b);
|
||||
@@ -71,4 +71,4 @@ bool RealTimeRunDataCommand::handleResponse(InverterAbstract& inverter, const fr
|
||||
void RealTimeRunDataCommand::gotTimeout(InverterAbstract& inverter)
|
||||
{
|
||||
inverter.Statistics()->incrementRxFailureCount();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user