summaryrefslogtreecommitdiff
path: root/printerclient.h
blob: 08bf0c26bf8e902d962401a9dd985669114032c1 (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
31
#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 };
};