mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 01:55:48 -05:00
Morse Decoder: implement UDP
This commit is contained in:
parent
eb877fa7c7
commit
254b100373
@ -262,7 +262,17 @@ bool MorseDecoder::handleMessage(const Message& cmd)
|
||||
getMessageQueueToGUI()->push(msg);
|
||||
}
|
||||
|
||||
// TODO: send via UDP
|
||||
// Send via UDP
|
||||
if (m_settings.m_udpEnabled)
|
||||
{
|
||||
QByteArray bytes = MorseDecoderSettings::formatText(report.getText()).toUtf8();
|
||||
m_udpSocket.writeDatagram(
|
||||
bytes,
|
||||
bytes.size(),
|
||||
QHostAddress(m_settings.m_udpAddress), m_settings.m_udpPort
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <QRecursiveMutex>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include <QUdpSocket>
|
||||
|
||||
#include "feature/feature.h"
|
||||
#include "util/message.h"
|
||||
@ -234,6 +235,7 @@ private:
|
||||
QFile m_logFile;
|
||||
QTextStream m_logStream;
|
||||
|
||||
QUdpSocket m_udpSocket;
|
||||
QNetworkAccessManager *m_networkManager;
|
||||
QNetworkRequest m_networkRequest;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user