SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
plugins
samplesource
remoteinput
remoteinputudphandler.h
Go to the documentation of this file.
1
// Copyright (C) 2016 Edouard Griffiths, F4EXB //
3
// //
4
// This program is free software; you can redistribute it and/or modify //
5
// it under the terms of the GNU General Public License as published by //
6
// the Free Software Foundation as version 3 of the License, or //
7
// (at your option) any later version. //
8
// //
9
// This program is distributed in the hope that it will be useful, //
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12
// GNU General Public License V3 for more details. //
13
// //
14
// You should have received a copy of the GNU General Public License //
15
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
17
18
#ifndef PLUGINS_SAMPLESOURCE_REMOTEINPUT_REMOTEINPUTUDPHANDLER_H_
19
#define PLUGINS_SAMPLESOURCE_REMOTEINPUT_REMOTEINPUTUDPHANDLER_H_
20
21
#include <QObject>
22
#include <QUdpSocket>
23
#include <QHostAddress>
24
#include <QMutex>
25
#include <QElapsedTimer>
26
27
#include "
remoteinputbuffer.h
"
28
29
#define REMOTEINPUT_THROTTLE_MS 50
30
31
class
SampleSinkFifo
;
32
class
MessageQueue
;
33
class
QTimer;
34
class
DeviceAPI
;
35
36
class
RemoteInputUDPHandler
:
public
QObject
37
{
38
Q_OBJECT
39
public
:
40
RemoteInputUDPHandler
(
SampleSinkFifo
* sampleFifo,
DeviceAPI
*deviceAPI);
41
~RemoteInputUDPHandler
();
42
void
setMessageQueueToGUI
(
MessageQueue
*queue) {
m_outputMessageQueueToGUI
= queue; }
43
void
start
();
44
void
stop
();
45
void
configureUDPLink
(
const
QString& address, quint16 port);
46
void
getRemoteAddress
(QString& s)
const
{ s =
m_remoteAddress
.toString(); }
47
int
getNbOriginalBlocks
()
const
{
return
RemoteNbOrginalBlocks; }
48
bool
isStreaming
()
const
{
return
m_masterTimerConnected
; }
49
int
getSampleRate
()
const
{
return
m_samplerate
; }
50
int
getCenterFrequency
()
const
{
return
m_centerFrequency
; }
51
int
getBufferGauge
()
const
{
return
m_remoteInputBuffer
.
getBufferGauge
(); }
52
uint64_t
getTVmSec
()
const
{
return
m_tv_msec
; }
53
int
getMinNbBlocks
() {
return
m_remoteInputBuffer
.
getMinNbBlocks
(); }
54
int
getMaxNbRecovery
() {
return
m_remoteInputBuffer
.
getMaxNbRecovery
(); }
55
public
slots:
56
void
dataReadyRead
();
57
58
private
:
59
DeviceAPI
*
m_deviceAPI
;
60
const
QTimer&
m_masterTimer
;
61
bool
m_masterTimerConnected
;
62
bool
m_running
;
63
uint32_t
m_rateDivider
;
64
RemoteInputBuffer
m_remoteInputBuffer
;
65
QUdpSocket *
m_dataSocket
;
66
QHostAddress
m_dataAddress
;
67
QHostAddress
m_remoteAddress
;
68
quint16
m_dataPort
;
69
bool
m_dataConnected
;
70
char
*
m_udpBuf
;
71
qint64
m_udpReadBytes
;
72
SampleSinkFifo
*
m_sampleFifo
;
73
uint32_t
m_samplerate
;
74
uint64_t
m_centerFrequency
;
75
uint64_t
m_tv_msec
;
76
MessageQueue
*
m_outputMessageQueueToGUI
;
77
uint32_t
m_tickCount
;
78
std::size_t
m_samplesCount
;
79
QTimer *
m_timer
;
80
81
QElapsedTimer
m_elapsedTimer
;
82
int
m_throttlems
;
83
int32_t
m_readLengthSamples
;
84
uint32_t
m_readLength
;
85
int32_t
*
m_converterBuffer
;
86
uint32_t
m_converterBufferNbSamples
;
87
bool
m_throttleToggle
;
88
bool
m_autoCorrBuffer
;
89
90
void
connectTimer
();
91
void
disconnectTimer
();
92
void
processData
();
93
94
private
slots:
95
void
tick
();
96
};
97
98
99
100
#endif
/* PLUGINS_SAMPLESOURCE_REMOTEINPUT_REMOTEINPUTUDPHANDLER_H_ */
RemoteInputUDPHandler::m_centerFrequency
uint64_t m_centerFrequency
Definition:
remoteinputudphandler.h:74
RemoteInputUDPHandler::m_throttleToggle
bool m_throttleToggle
Definition:
remoteinputudphandler.h:87
MessageQueue
Definition:
messagequeue.h:29
RemoteInputUDPHandler::m_converterBufferNbSamples
uint32_t m_converterBufferNbSamples
Definition:
remoteinputudphandler.h:86
RemoteInputUDPHandler::m_samplesCount
std::size_t m_samplesCount
Definition:
remoteinputudphandler.h:78
DeviceAPI
Definition:
deviceapi.h:42
RemoteInputUDPHandler::getMinNbBlocks
int getMinNbBlocks()
Definition:
remoteinputudphandler.h:53
RemoteInputUDPHandler::connectTimer
void connectTimer()
Definition:
remoteinputudphandler.cpp:217
RemoteInputUDPHandler::setMessageQueueToGUI
void setMessageQueueToGUI(MessageQueue *queue)
Definition:
remoteinputudphandler.h:42
RemoteInputUDPHandler::m_sampleFifo
SampleSinkFifo * m_sampleFifo
Definition:
remoteinputudphandler.h:72
RemoteInputUDPHandler::m_dataPort
quint16 m_dataPort
Definition:
remoteinputudphandler.h:68
RemoteInputUDPHandler::m_remoteAddress
QHostAddress m_remoteAddress
Definition:
remoteinputudphandler.h:67
RemoteInputUDPHandler::m_throttlems
int m_throttlems
Definition:
remoteinputudphandler.h:82
RemoteInputUDPHandler::getRemoteAddress
void getRemoteAddress(QString &s) const
Definition:
remoteinputudphandler.h:46
RemoteInputUDPHandler::m_masterTimer
const QTimer & m_masterTimer
Definition:
remoteinputudphandler.h:60
RemoteInputUDPHandler::m_udpReadBytes
qint64 m_udpReadBytes
Definition:
remoteinputudphandler.h:71
RemoteInputUDPHandler
Definition:
remoteinputudphandler.h:36
RemoteInputUDPHandler::m_samplerate
uint32_t m_samplerate
Definition:
remoteinputudphandler.h:73
RemoteInputUDPHandler::m_converterBuffer
int32_t * m_converterBuffer
Definition:
remoteinputudphandler.h:85
RemoteInputUDPHandler::getCenterFrequency
int getCenterFrequency() const
Definition:
remoteinputudphandler.h:50
RemoteInputUDPHandler::stop
void stop()
Definition:
remoteinputudphandler.cpp:117
RemoteInputUDPHandler::getMaxNbRecovery
int getMaxNbRecovery()
Definition:
remoteinputudphandler.h:54
RemoteInputUDPHandler::m_remoteInputBuffer
RemoteInputBuffer m_remoteInputBuffer
Definition:
remoteinputudphandler.h:64
RemoteInputUDPHandler::m_tickCount
uint32_t m_tickCount
Definition:
remoteinputudphandler.h:77
RemoteInputBuffer::getMinNbBlocks
int getMinNbBlocks()
Definition:
remoteinputbuffer.h:60
uint32_t
unsigned int uint32_t
Definition:
rtptypes_win.h:46
RemoteInputUDPHandler::processData
void processData()
Definition:
remoteinputudphandler.cpp:176
RemoteInputUDPHandler::m_udpBuf
char * m_udpBuf
Definition:
remoteinputudphandler.h:70
RemoteInputUDPHandler::m_dataConnected
bool m_dataConnected
Definition:
remoteinputudphandler.h:69
RemoteInputUDPHandler::m_dataAddress
QHostAddress m_dataAddress
Definition:
remoteinputudphandler.h:66
RemoteInputUDPHandler::isStreaming
bool isStreaming() const
Definition:
remoteinputudphandler.h:48
remoteinputbuffer.h
RemoteInputUDPHandler::getBufferGauge
int getBufferGauge() const
Definition:
remoteinputudphandler.h:51
RemoteInputUDPHandler::tick
void tick()
Definition:
remoteinputudphandler.cpp:247
RemoteInputUDPHandler::m_timer
QTimer * m_timer
Definition:
remoteinputudphandler.h:79
RemoteInputUDPHandler::dataReadyRead
void dataReadyRead()
Definition:
remoteinputudphandler.cpp:160
int32_t
int int32_t
Definition:
rtptypes_win.h:45
RemoteInputBuffer::getMaxNbRecovery
int getMaxNbRecovery()
Definition:
remoteinputbuffer.h:74
RemoteInputUDPHandler::m_autoCorrBuffer
bool m_autoCorrBuffer
Definition:
remoteinputudphandler.h:88
RemoteInputUDPHandler::configureUDPLink
void configureUDPLink(const QString &address, quint16 port)
Definition:
remoteinputudphandler.cpp:144
RemoteInputUDPHandler::m_readLengthSamples
int32_t m_readLengthSamples
Definition:
remoteinputudphandler.h:83
RemoteInputUDPHandler::m_elapsedTimer
QElapsedTimer m_elapsedTimer
Definition:
remoteinputudphandler.h:81
RemoteInputUDPHandler::getSampleRate
int getSampleRate() const
Definition:
remoteinputudphandler.h:49
RemoteInputUDPHandler::getNbOriginalBlocks
int getNbOriginalBlocks() const
Definition:
remoteinputudphandler.h:47
RemoteInputUDPHandler::getTVmSec
uint64_t getTVmSec() const
Definition:
remoteinputudphandler.h:52
RemoteInputUDPHandler::m_rateDivider
uint32_t m_rateDivider
Definition:
remoteinputudphandler.h:63
RemoteInputUDPHandler::m_running
bool m_running
Definition:
remoteinputudphandler.h:62
RemoteInputUDPHandler::RemoteInputUDPHandler
RemoteInputUDPHandler(SampleSinkFifo *sampleFifo, DeviceAPI *deviceAPI)
Definition:
remoteinputudphandler.cpp:29
RemoteInputUDPHandler::~RemoteInputUDPHandler
~RemoteInputUDPHandler()
Definition:
remoteinputudphandler.cpp:71
RemoteInputUDPHandler::m_readLength
uint32_t m_readLength
Definition:
remoteinputudphandler.h:84
RemoteInputUDPHandler::m_outputMessageQueueToGUI
MessageQueue * m_outputMessageQueueToGUI
Definition:
remoteinputudphandler.h:76
RemoteInputUDPHandler::m_masterTimerConnected
bool m_masterTimerConnected
Definition:
remoteinputudphandler.h:61
RemoteInputUDPHandler::start
void start()
Definition:
remoteinputudphandler.cpp:83
RemoteInputUDPHandler::m_deviceAPI
DeviceAPI * m_deviceAPI
Definition:
remoteinputudphandler.h:59
RemoteInputBuffer
Definition:
remoteinputbuffer.h:33
RemoteInputBuffer::getBufferGauge
int32_t getBufferGauge() const
Definition:
remoteinputbuffer.h:95
SampleSinkFifo
Definition:
samplesinkfifo.h:28
RemoteInputUDPHandler::m_dataSocket
QUdpSocket * m_dataSocket
Definition:
remoteinputudphandler.h:65
RemoteInputUDPHandler::m_tv_msec
uint64_t m_tv_msec
Definition:
remoteinputudphandler.h:75
RemoteInputUDPHandler::disconnectTimer
void disconnectTimer()
Definition:
remoteinputudphandler.cpp:232
uint64_t
unsigned __int64 uint64_t
Definition:
rtptypes_win.h:48
Generated on Fri Aug 2 2019 17:56:32 for SDRAngel by
1.8.13