Implemented printer status retrieval

This commit is contained in:
2023-08-27 09:29:37 +02:00
parent 5644c84c83
commit f467a39919
9 changed files with 202 additions and 9 deletions

View File

@@ -1,3 +1,5 @@
#include <sys/types.h>
#include <memory>
#include "interface/IPrinterDriver.hpp"
@@ -10,8 +12,8 @@ namespace ptprnt::printer {
class P700Printer : public ::ptprnt::IPrinterDriver {
public:
P700Printer() = default;
~P700Printer() = default;
P700Printer();
~P700Printer();
// delete copy ctor and assignment
P700Printer(const P700Printer&) = delete;
@@ -24,12 +26,15 @@ class P700Printer : public ::ptprnt::IPrinterDriver {
const uint16_t getVid() override;
const std::string_view getVersion() override;
const PrinterInfo getPrinterInfo() override;
const PrinterStatus getPrinterStatus() override;
bool attachUsbDevice(std::shared_ptr<libusbwrap::IUsbDevice> usbHndl) override;
bool detachUsbDevice() override;
bool printBitmap(const Bitmap& bitmap) override;
bool printText(const std::string& text, uint16_t fontSize) override;
private:
bool send(std::vector<uint8_t>& data);
std::shared_ptr<libusbwrap::IUsbDevice> mUsbHndl{nullptr};
PrinterInfo mInfo{.driverName = "P700",