hoymilesClient/inc/hoymiles/microinverter.h

46 lines
789 B
C
Raw Normal View History

2024-03-16 21:15:15 +01:00
#ifndef MICROINVERTER_H
#define MICROINVERTER_H
#include <vector>
#include <memory>
2024-03-20 11:28:43 +01:00
#include <string>
// #include <mutex>
2024-03-16 21:15:15 +01:00
#include "port.h"
2024-03-19 16:59:41 +01:00
#include "modbus.h"
2024-03-16 21:15:15 +01:00
2024-03-19 16:59:41 +01:00
// struct _modbus;
// typedef _modbus modbus_t;
2024-03-16 21:15:15 +01:00
class Microinverter {
private:
2024-03-19 16:59:41 +01:00
// std::shared_ptr<modbus_t*> modbus_context;
2024-03-19 18:13:27 +01:00
std::shared_ptr<class modbus> modbus;
2024-03-19 16:59:41 +01:00
// std::mutex *modbus_context_mutex;
2024-03-16 21:15:15 +01:00
2024-03-16 21:15:15 +01:00
public:
2024-03-19 18:13:27 +01:00
Microinverter(
std::shared_ptr<class modbus> modbus, long serialNumber);
long serialNumber;
std::vector<Port> ports;
2024-03-16 21:15:15 +01:00
// void updatePorts();
2024-03-16 21:15:15 +01:00
void updatePorts(std::vector<std::string> &parametersToGet, bool allParameters);
2024-03-20 11:28:43 +01:00
2024-03-16 21:15:15 +01:00
void updatePort(int i);
Port getPort(int i);
// void printPorts();
2024-03-20 11:28:43 +01:00
void printPorts(std::vector<std::string> &parametersToGet, bool allParameters);
2024-03-16 21:15:15 +01:00
};
#endif