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.
Proxmark3GUI/pm3process.cpp

30 lines
774 B
C++

#include "pm3process.h"
PM3Process::PM3Process(QObject* parent): QProcess(parent)
{
5 years ago
setProcessChannelMode(PM3Process::MergedChannels);
}
5 years ago
QStringList PM3Process::findPort()
{
QSerialPort serial;
QStringList retList;
foreach(const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
{
serial.setPort(info);
if(serial.open(QIODevice::ReadWrite))
{
retList<<info.portName();
serial.close();
}
}
return retList;
}
5 years ago
bool PM3Process::start(const QString path, const QString port)
{
5 years ago
// using "-f" option to make the client output flushed after every print.
QProcess::start(path, QStringList()<<port<<"-f",QProcess::Unbuffered|QProcess::ReadWrite);
return waitForStarted();
}