This Commit adds a rudimentary printer factory to greatly simplify the creation of printers
All checks were successful
Build ptprnt / build (push) Successful in 1m36s
All checks were successful
Build ptprnt / build (push) Successful in 1m36s
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "interface/IPrinterDriver.hpp"
|
||||
#include "interface/IPrinterTypes.hpp"
|
||||
#include "libusbwrap/LibUsbTypes.hpp"
|
||||
#include "libusbwrap/interface/IUsbDevice.hpp"
|
||||
|
||||
#pragma once
|
||||
@@ -44,11 +45,13 @@ class P700Printer : public ::ptprnt::IPrinterDriver {
|
||||
P700Printer(P700Printer&&) = default;
|
||||
P700Printer& operator=(P700Printer&&) = default;
|
||||
|
||||
// Printer info has to be static to be accessed without instantiation
|
||||
static const PrinterInfo mInfo;
|
||||
|
||||
// IPrinterDriver
|
||||
const std::string_view getDriverName() override;
|
||||
const std::string_view getName() override;
|
||||
const uint16_t getPid() override;
|
||||
const uint16_t getVid() override;
|
||||
const libusbwrap::usbId getUsbId() override;
|
||||
const std::string_view getVersion() override;
|
||||
const PrinterInfo getPrinterInfo() override;
|
||||
const PrinterStatus getPrinterStatus() override;
|
||||
@@ -62,12 +65,6 @@ class P700Printer : public ::ptprnt::IPrinterDriver {
|
||||
bool init();
|
||||
|
||||
std::shared_ptr<libusbwrap::IUsbDevice> mUsbHndl{nullptr};
|
||||
|
||||
static constexpr PrinterInfo mInfo{.driverName = "P700",
|
||||
.name = "Brother P-touch P700",
|
||||
.version = "v1.0",
|
||||
.vid = 0x04f9,
|
||||
.pid = 0x2061};
|
||||
std::map<std::string, std::vector<uint8_t>> commands{
|
||||
{"rasterstart",
|
||||
{0x1b, 0x69, 0x61,
|
||||
|
Reference in New Issue
Block a user