Rev 263 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 263 | Rev 313 | ||
---|---|---|---|
Line 19... | Line 19... | ||
19 | #ifndef CCONNECTION_H |
19 | #ifndef CCONNECTION_H |
20 | #define CCONNECTION_H |
20 | #define CCONNECTION_H |
Line 21... | Line 21... | ||
21 | 21 | ||
22 | #include <QObject> |
22 | #include <QObject> |
- | 23 | #include <QTcpSocket> |
|
Line 23... | Line 24... | ||
23 | #include <QTcpSocket> |
24 | #include <QTimer> |
24 | 25 | ||
25 | #include "ToolBox.h" |
26 | #include "ToolBox.h" |
Line 37... | Line 38... | ||
37 | cConnection(); |
38 | cConnection(); |
38 | bool isOpen(); |
39 | bool isOpen(); |
39 | bool Open(int Typ, QString Address); |
40 | bool Open(int Typ, QString Address); |
40 | bool Close(); |
41 | bool Close(); |
41 | bool send_Cmd(char CMD, int Address, char Data[150],unsigned int Length, bool Resend = true); |
42 | bool send_Cmd(char CMD, int Address, char Data[150],unsigned int Length, bool Resend = true); |
- | 43 | void stop_ReSend(); |
|
Line 42... | Line 44... | ||
42 | 44 | ||
43 | private: |
45 | private: |
44 | ManageSerialPort *TTY; |
46 | ManageSerialPort *TTY; |
- | 47 | QTcpSocket *TcpSocket; |
|
- | 48 | QTimer *o_Timer; |
|
- | 49 | ||
- | 50 | QByteArray s_ReSend; |
|
45 | QTcpSocket *TcpSocket; |
51 | |
46 | bool b_isOpen; |
52 | bool b_isOpen; |
47 | int i_Type; |
53 | int i_Type; |
Line 48... | Line 54... | ||
48 | sRxData RxData; |
54 | sRxData RxData; |
Line 52... | Line 58... | ||
52 | private slots: |
58 | private slots: |
53 | void slot_newDataReceived(const QByteArray &dataReceived); |
59 | void slot_newDataReceived(const QByteArray &dataReceived); |
54 | void slot_IP_Connected(); |
60 | void slot_IP_Connected(); |
55 | void slot_IP_Disconnect(); |
61 | void slot_IP_Disconnect(); |
56 | void slot_IP_ReadLine(); |
62 | void slot_IP_ReadLine(); |
- | 63 | ||
- | 64 | void slot_Timer(); |
|
57 | // void slot_Error(QAbstractSocket::SocketError Error); |
65 | // void slot_Error(QAbstractSocket::SocketError Error); |
Line 58... | Line 66... | ||
58 | 66 | ||
59 | signals: |
67 | signals: |
60 | void newData(sRxData RxData); |
68 | void newData(sRxData RxData); |