blob: d1266dd40fd26b0b3890323ec9ab0ba7bfa071a5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#pragma once
#include <QObject>
#include <QSerialPort>
class QSerialPort;
class PrinterClient : public QObject
{
// Q_OBJECT
public:
explicit PrinterClient(QObject *parent = nullptr);
// ~PrinterClient() override = default;
// ~PrinterClient
// signals:
// void newData(const QString output);
public:
void sendCommand(const QString command);
private:
void onReadyRead();
void onErrorOccured(QSerialPort::SerialPortError error);
private:
QSerialPort* m_serialPort { nullptr };
};
|