Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+53
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* Connection Handler for the serial connection to the sfm
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Philipp Dassow, NLST, 2018-01-29
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QTcpSocket>
|
||||
|
||||
#include <LtsUtilsCore/sfm_bytemessage_converter.h>
|
||||
#include "logger.h"
|
||||
|
||||
class QTimer;
|
||||
namespace TrainingAreaBaseOC
|
||||
{
|
||||
|
||||
class ConnectionHandlerTcp : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConnectionHandlerTcp();
|
||||
~ConnectionHandlerTcp();
|
||||
|
||||
bool init();
|
||||
bool send(const LtsUtils::SfmMessage &message);
|
||||
bool open();
|
||||
void close();
|
||||
|
||||
bool isOpen() const;
|
||||
|
||||
signals:
|
||||
void received(const LtsUtils::SfmMessage &message);
|
||||
void disconnectedFromEq();
|
||||
|
||||
|
||||
private slots:
|
||||
void read();
|
||||
void handleError(QAbstractSocket::SocketError error);
|
||||
|
||||
private:
|
||||
QTcpSocket *m_socket = nullptr;
|
||||
QTimer *m_timer = nullptr;
|
||||
QByteArray m_currentDataRead;
|
||||
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
|
||||
} // namespace TrainingAreaBaseOC
|
||||
Reference in new issue
Block a user