Some refactorings to incoporate CLI parsing
Some checks failed
Build ptprnt / build (push) Failing after 31s
Some checks failed
Build ptprnt / build (push) Failing after 31s
This commit is contained in:
@@ -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]};
|
||||
}
|
||||
|
Reference in New Issue
Block a user