Subversion Repositories Projects

Rev

Rev 451 | Rev 500 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
449 Brean 1
#ifndef QT_SERIAL_COMMUNICATION_H
2
#define QT_SERIAL_COMMUNICATION_H
451 Brean 3
#include <QObject>
4
#include <QTimer>
449 Brean 5
#include "Communication.h"
6
#include "../SerialPort/ManageSerialPort.h"
392 Brean 7
 
8
/**
9
 * QT specific communication class
10
 * based on the communication interface
11
 * using the SerialPort implementation
12
 * by VIANNEY-LIAUD Philippe
13
 * ( philippe.vianney.liaud gmail.com )
14
 */
15
 
462 Brean 16
class QTSerialCommunication : public QObject, public Communication {
451 Brean 17
    Q_OBJECT
396 Brean 18
 
449 Brean 19
    private:
451 Brean 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
449 Brean 27
        ManageSerialPort * serial;
451 Brean 28
    private slots:
29
        void slot_resend_timer();
392 Brean 30
    public:
449 Brean 31
        QTSerialCommunication();
450 Brean 32
        void connect_MK(char * addr);
451 Brean 33
        void received_data(char * data);
450 Brean 34
        void send_cmd(char cmd, int address, char data[150], unsigned int length, bool resend);
397 Brean 35
        void stop_resend();
392 Brean 36
};
37
#endif