forked from 7h0ma5/QLog
-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathAdifUDPReceiver.h
More file actions
40 lines (29 loc) · 817 Bytes
/
Copy pathAdifUDPReceiver.h
File metadata and controls
40 lines (29 loc) · 817 Bytes
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
#ifndef QLOG_CORE_ADIFUDPRECEIVER_H
#define QLOG_CORE_ADIFUDPRECEIVER_H
#include <QObject>
#include <QSqlRecord>
class QUdpSocket;
class AdifUDPReceiver : public QObject
{
Q_OBJECT
public:
explicit AdifUDPReceiver(QObject *parent = nullptr);
static quint16 getConfigPort();
static void saveConfigPort(quint16 port);
static bool getConfigEnabled();
static void saveConfigEnabled(bool enabled);
signals:
void addContact(QSqlRecord record);
public slots:
void reloadSetting();
private slots:
void readPendingDatagrams();
private:
void openPort();
void closePort();
void processDatagram(const QByteArray &data);
void emitRecords(const QString &adif);
QUdpSocket *socket;
static const int DEFAULT_PORT = 2333;
};
#endif // QLOG_CORE_ADIFUDPRECEIVER_H