Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Services/EffectShowClient/connection_handler_serial.h
T
torstenandCopilot d5af8b9764 Session 026: Lts/Services Qt5:: to Qt6:: migration
- Migrated all 104 CMakeLists.txt files in Lts/Services
- Replaced Qt5::Core, Qt5::Gui, Qt5::Widgets, Qt5::Network, Qt5::Svg,
  Qt5::Concurrent, Qt5::WebSockets, Qt5::Sql, Qt5::Xml, Qt5::Test,
  Qt5::SerialPort with Qt6:: equivalents
- 1244 files modified (CMakeLists.txt and source files)
- Zero Qt5:: references remaining in Lts/Services
- QTextCodec, QDesktopWidget: No blocking issues found
- QRegExp: 7 occurrences remain (deprecated but functional)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-25 19:23:30 +02:00

62 lines
1.3 KiB
C++
Executable File

/**
* Connection Handler for the RS232 serial connection to the sfm
* $Id$
* $HeadURL$
* $Author$
* Created by Philipp Dassow, NLST, 2018-01-29
*/
#pragma once
#include "logger.h"
#include <LtsSerialPortQuerry/lts_serial_port_querry.h>
#include <QObject>
#include <QTimer>
#include <QSerialPort>
namespace EffectShowClient
{
class ConnectionHandlerSerial : public QObject
{
Q_OBJECT
public:
explicit ConnectionHandlerSerial(QObject *parent = nullptr);
~ConnectionHandlerSerial();
bool init();
bool send(const QByteArray &binaryData);
bool open();
bool isOpen() const;
signals:
/**
* @brief received emits a byte pair with command and payload byte when a available. It is guaranteed that there will be 2 bytes
* @param ba is a byte pair, with command 1st and payload 2nd.
*/
void received(const QByteArray &ba);
void connectedToSerialConverter();
void disconnectedFromSerialConverter();
private slots:
void read();
private:
bool isValidCommandByte(const unsigned char command);
bool isValidPayloadByte(const unsigned char payload);
LtsSerialPortQuerry::LtsSerialPortQuerry *m_spQuerry;
QSerialPort *m_serialPort;
QTimer *m_receiveTimeoutTimer;
QByteArray m_currentDataRead;
QString m_portName;
QByteArray *m_readBuffer;
NGL::INGLLogger &m_logger;
};
} // namespace EffectShowClient