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.
|
#include <udpsinkfec.h>
Inherits QObject.
Public Member Functions | |
UDPSinkFEC () | |
~UDPSinkFEC () | |
void | start () |
void | stop () |
void | write (const SampleVector::iterator &begin, uint32_t sampleChunkSize) |
std::string | error () |
void | setSampleRate (uint32_t sampleRate) |
void | setNbBlocksFEC (uint32_t nbBlocksFEC) |
void | setTxDelay (float txDelayRatio) |
void | setRemoteAddress (const QString &address, uint16_t port) |
operator bool () const | |
Static Public Attributes | |
static const uint32_t | m_udpSize = 512 |
Size of UDP block in number of bytes. More... | |
static const uint32_t | m_nbOriginalBlocks = 128 |
Number of original blocks in a protected block sequence. More... | |
Private Attributes | |
std::string | m_error |
uint32_t | m_sampleRate |
sample rate in Hz More... | |
uint32_t | m_nbSamples |
total number of samples sent int the last frame More... | |
QHostAddress | m_ownAddress |
CRC64 | m_crc64 |
uint8_t * | m_bufMeta |
uint8_t * | m_buf |
RemoteMetaDataFEC | m_currentMetaFEC |
Meta data for current frame. More... | |
uint32_t | m_nbBlocksFEC |
Variable number of FEC blocks. More... | |
float | m_txDelayRatio |
Delay in ratio of nominal frame period. More... | |
uint32_t | m_txDelay |
Delay in microseconds (usleep) between each sending of an UDP datagram. More... | |
RemoteSuperBlock | m_txBlocks [4][256] |
UDP blocks to send with original data + FEC. More... | |
RemoteSuperBlock | m_superBlock |
current super block being built More... | |
int | m_txBlockIndex |
Current index in blocks to transmit in the Tx row. More... | |
int | m_txBlocksIndex |
Current index of Tx blocks row. More... | |
uint16_t | m_frameCount |
transmission frame count More... | |
int | m_sampleIndex |
Current sample index in protected block data. More... | |
UDPSinkFECWorker * | m_udpWorker |
QString | m_remoteAddress |
uint16_t | m_remotePort |
Definition at line 34 of file udpsinkfec.h.
UDPSinkFEC::UDPSinkFEC | ( | ) |
Construct UDP sink
Definition at line 30 of file udpsinkfec.cpp.
References RemoteMetaDataFEC::init(), m_buf, m_bufMeta, m_currentMetaFEC, m_superBlock, m_txBlocks, and m_udpSize.
UDPSinkFEC::~UDPSinkFEC | ( | ) |
|
inline |
Return the last error, or return an empty string if there is no error.
Definition at line 58 of file udpsinkfec.h.
References m_error, setNbBlocksFEC(), setRemoteAddress(), setSampleRate(), and setTxDelay().
|
inline |
Return true if the stream is OK, return false if there is an error.
Definition at line 73 of file udpsinkfec.h.
References m_error.
void UDPSinkFEC::setNbBlocksFEC | ( | uint32_t | nbBlocksFEC | ) |
Definition at line 87 of file udpsinkfec.cpp.
References m_nbBlocksFEC, m_txDelayRatio, and setTxDelay().
Referenced by error(), and RemoteOutputThread::setNbBlocksFEC().
void UDPSinkFEC::setRemoteAddress | ( | const QString & | address, |
uint16_t | port | ||
) |
Definition at line 101 of file udpsinkfec.cpp.
References m_remoteAddress, m_remotePort, m_udpWorker, and UDPSinkFECWorker::setRemoteAddress().
Referenced by error(), and RemoteOutputThread::setDataAddress().
void UDPSinkFEC::setSampleRate | ( | uint32_t | sampleRate | ) |
Set sample rate given in S/s
Definition at line 94 of file udpsinkfec.cpp.
References m_sampleRate, m_txDelayRatio, and setTxDelay().
Referenced by error(), and RemoteOutputThread::setSamplerate().
void UDPSinkFEC::setTxDelay | ( | float | txDelayRatio | ) |
Definition at line 74 of file udpsinkfec.cpp.
References m_txDelayRatio.
Referenced by error(), setNbBlocksFEC(), setSampleRate(), and RemoteOutputThread::setTxDelay().
void UDPSinkFEC::start | ( | ) |
Definition at line 57 of file udpsinkfec.cpp.
References m_remoteAddress, m_remotePort, m_udpWorker, UDPSinkFECWorker::setRemoteAddress(), and UDPSinkFECWorker::startStop().
Referenced by RemoteOutputThread::startWork().
void UDPSinkFEC::stop | ( | ) |
Definition at line 64 of file udpsinkfec.cpp.
References m_udpWorker, and UDPSinkFECWorker::startStop().
Referenced by RemoteOutputThread::stopWork().
void UDPSinkFEC::write | ( | const SampleVector::iterator & | begin, |
uint32_t | sampleChunkSize | ||
) |
Write IQ samples
Definition at line 112 of file udpsinkfec.cpp.
References leansdr::crc32(), RemoteMetaDataFEC::m_centerFrequency, RemoteMetaDataFEC::m_crc32, m_currentMetaFEC, m_frameCount, m_nbBlocksFEC, RemoteMetaDataFEC::m_nbFECBlocks, m_nbOriginalBlocks, RemoteMetaDataFEC::m_nbOriginalBlocks, RemoteMetaDataFEC::m_sampleBits, RemoteMetaDataFEC::m_sampleBytes, RemoteMetaDataFEC::m_sampleRate, m_sampleRate, m_superBlock, RemoteMetaDataFEC::m_tv_sec, RemoteMetaDataFEC::m_tv_usec, m_txBlockIndex, m_txBlocks, m_txBlocksIndex, TimeUtil::nowus(), and SDR_RX_SAMP_SZ.
Referenced by RemoteOutputThread::tick().
|
private |
Definition at line 88 of file udpsinkfec.h.
Referenced by UDPSinkFEC(), and ~UDPSinkFEC().
|
private |
Definition at line 87 of file udpsinkfec.h.
Referenced by UDPSinkFEC(), and ~UDPSinkFEC().
|
private |
Definition at line 86 of file udpsinkfec.h.
|
private |
Meta data for current frame.
Definition at line 90 of file udpsinkfec.h.
Referenced by UDPSinkFEC(), and write().
|
private |
Definition at line 79 of file udpsinkfec.h.
Referenced by error(), and operator bool().
|
private |
|
private |
Variable number of FEC blocks.
Definition at line 91 of file udpsinkfec.h.
Referenced by setNbBlocksFEC(), and write().
|
static |
Number of original blocks in a protected block sequence.
Definition at line 39 of file udpsinkfec.h.
Referenced by write().
|
private |
total number of samples sent int the last frame
Definition at line 82 of file udpsinkfec.h.
|
private |
Definition at line 84 of file udpsinkfec.h.
|
private |
Definition at line 102 of file udpsinkfec.h.
Referenced by setRemoteAddress(), and start().
|
private |
Definition at line 103 of file udpsinkfec.h.
Referenced by setRemoteAddress(), and start().
|
private |
Current sample index in protected block data.
Definition at line 99 of file udpsinkfec.h.
|
private |
sample rate in Hz
Definition at line 81 of file udpsinkfec.h.
Referenced by setSampleRate(), and write().
|
private |
current super block being built
Definition at line 95 of file udpsinkfec.h.
Referenced by UDPSinkFEC(), and write().
|
private |
Current index in blocks to transmit in the Tx row.
Definition at line 96 of file udpsinkfec.h.
Referenced by write().
|
private |
UDP blocks to send with original data + FEC.
Definition at line 94 of file udpsinkfec.h.
Referenced by UDPSinkFEC(), and write().
|
private |
|
private |
Delay in microseconds (usleep) between each sending of an UDP datagram.
Definition at line 93 of file udpsinkfec.h.
|
private |
Delay in ratio of nominal frame period.
Definition at line 92 of file udpsinkfec.h.
Referenced by setNbBlocksFEC(), setSampleRate(), and setTxDelay().
|
static |
Size of UDP block in number of bytes.
Definition at line 38 of file udpsinkfec.h.
Referenced by UDPSinkFEC().
|
private |
Definition at line 101 of file udpsinkfec.h.
Referenced by setRemoteAddress(), start(), and stop().