supla-device
Loading...
Searching...
No Matches
afore.h
1// SPDX-FileCopyrightText: AC SOFTWARE SP. Z O.O.
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#ifndef SRC_SUPLA_PV_AFORE_H_
5#define SRC_SUPLA_PV_AFORE_H_
6
7#include <IPAddress.h>
8#include <supla/sensor/one_phase_electricity_meter.h>
9#include <supla/network/client.h>
10
11#define LOGIN_AND_PASSOWORD_MAX_LENGTH 100
12
13namespace Supla {
14namespace PV {
16 public:
17 Afore(IPAddress ip, int port, const char *loginAndPassword);
18 void readValuesFromDevice();
19 void iterateAlways();
20 bool iterateConnected();
21
22 protected:
23 ::Supla::Client *client = nullptr;
24 IPAddress ip;
25 int port;
26 char loginAndPassword[LOGIN_AND_PASSOWORD_MAX_LENGTH];
27 char buf[80];
28 unsigned _supla_int64_t totalGeneratedEnergy;
29 _supla_int_t currentPower;
30 int bytesCounter;
31 int retryCounter;
32 bool vFound;
33 bool varFound;
34 bool dataIsReady;
35 bool dataFetchInProgress;
36 uint32_t connectionTimeoutMs;
37};
38}; // namespace PV
39}; // namespace Supla
40
41#endif // SRC_SUPLA_PV_AFORE_H_
Definition ip_address.h:15
Definition client.h:24
Definition afore.h:15
bool iterateConnected()
Method called on each SuplaDevice iteration when device is connected and registered to Supla server o...
Definition afore.cpp:105
void iterateAlways()
Method called on each SuplaDevice iteration.
Definition afore.cpp:37
Definition one_phase_electricity_meter.h:11