1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

Dismiss HackRF output plugin

This commit is contained in:
f4exb 2017-01-08 10:27:57 +01:00
parent 85ed39c767
commit 5d51fde9f7
4 changed files with 14 additions and 14 deletions

View File

@ -7,14 +7,14 @@ if(LIBUSB_FOUND AND LIBBLADERF_FOUND)
add_subdirectory(bladerfoutput)
endif(LIBUSB_FOUND AND LIBBLADERF_FOUND)
find_package(LibHACKRF)
if(LIBUSB_FOUND AND LIBHACKRF_FOUND)
add_subdirectory(hackrfoutput)
endif(LIBUSB_FOUND AND LIBHACKRF_FOUND)
#find_package(LibHACKRF)
#if(LIBUSB_FOUND AND LIBHACKRF_FOUND)
# add_subdirectory(hackrfoutput)
3endif(LIBUSB_FOUND AND LIBHACKRF_FOUND)
if (BUILD_DEBIAN)
add_subdirectory(bladerfoutput)
add_subdirectory(hackrfoutput)
# add_subdirectory(hackrfoutput)
endif (BUILD_DEBIAN)
add_subdirectory(filesink)

View File

@ -77,7 +77,6 @@ bool HackRFOutput::start(int device)
m_sampleSourceFifo.resize(m_settings.m_devSampleRate); // 1s long
if (m_deviceAPI->getSourceBuddies().size() > 0)
{
DeviceSourceAPI *buddy = m_deviceAPI->getSourceBuddies()[0];

View File

@ -21,8 +21,6 @@
#include "dsp/samplesourcefifo.h"
HackRFOutputThread *HackRFOutputThread::m_this = 0;
HackRFOutputThread::HackRFOutputThread(hackrf_device* dev, SampleSourceFifo* sampleFifo, QObject* parent) :
QThread(parent),
m_running(false),
@ -32,13 +30,12 @@ HackRFOutputThread::HackRFOutputThread(hackrf_device* dev, SampleSourceFifo* sam
m_samplerate(10),
m_log2Interp(0)
{
m_this = this;
qDebug("HackRFOutputThread::HackRFOutputThread: m_dev: %lx m_sampleFifo: %lx", (uint64_t) m_dev, (uint64_t) m_sampleFifo);
}
HackRFOutputThread::~HackRFOutputThread()
{
stopWork();
m_this = 0;
}
void HackRFOutputThread::startWork()
@ -76,7 +73,7 @@ void HackRFOutputThread::run()
//m_running = true;
m_startWaiter.wakeAll();
rc = (hackrf_error) hackrf_start_tx(m_dev, tx_callback, NULL);
rc = (hackrf_error) hackrf_start_tx(m_dev, tx_callback, this);
if (rc != HACKRF_SUCCESS)
{
@ -84,6 +81,11 @@ void HackRFOutputThread::run()
}
else
{
qDebug("HackRFOutputThread::run: this: %lx start HackRF Tx: m_dev: %lx m_sampleFifo: %lx",
(uint64_t) this,
(uint64_t) m_dev,
(uint64_t) m_sampleFifo);
while ((m_running) && (hackrf_is_streaming(m_dev) == HACKRF_TRUE))
{
sleep(1);
@ -143,10 +145,10 @@ void HackRFOutputThread::callback(qint16* buf, qint32 len)
}
}
int HackRFOutputThread::tx_callback(hackrf_transfer* transfer)
{
HackRFOutputThread *thread = (HackRFOutputThread *) transfer->tx_ctx;
qint32 bytes_to_write = transfer->valid_length;
m_this->callback((qint16 *) transfer->buffer, bytes_to_write);
thread->callback((qint16 *) transfer->buffer, bytes_to_write);
return 0;
}

View File

@ -51,7 +51,6 @@ private:
int m_samplerate;
unsigned int m_log2Interp;
static HackRFOutputThread *m_this;
Interpolators<qint16, SDR_SAMP_SZ, 12> m_interpolators;