hoymilesClient/inc/hoymiles/port.h

41 lines
686 B
C
Raw Normal View History

2024-03-16 21:15:15 +01:00
#ifndef PORT_H
#define PORT_H
#include <stdint.h>
#include <string>
#include <vector>
#include <memory>
// #include <mutex>
2024-03-16 21:15:15 +01:00
#include "portParametersGeneric.h"
2024-03-19 16:59:41 +01:00
#include "modbus.h"
2024-03-19 16:59:41 +01:00
// struct _modbus;
// typedef _modbus modbus_t;
2024-03-16 21:15:15 +01:00
class Port {
private:
2024-03-19 16:59:41 +01:00
// std::shared_ptr<modbus_t*> modbus_context;
std::shared_ptr<modbus> modbus;
// std::mutex *modbus_context_mutex;
2024-03-16 21:15:15 +01:00
uint16_t portStartAddress;
void populateParameters();
2024-03-19 09:22:21 +01:00
void fixCurrent();
bool currentFixed;
2024-03-16 21:15:15 +01:00
public:
2024-03-19 16:59:41 +01:00
Port(std::shared_ptr<class modbus> modbus, uint16_t portStartAddress);
2024-03-16 21:15:15 +01:00
std::vector<std::shared_ptr<PortParameter>> parameters;
2024-03-16 21:15:15 +01:00
void updateParameters();
void printParameters();
2024-03-16 21:15:15 +01:00
};
#endif