2024-03-16 21:15:15 +01:00
|
|
|
#ifndef MICROINVERTER_H
|
|
|
|
|
#define MICROINVERTER_H
|
|
|
|
|
|
|
|
|
|
#include <vector>
|
2024-03-17 21:33:21 +01:00
|
|
|
#include <memory>
|
|
|
|
|
#include <mutex>
|
2024-03-16 21:15:15 +01:00
|
|
|
|
|
|
|
|
#include "port.h"
|
|
|
|
|
|
|
|
|
|
struct _modbus;
|
|
|
|
|
typedef _modbus modbus_t;
|
|
|
|
|
|
|
|
|
|
class Microinverter {
|
|
|
|
|
private:
|
2024-03-17 21:33:21 +01:00
|
|
|
std::shared_ptr<modbus_t*> modbus_context;
|
|
|
|
|
std::mutex *modbus_context_mutex;
|
2024-03-16 21:15:15 +01:00
|
|
|
|
2024-03-18 22:49:32 +01:00
|
|
|
|
2024-03-16 21:15:15 +01:00
|
|
|
|
|
|
|
|
public:
|
2024-03-18 22:49:32 +01:00
|
|
|
Microinverter(std::shared_ptr<modbus_t*> modbus_context, std::mutex *modbus_context_mutex, long serialNumber);
|
|
|
|
|
|
|
|
|
|
long serialNumber;
|
|
|
|
|
|
|
|
|
|
std::vector<Port> ports;
|
2024-03-16 21:15:15 +01:00
|
|
|
|
|
|
|
|
void updatePorts();
|
|
|
|
|
|
|
|
|
|
void updatePort(int i);
|
|
|
|
|
|
|
|
|
|
Port getPort(int i);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|