Mercurial > public > ostc_companion
diff Serial.h @ 10:9a3c1a6f9833
TODO: FIX HW flow control definitions in case of problem during communication. Background: Flags are not defined in terminos header
| author | Ideenmodellierer |
|---|---|
| date | Mon, 12 Jan 2026 13:55:38 +0000 |
| parents | 0b3630a29ad8 |
| children |
line wrap: on
line diff
--- a/Serial.h Mon Jan 12 13:52:28 2026 +0000 +++ b/Serial.h Mon Jan 12 13:55:38 2026 +0000 @@ -44,43 +44,43 @@ class QString; -#include <QtGlobal> // Q_OS_WIN +#include <QtGlobal> // Q_OS_WIN #ifdef Q_OS_WIN #ifndef NOMINMAX -# define NOMINMAX +#define NOMINMAX #endif //# define NOMINMAX -# include <windows.h> -# define S_HANDLE HANDLE -# undef NOMINMAX +#include <windows.h> +#define S_HANDLE HANDLE +#undef NOMINMAX #else -# define S_HANDLE int +#define S_HANDLE int #endif ////////////////////////////////////////////////////////////////////////////// // \brief RS232 serial i/o -class Serial +class Serial { - S_HANDLE _hSerial; - bool _isOpen; + S_HANDLE _hSerial; + bool _isOpen; public: inline Serial() - : _hSerial(0), - _isOpen(false) + : _hSerial(0) + , _isOpen(false) {} virtual ~Serial(); - virtual void open(const QString &port, const QString& type); + virtual void open(const QString &port, const QString &type); virtual void close(); virtual void writeByte(unsigned char byte) const; virtual unsigned char readByte() const; - virtual void writeBlock(const unsigned char* ptr, unsigned int size) const; - virtual unsigned int readBlock(unsigned char* ptr, unsigned int size) const; + virtual void writeBlock(const unsigned char *ptr, unsigned int size) const; + virtual unsigned int readBlock(unsigned char *ptr, unsigned int size) const; virtual void purge(); virtual void flush() const;
