take over some code from mainwindow

This commit is contained in:
2025-02-26 16:57:57 +01:00
parent 674b572da5
commit b26b65ee76
2 changed files with 38 additions and 0 deletions

View File

@@ -21,6 +21,7 @@
#define SERIAL_PORT "ttyUSB0"
#endif
class QSerialPort;
class Update : public QObject {
Q_OBJECT
@@ -46,6 +47,12 @@ class Update : public QObject {
return QStringLiteral("+%1s").arg(secs, 7, 'f', 2, QChar('0'));
}
bool openSerialPort();
bool closeSerialPort();
QSerialPort *m_serial;
public:
enum class DownloadResult {OK, ERROR, TIMEOUT, NOP};
enum class FileTypeJson {CONFIG=1, DEVICE=2, CASH=3, SERIAL=4, TIME=5, PRINTER=6};