Library for receiving data from fake inverter.
Inverter.h@1:1b1e78592710, 2021-03-24 (annotated)
- Committer:
- khaiminhvn
- Date:
- Wed Mar 24 23:40:29 2021 +0000
- Revision:
- 1:1b1e78592710
- Parent:
- 0:e2b263279a61
Added connect() function
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jump_man | 0:e2b263279a61 | 1 | #ifndef INVERTER_H |
jump_man | 0:e2b263279a61 | 2 | #define INVERTER_H |
jump_man | 0:e2b263279a61 | 3 | |
jump_man | 0:e2b263279a61 | 4 | #include "mbed.h" |
jump_man | 0:e2b263279a61 | 5 | #include "EthernetInterface.h" |
jump_man | 0:e2b263279a61 | 6 | #include "ArduinoJson.h" |
jump_man | 0:e2b263279a61 | 7 | |
jump_man | 0:e2b263279a61 | 8 | class Inverter |
jump_man | 0:e2b263279a61 | 9 | { |
jump_man | 0:e2b263279a61 | 10 | public: |
jump_man | 0:e2b263279a61 | 11 | Inverter(char* url, int port, EthernetInterface* netIn); |
khaiminhvn | 1:1b1e78592710 | 12 | void connect(char* url, int port); |
jump_man | 0:e2b263279a61 | 13 | int getPower(); |
jump_man | 0:e2b263279a61 | 14 | |
jump_man | 0:e2b263279a61 | 15 | private: |
jump_man | 0:e2b263279a61 | 16 | EthernetInterface* eth; |
jump_man | 0:e2b263279a61 | 17 | TCPSocket socket; |
jump_man | 0:e2b263279a61 | 18 | SocketAddress a; |
jump_man | 0:e2b263279a61 | 19 | }; |
jump_man | 0:e2b263279a61 | 20 | #endif |