summaryrefslogtreecommitdiff
path: root/printerclient.h
blob: 5f4f2a3f39e565c8672e8974397b7678f492978a (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
#pragma once

#include <QObject>

#include <QSerialPort>

class QSerialPort;

class PrinterClient : public QObject
{
    Q_OBJECT

public:
    explicit PrinterClient(QObject *parent = nullptr);
    ~PrinterClient() override = default;

signals:
    void newData(const QString output);

public slots:
    void sendCommand(const QString command);

private slots:
    void onReadyRead();
    void onErrorOccured(QSerialPort::SerialPortError error);

private:
    QSerialPort* m_serialPort { nullptr };
};