2019-12-10 07:26:53 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
|
|
|
|
// //
|
|
|
|
// This program is free software; you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation as version 3 of the License, or //
|
|
|
|
// (at your option) any later version. //
|
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef INCLUDE_REMOTESINKSINK_H_
|
|
|
|
#define INCLUDE_REMOTESINKSINK_H_
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
#include "dsp/channelsamplesink.h"
|
|
|
|
#include "channel/remotedatablock.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "remotesinksettings.h"
|
|
|
|
|
|
|
|
class DeviceSampleSource;
|
2019-12-11 22:19:22 +00:00
|
|
|
class RemoteSinkSender;
|
|
|
|
class QThread;
|
2019-12-10 07:26:53 +00:00
|
|
|
|
|
|
|
class RemoteSinkSink : public QObject, public ChannelSampleSink {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
RemoteSinkSink();
|
|
|
|
~RemoteSinkSink();
|
|
|
|
|
|
|
|
virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end);
|
|
|
|
|
2019-12-11 22:19:22 +00:00
|
|
|
void startSender();
|
|
|
|
void stopSender();
|
|
|
|
|
2019-12-10 07:26:53 +00:00
|
|
|
void applySettings(const RemoteSinkSettings& settings, bool force = false);
|
2019-12-11 22:19:22 +00:00
|
|
|
void applyBasebandSampleRate(uint32_t sampleRate);
|
2019-12-13 00:44:51 +00:00
|
|
|
void setDeviceCenterFrequency(uint64_t frequency) { m_deviceCenterFrequency = frequency; }
|
2019-12-10 07:26:53 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
RemoteSinkSettings m_settings;
|
2019-12-11 22:19:22 +00:00
|
|
|
QThread *m_senderThread;
|
|
|
|
RemoteSinkSender *m_remoteSinkSender;
|
2019-12-10 07:26:53 +00:00
|
|
|
|
|
|
|
int m_txBlockIndex; //!< Current index in blocks to transmit in the Tx row
|
|
|
|
uint16_t m_frameCount; //!< transmission frame count
|
|
|
|
int m_sampleIndex; //!< Current sample index in protected block data
|
|
|
|
RemoteSuperBlock m_superBlock;
|
|
|
|
RemoteMetaDataFEC m_currentMetaFEC;
|
2021-12-12 09:44:58 +00:00
|
|
|
RemoteDataFrame *m_dataFrame;
|
2019-12-10 07:26:53 +00:00
|
|
|
|
2019-12-11 22:19:22 +00:00
|
|
|
uint64_t m_deviceCenterFrequency;
|
2019-12-10 07:26:53 +00:00
|
|
|
int64_t m_frequencyOffset;
|
2019-12-11 22:19:22 +00:00
|
|
|
uint32_t m_basebandSampleRate;
|
2019-12-10 07:26:53 +00:00
|
|
|
int m_nbBlocksFEC;
|
|
|
|
QString m_dataAddress;
|
|
|
|
uint16_t m_dataPort;
|
2019-12-12 17:23:22 +00:00
|
|
|
|
|
|
|
void setNbBlocksFEC(int nbBlocksFEC);
|
2019-12-10 07:26:53 +00:00
|
|
|
};
|
|
|
|
|
2021-12-04 20:36:12 +00:00
|
|
|
#endif // INCLUDE_REMOTESINKSINK_H_
|