diff options
| author | XaviDCR92 <xavi.dcr@gmail.com> | 2017-07-20 23:54:08 +0200 |
|---|---|---|
| committer | XaviDCR92 <xavi.dcr@gmail.com> | 2017-07-20 23:54:08 +0200 |
| commit | f4b10b24bcf178e1d9072fb494922c875c0ecb0a (patch) | |
| tree | d392dc48f77546abeb56d2e209845bc50a47c07e /qpsxserial.h | |
| download | qpsxserial-f4b10b24bcf178e1d9072fb494922c875c0ecb0a.tar.gz | |
+ Added first version of QPSXSerial. Still lot of job to do and room for improvement.
Diffstat (limited to 'qpsxserial.h')
| -rw-r--r-- | qpsxserial.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/qpsxserial.h b/qpsxserial.h new file mode 100644 index 0000000..2728ce3 --- /dev/null +++ b/qpsxserial.h @@ -0,0 +1,54 @@ +#ifndef QPSXSERIAL_H +#define QPSXSERIAL_H + +#include <QMainWindow> +#include <QtSerialPort/QSerialPort> +#include <QString> +#include <QDebug> +#include <QTimer> +#include <QThread> +#include <QTime> +#include <QWinTaskbarButton> + +namespace Ui { +class QPSXSerial; +} + +class QPSXSerial : public QMainWindow +{ + Q_OBJECT + +public: + explicit QPSXSerial(QWidget *parent = 0); + ~QPSXSerial(); + +private: + bool sendExe(void); + void sendData(QByteArray data, QString fileName); + void sendDataSize(quint32 size); + + Ui::QPSXSerial *ui; + QString inputExe; + QString selectedPort; + QString selectedFolder; + QSerialPort serial; + bool ack; + bool exe_sent; + QTimer* init_timer; + bool write_ready; + bool byte_sent_received; + QByteArray last_packet_sent; + QTimer* lost_packet_timer; + +private slots: + void onLoadFileBtnReleased(void); + void onUpdatePortsBtnReleased(void); + void onSendBtnReleased(void); + void onPortSelectedComboBox(QString); + void onBytesWritten(qint64); + void onReadyRead(void); + void connectToPSXTimeout(void); + void onPacketLost(void); +}; + +#endif // QPSXSERIAL_H |
