hoymilesClient/src/main.cpp

27 lines
557 B
C++
Raw Normal View History

2024-03-12 23:26:23 +01:00
#include <iostream>
#include <string>
#include <chrono>
#include <thread>
#include "hoymiles.h"
#include "modbus.h"
2024-03-12 23:26:23 +01:00
int main(){
std::string ip_address {"192.168.31.136"};
int port {502};
// Dtu dtu {ip_address.c_str(), port};
// while(true) {
// dtu.updateMicroinverters();
// }
Port hoymilesPort{modbus_new_tcp(ip_address.c_str(), port), 0x1000};
hoymilesPort.updateParameters();
2024-03-12 23:26:23 +01:00
2024-03-16 15:55:45 +01:00
std::shared_ptr<PortParameter> temp{hoymilesPort.getParameterById(0)};
float temp2 = temp.get()->getValue();
2024-03-12 23:26:23 +01:00
return 0;
}