Initial lib commit with cmake
This commit is contained in:
commit
e39d6cda18
31 changed files with 7172 additions and 0 deletions
49
inc/port.h
Normal file
49
inc/port.h
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
#ifndef PORT_H
|
||||
#define PORT_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "portParametersGeneric.h"
|
||||
#include "portParameters.h"
|
||||
#include "modbus.h"
|
||||
|
||||
class Port {
|
||||
private:
|
||||
void populateParameters();
|
||||
|
||||
void fixCurrent();
|
||||
bool currentFixed;
|
||||
|
||||
// void increaseParametersAge();
|
||||
|
||||
public:
|
||||
Port(int portStartAddress);
|
||||
|
||||
int portStartAddress;
|
||||
|
||||
int statusPortStartAddress;
|
||||
|
||||
std::vector<std::shared_ptr<PortParameter>> parameters;
|
||||
|
||||
std::vector<std::shared_ptr<PortParameter>> statusParameters;
|
||||
|
||||
std::pair<std::shared_ptr<PortParameter>, bool> getParameterByName(std::string name);
|
||||
|
||||
std::pair<std::shared_ptr<PortParameter>, bool> getStatusByName(std::string name);
|
||||
|
||||
// void updateParameters(std::vector<std::string> ¶metersToGet, bool allParameters);
|
||||
|
||||
void setParametersFromMicroinverterArray(uint16_t *registers, int addressOffset);
|
||||
|
||||
void setStatusesFromMicroinverterArray(uint16_t *registers, int addressOffset);
|
||||
|
||||
void printParameters(std::vector<std::string> ¶metersToGet, bool allParameters, bool shortNames);
|
||||
|
||||
void turnOff(modbus_t *modbus);
|
||||
|
||||
bool isOff(modbus_t *modbus);
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue