hoymilesClient/inc/hoymiles/dtu.h

41 lines
933 B
C
Raw Normal View History

2024-03-16 21:15:15 +01:00
#ifndef DTU_H
#define DTU_H
#include <memory>
2024-03-20 11:28:43 +01:00
#include <string>
#include <vector>
2024-03-16 21:15:15 +01:00
#include "microinverter.h"
2024-03-19 16:59:41 +01:00
#include "modbus.h"
2024-03-16 21:15:15 +01:00
class Dtu {
private:
2024-03-20 10:26:02 +01:00
std::shared_ptr<class modbus> modbus;
2024-03-19 16:59:41 +01:00
2024-03-16 21:15:15 +01:00
std::vector<Microinverter> microinverters;
void populateMicroinverters();
std::pair<Microinverter *, bool> getMicroinverterBySerialNumber(long long serialNumber);
2024-03-16 21:15:15 +01:00
public:
Dtu(const char *ip_address, int port);
bool isConnected();
2024-03-28 11:05:07 +01:00
bool modbusError();
std::string modbusErrorMessage();
// void updateMicroinverters();
2024-03-16 21:15:15 +01:00
2024-03-20 16:39:25 +01:00
void updateMicroinverters(std::vector<std::string> &parametersToGet, bool allParameters, std::vector<long long> &microinvertersToGet);
2024-03-20 11:28:43 +01:00
// void printMicroinverters();
void printMicroinverters(std::vector<std::string> &parametersToGet, bool allParameters, std::vector<long long> &microinvertersToGet, bool shortNames, bool printTodayProduction, bool printTotalProduction);
2024-03-20 11:28:43 +01:00
2024-03-16 21:15:15 +01:00
~Dtu();
};
#endif