mirror of https://github.com/wh201906/Proxmark3GUI
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
914 B
C++
39 lines
914 B
C++
#ifndef PM3PROCESS_H
|
|
#define PM3PROCESS_H
|
|
|
|
#include <QProcess>
|
|
#include <QThread>
|
|
#include <QString>
|
|
#include <QDebug>
|
|
#include <QTimer>
|
|
#include <QtSerialPort/QSerialPortInfo>
|
|
#include <QtSerialPort/QSerialPort>
|
|
|
|
class PM3Process : public QProcess
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit PM3Process(QThread* thread, QObject* parent=nullptr);
|
|
QByteArray readLine(qint64 maxlen = 0);
|
|
QString getRequiredOutput();
|
|
bool waitForReadyRead(int msecs = 2000);
|
|
|
|
void testThread();
|
|
|
|
public slots:
|
|
void setRequiringOutput(bool st);
|
|
void connectPM3(const QString path, const QString port);
|
|
void setSerialListener(const QString &name, bool state);
|
|
private slots:
|
|
void onTimeout();
|
|
private:
|
|
bool isRequiringOutput;
|
|
QString* requiredOutput;
|
|
QTimer* serialListener;
|
|
QSerialPortInfo* portInfo;
|
|
signals:
|
|
void PM3StatedChanged(bool st, QString info="");
|
|
};
|
|
|
|
#endif // PM3PROCESS_H
|