Subversion Repositories Projects

Rev

Rev 450 | Rev 462 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 450 Rev 451
Line 1... Line 1...
1
#ifndef QT_SERIAL_COMMUNICATION_H
1
#ifndef QT_SERIAL_COMMUNICATION_H
2
#define QT_SERIAL_COMMUNICATION_H
2
#define QT_SERIAL_COMMUNICATION_H
-
 
3
#include <QObject>
-
 
4
#include <QTimer>
3
#include "Communication.h"
5
#include "Communication.h"
4
#include "../SerialPort/ManageSerialPort.h"
6
#include "../SerialPort/ManageSerialPort.h"
5
 
7
 
6
/**
8
/**
7
 * QT specific communication class
9
 * QT specific communication class
Line 9... Line 11...
9
 * using the SerialPort implementation
11
 * using the SerialPort implementation
10
 * by VIANNEY-LIAUD Philippe
12
 * by VIANNEY-LIAUD Philippe
11
 * ( philippe.vianney.liaud gmail.com )
13
 * ( philippe.vianney.liaud gmail.com )
12
 */
14
 */
13
 
15
 
-
 
16
class QTSerialCommunication : public Communication, QObject {
14
using namespace std;
17
    Q_OBJECT
15
 
18
 
16
class QTSerialCommunication : public Communication {
-
 
17
    private:
19
    private:
-
 
20
        //timer to resend data if necessary
-
 
21
        QTimer resendTimer;
-
 
22
        //data that will be resended if the timer
-
 
23
        //got the timeout
-
 
24
        char * resendData;
-
 
25
 
-
 
26
        //Serial Port connection class by Philippe VIANNEY-LIAUD
18
        ManageSerialPort * serial;
27
        ManageSerialPort * serial;
-
 
28
    private slots:
-
 
29
        void slot_resend_timer();
19
    public:
30
    public:
20
        QTSerialCommunication();
31
        QTSerialCommunication();
21
        void connect_MK(char * addr);
32
        void connect_MK(char * addr);
-
 
33
        void received_data(char * data);
22
        void send_cmd(char cmd, int address, char data[150], unsigned int length, bool resend);
34
        void send_cmd(char cmd, int address, char data[150], unsigned int length, bool resend);
23
        void stop_resend();
35
        void stop_resend();
24
};
36
};
25
#endif
37
#endif
26
38