-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathip_connection.h
56 lines (42 loc) · 939 Bytes
/
ip_connection.h
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
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef IP_CONNECTION_H
#define IP_CONNECTION_H
#include <QObject>
#include <QDebug>
#include <QString>
#include <QByteArray>
#include <QTcpSocket>
#include <QAbstractSocket>
#include "tests.h"
class Tests;
class IP_Connection : public QObject
{
Q_OBJECT
public:
explicit IP_Connection(QObject *parent = 0);
~IP_Connection();
signals:
void Connected();
void Disconnected();
void dataReceived();
private:
QString IP_Address;
int port;
QTcpSocket *socket;
int Delay_waitForConnected;
int Delay_waitForBytesWritten;
int Delay_waitForReadyRead;
bool _Connected;
void IP_Init();
private slots:
void sdisconnected();
public:
friend Tests;
bool IsConnected();
bool PCB_Connect();
void PCB_Disconnect();
void PCB_SendData(QString);
QByteArray PCB_ReceiveData();
void SetIPAddress(QString);
QByteArray readAll();
};
#endif // IP_CONNECTION_H