hoymilesClient/inc/hoymiles/port.h
2024-03-19 09:22:21 +01:00

37 lines
No EOL
655 B
C++

#ifndef PORT_H
#define PORT_H
#include <stdint.h>
#include <string>
#include <vector>
#include <memory>
#include <mutex>
#include "portParametersGeneric.h"
struct _modbus;
typedef _modbus modbus_t;
class Port {
private:
std::shared_ptr<modbus_t*> modbus_context;
std::mutex *modbus_context_mutex;
uint16_t portStartAddress;
void populateParameters();
void fixCurrent();
bool currentFixed;
public:
Port(std::shared_ptr<modbus_t*> modbus_context, std::mutex *modbus_context_mutex, uint16_t portStartAddress);
std::vector<std::shared_ptr<PortParameter>> parameters;
void updateParameters();
void printParameters();
};
#endif