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

@@ -31,6 +31,8 @@
namespace ptprnt::printer {
constexpr uint8_t MAX_TRIES_GET_STATUS = 10;
class P700Printer : public ::ptprnt::IPrinterDriver {
public:
P700Printer() = default;
@@ -61,11 +63,11 @@ class P700Printer : public ::ptprnt::IPrinterDriver {
std::shared_ptr<libusbwrap::IUsbDevice> mUsbHndl{nullptr};
PrinterInfo mInfo{.driverName = "P700",
.name = "Brother P-touch P700",
.version = "v1.0",
.vid = 0x04f9,
.pid = 0x2061};
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,
@@ -75,7 +77,7 @@ class P700Printer : public ::ptprnt::IPrinterDriver {
{"lf", {0x5a}},
{"ff", {0x0c}},
{"eject", {0x1a}},
};
{"printerinfo", {0x81}}};
};
} // namespace ptprnt::printer