Library for receiving data from fake inverter.

Files at this revision

API Documentation at this revision

Comitter:
khaiminhvn
Date:
Wed Mar 24 23:40:29 2021 +0000
Parent:
0:e2b263279a61
Commit message:
Added connect() function

Changed in this revision

Inverter.cpp Show annotated file Show diff for this revision Revisions of this file
Inverter.h Show annotated file Show diff for this revision Revisions of this file
diff -r e2b263279a61 -r 1b1e78592710 Inverter.cpp
--- a/Inverter.cpp	Wed Mar 17 16:13:45 2021 +0000
+++ b/Inverter.cpp	Wed Mar 24 23:40:29 2021 +0000
@@ -3,6 +3,10 @@
 Inverter::Inverter(char* url, int port, EthernetInterface* ethIn)
 {
     eth = ethIn;
+    connect(url,port);
+}
+
+void Inverter::connect(char* url, int port){
     eth->gethostbyname(url, &a);
     a.set_port(port);
 }
diff -r e2b263279a61 -r 1b1e78592710 Inverter.h
--- a/Inverter.h	Wed Mar 17 16:13:45 2021 +0000
+++ b/Inverter.h	Wed Mar 24 23:40:29 2021 +0000
@@ -9,6 +9,7 @@
 {
 public:
     Inverter(char* url, int port, EthernetInterface* netIn);
+    void connect(char* url, int port);
     int getPower();
     
 private: