diff options
| author | NielsCoding <n.stunnebrink@student.avans.nl> | 2022-10-29 21:38:47 +0200 | 
|---|---|---|
| committer | NielsCoding <n.stunnebrink@student.avans.nl> | 2022-10-29 21:38:47 +0200 | 
| commit | b5322d74d1839c4af490f5c7297e439a8433ba9b (patch) | |
| tree | 4b7431f7daa0db37ee797d7312dc041700c39f0e /client/Client.h | |
| parent | 06376c3cfefdb01f8f4884c1b853edc16c89d1c8 (diff) | |
merging TCPcode with main QT code
Diffstat (limited to 'client/Client.h')
| -rw-r--r-- | client/Client.h | 45 | 
1 files changed, 45 insertions, 0 deletions
| diff --git a/client/Client.h b/client/Client.h new file mode 100644 index 0000000..10af3e1 --- /dev/null +++ b/client/Client.h @@ -0,0 +1,45 @@ +#ifndef CLIENT_H +#define CLIENT_H +#include <QTcpSocket> +#include <QTextStream> +#include <QTimer> +#include <QDateTime> +#include <QSqlQuery> + +#include "HandleMessage.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 NextMinute; // timing for next minute +    // qint16 currentMinute; // timing for currentMinute +    HandleMessage Handlemsg; // add HandleMessage to Client.h + +    int tcpPortAddress = 80; // port of communication via tcp +    QString networkAddress = "192.168.137.76"; // 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 |