blob: f675a8908137b947ff28e60e532f64c70558b648 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#ifndef CLIENT_H
#define CLIENT_H
#include <QTcpSocket>
#include <QTextStream>
#include <QTimer>
#include <QDateTime>
#include <QSqlQuery>
#include "HandleMessage.h"
#include "../shared/wifi.h"
// class client for wheather station
class Client : public QObject
{
Q_OBJECT
public:
Client(QObject *parent = 0);
virtual ~Client();
public slots:
void ClientEcho(); // function to ask data from wheather station
void timeFunction(); // function to look every second what time currently is en handle if minute is passed
private:
void missingRecords();
int _missingRecords;
QTcpSocket *socket; // tcpsocket for communicating
QTimer *timer; // timer to read every second what time it curruntly is.
// qint16 currentMinute; // timing for currentMinute
HandleMessage Handlemsg; // add HandleMessage to Client.h
int tcpPortAddress = WS_SERVER_PORT; // port of communication via tcp
QString networkAddress = WS_ESP8266_WLAN_IP; // network address for commincation via tcp
QString msg = "last-records "; // part of mesage to send to wheather staion
char totalRecords = '1'; // total records to ask wheather station
char offsetRecords = '0'; // offset from reqeusting records
};
#endif // CLIENT_H
|