1
0
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:
f4exb 2024-05-21 01:08:10 +02:00
parent eb877fa7c7
commit 254b100373
2 changed files with 13 additions and 1 deletions

View File

@ -262,7 +262,17 @@ bool MorseDecoder::handleMessage(const Message& cmd)
getMessageQueueToGUI()->push(msg); 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; return true;
} }
else else

View File

@ -23,6 +23,7 @@
#include <QRecursiveMutex> #include <QRecursiveMutex>
#include <QFile> #include <QFile>
#include <QTextStream> #include <QTextStream>
#include <QUdpSocket>
#include "feature/feature.h" #include "feature/feature.h"
#include "util/message.h" #include "util/message.h"
@ -234,6 +235,7 @@ private:
QFile m_logFile; QFile m_logFile;
QTextStream m_logStream; QTextStream m_logStream;
QUdpSocket m_udpSocket;
QNetworkAccessManager *m_networkManager; QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest; QNetworkRequest m_networkRequest;