-
Notifications
You must be signed in to change notification settings - Fork 0
/
dltminiserver.h
72 lines (54 loc) · 1.45 KB
/
dltminiserver.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/**
* @licence app begin@
* Copyright (C) 2021 Alexander Wenzel
*
* This file is part of the DLT Multimeter project.
*
* \copyright This code is licensed under GPLv3.
*
* \author Alexander Wenzel <[email protected]>
*
* \file dltminiserver.h
* @licence end@
*/
#ifndef DLTMINISERVER_H
#define DLTMINISERVER_H
#include <QObject>
#include <QXmlStreamWriter>
#include <QXmlStreamReader>
#include <QTcpServer>
#include <QTcpSocket>
class DLTMiniServer : public QObject
{
Q_OBJECT
public:
explicit DLTMiniServer(QObject *parent = nullptr);
~DLTMiniServer();
void start();
void stop();
void sendValue(QString text);
void sendValue2(QString text1,QString text2);
unsigned short getPort() { return port; }
void setPort(unsigned short port) { this->port = port; }
QString getApplicationId() { return applicationId; }
void setApplicationId(QString id) { this->applicationId = id; }
QString getContextId() { return contextId; }
void setContextId(QString id) { this->contextId = id; }
void clearSettings();
void writeSettings(QXmlStreamWriter &xml);
void readSettings(const QString &filename);
signals:
void status(QString text);
private slots:
void readyRead();
void newConnection();
void connected();
void disconnected();
private:
QTcpServer tcpServer;
QTcpSocket *tcpSocket;
unsigned short port;
QString applicationId;
QString contextId;
};
#endif // DLTMINISERVER_H