Subversion Repositories Projects

Rev

Rev 250 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 250 Rev 263
Line 18... Line 18...
18
 ***************************************************************************/
18
 ***************************************************************************/
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>
-
 
23
#include <QTcpSocket>
22
#include <QObject>
24
 
23
#include "ToolBox.h"
25
#include "ToolBox.h"
24
#include "../global.h"
26
#include "../global.h"
Line -... Line 27...
-
 
27
#include "../SerialPort/ManageSerialPort.h"
-
 
28
 
-
 
29
#define C_TTY 1
25
#include "../SerialPort/ManageSerialPort.h"
30
#define C_IP 2
26
 
31
 
27
class cConnection : public QObject
32
class cConnection : public QObject
Line 28... Line 33...
28
{
33
{
29
    Q_OBJECT
34
    Q_OBJECT
30
 
35
 
31
    public:
36
    public:
32
        cConnection();
37
        cConnection();
33
        bool isOpen();
38
        bool isOpen();
Line 34... Line 39...
34
        bool Open(QString Address);
39
        bool Open(int Typ, QString Address);
35
        bool Close();
40
        bool Close();
-
 
41
        bool send_Cmd(char CMD, int Address, char Data[150],unsigned int Length, bool Resend = true);
36
        bool send_Cmd(char CMD, int Address, char Data[150],unsigned int Length, bool Resend = true);
42
 
-
 
43
    private:
37
 
44
        ManageSerialPort *TTY;
Line -... Line 45...
-
 
45
        QTcpSocket *TcpSocket;
-
 
46
        bool b_isOpen;
38
    private:
47
        int  i_Type;
39
        ManageSerialPort *TTY;
48
        sRxData RxData;
-
 
49
 
-
 
50
        void new_Data(QString Data);
-
 
51
 
-
 
52
    private slots:
Line 40... Line 53...
40
        bool b_isOpen;
53
        void slot_newDataReceived(const QByteArray &dataReceived);
41
        sRxData RxData;
54
        void slot_IP_Connected();
42
 
55
        void slot_IP_Disconnect();
43
    private slots:
56
        void slot_IP_ReadLine();