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" |
Line 5... | Line 7... | ||
5 | 7 | ||
6 | /** |
8 | /** |
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 | */ |
Line -... | Line 15... | ||
- | 15 | ||
13 | 16 | class QTSerialCommunication : public Communication, QObject { |
|
Line 14... | Line -... | ||
14 | using namespace std; |
- | |
15 | 17 | Q_OBJECT |
|
- | 18 | ||
- | 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; |
|
16 | class QTSerialCommunication : public Communication { |
25 | |
- | 26 | //Serial Port connection class by Philippe VIANNEY-LIAUD |
|
- | 27 | ManageSerialPort * serial; |
|
17 | private: |
28 | private slots: |
18 | ManageSerialPort * serial; |
29 | void slot_resend_timer(); |
19 | public: |
30 | public: |
- | 31 | QTSerialCommunication(); |
|
20 | QTSerialCommunication(); |
32 | void connect_MK(char * addr); |
21 | 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 | }; |