diff options
Diffstat (limited to 'src/Xpl2Protocol.h')
| -rw-r--r-- | src/Xpl2Protocol.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Xpl2Protocol.h b/src/Xpl2Protocol.h new file mode 100644 index 0000000..6d4a348 --- /dev/null +++ b/src/Xpl2Protocol.h @@ -0,0 +1,27 @@ +/** + * @file Xpl2Protocol.h + * @brief Wire framing for the XPL2 printhead protocol. + */ +#pragma once + +#include <QByteArray> +#include <QVariantList> + +namespace Xpl2Protocol +{ + +constexpr char Terminator = '\n'; + +struct ParsedMessage +{ + QByteArray command; + QVariantList params; + bool valid = false; +}; + +QByteArray buildMessage (const QByteArray &command, + const QVariantList ¶ms = {}); + +ParsedMessage parseMessage (const QByteArray &raw); + +} // namespace Xpl2Protocol |
