mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-18 06:11:46 -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);
|
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
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user