cli-parser (#4)
All checks were successful
Build ptprnt / build (push) Successful in 1m22s

Goal of this PR should be to integrate a working CLI parser so that commands can be sent to the Printer class to print text, such as
ptprnt -t=FooBar
also, standard flags for setting the output verbosity and help should be implemented

Reviewed-on: #4
This commit is contained in:
2023-10-22 19:42:59 +00:00
parent 7d0cb89bda
commit 9a1aee6658
11 changed files with 197 additions and 53 deletions

View File

@@ -72,13 +72,10 @@ const PrinterStatus P700Printer::getPrinterStatus() {
int tx = 0;
int tries = 0;
std::vector<uint8_t> recvBuf(32);
do {
while (tries++ < MAX_TRIES_GET_STATUS) {
std::this_thread::sleep_for(100ms);
mUsbHndl->bulkTransfer(0x81, recvBuf, &tx, 0);
if (tries++ > 10) {
break;
}
} while (tx == 0);
mUsbHndl->bulkTransfer(commands["printerinfo"][0], recvBuf, &tx, 0);
}
return PrinterStatus{.tapeWidthMm = recvBuf[10]};
}