Rev 450 | Rev 462 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 450 | Rev 451 | ||
---|---|---|---|
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 |
8 | * based on the communication interface |
10 | * based on the communication interface |
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 | */ |
- | 15 | ||
13 | 16 | class QTSerialCommunication : public Communication, QObject { |
|
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: |
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 |