AusweisApp2/test/helper/PersoSimController.h

42 lines
636 B
C
Raw Normal View History

2017-07-03 09:30:10 +02:00
/*!
* \brief Controller for an external PersoSim process.
*
2019-05-22 10:08:38 +02:00
* \copyright Copyright (c) 2014-2019 Governikus GmbH & Co. KG, Germany
2017-07-03 09:30:10 +02:00
*/
#pragma once
#include <QByteArray>
#include <QObject>
#include <QProcess>
2017-12-20 14:54:05 +01:00
#include <QTcpSocket>
2017-07-03 09:30:10 +02:00
namespace governikus
{
class PersoSimController
: public QObject
{
Q_OBJECT
public:
PersoSimController();
2017-12-20 14:54:05 +01:00
~PersoSimController() = default;
2017-07-03 09:30:10 +02:00
2017-12-20 14:54:05 +01:00
bool isEnabled() const;
2017-07-03 09:30:10 +02:00
bool init();
2017-12-20 14:54:05 +01:00
bool write(const QByteArray& pData);
bool shutdown();
2017-07-03 09:30:10 +02:00
private:
2017-12-20 14:54:05 +01:00
QProcess* mProcess;
const QSharedPointer<QTcpSocket> mSocket;
2017-07-03 09:30:10 +02:00
2017-12-20 14:54:05 +01:00
bool startProcess();
void newData();
2017-07-03 09:30:10 +02:00
};
2019-01-03 15:06:22 +01:00
} // namespace governikus