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

This commit is contained in:
Moritz Martinius
2024-03-23 14:35:43 +01:00
parent d8b70e5d56
commit 1b52fb0458
13 changed files with 86 additions and 53 deletions

View File

@@ -41,6 +41,11 @@
namespace ptprnt::printer {
const PrinterInfo P700Printer::mInfo = {.driverName = "P700",
.name = "Brother P-touch P700",
.version = "v1.0",
.usbId{0x04f9, 0x2061}};
P700Printer::~P700Printer() {
detachUsbDevice();
if (mUsbHndl) {
@@ -80,12 +85,8 @@ const PrinterStatus P700Printer::getPrinterStatus() {
return PrinterStatus{.tapeWidthMm = recvBuf[10]};
}
const uint16_t P700Printer::getVid() {
return mInfo.vid;
}
const uint16_t P700Printer::getPid() {
return mInfo.pid;
const libusbwrap::usbId P700Printer::getUsbId() {
return mInfo.usbId;
}
bool P700Printer::attachUsbDevice(std::shared_ptr<libusbwrap::IUsbDevice> usbHndl) {