Initial lib commit with cmake
This commit is contained in:
commit
e39d6cda18
31 changed files with 7172 additions and 0 deletions
41
inc/dtu.h
Normal file
41
inc/dtu.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#ifndef DTU_H
|
||||
#define DTU_H
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "microinverter.h"
|
||||
#include "modbus.h"
|
||||
|
||||
class Dtu {
|
||||
private:
|
||||
modbus_t *modbus;
|
||||
|
||||
std::vector<Microinverter> microinverters;
|
||||
|
||||
bool connected;
|
||||
|
||||
void populateMicroinverters();
|
||||
|
||||
public:
|
||||
Dtu(const char *address, int id, bool rtu, bool tcp);
|
||||
|
||||
std::pair<Microinverter *, bool> getMicroinverterBySerialNumber(long long serialNumber);
|
||||
|
||||
bool isConnected();
|
||||
|
||||
void updateMicroinverters(std::vector<std::string> ¶metersToGet, bool allParameters, std::vector<long long> µinvertersToGet);
|
||||
|
||||
void printMicroinverters(std::vector<std::string> ¶metersToGet, bool allParameters, std::vector<long long> µinvertersToGet, bool shortNames, bool printTodayProduction, bool printTotalProduction);
|
||||
|
||||
void setStatusMicroinverters(uint16_t value, std::string statusName, std::vector<long long>& microinvertersToSet);
|
||||
|
||||
bool empty();
|
||||
|
||||
void listOfMicroinverters();
|
||||
|
||||
~Dtu();
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue