From 651303e860f5965bf8b8a307aa17dd11651cac39 Mon Sep 17 00:00:00 2001 From: f4exb Date: Fri, 14 Apr 2017 01:49:48 +0200 Subject: [PATCH] HackRF: Rx/Tx opem/close new style corrections --- plugins/samplesink/hackrfoutput/hackrfoutput.cpp | 8 +------- plugins/samplesource/hackrfinput/hackrfinput.cpp | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/plugins/samplesink/hackrfoutput/hackrfoutput.cpp b/plugins/samplesink/hackrfoutput/hackrfoutput.cpp index c8640e578..e1963b375 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutput.cpp +++ b/plugins/samplesink/hackrfoutput/hackrfoutput.cpp @@ -84,12 +84,6 @@ bool HackRFOutput::openDevice() } else { - if (hackrf_init() != HACKRF_SUCCESS) // TODO: this may not work if several HackRF Devices are running concurrently. It should be handled globally in the application - { - qCritical("HackRFInput::openDevice: could not init HackRF"); - return false; - } - if ((m_dev = DeviceHackRF::open_hackrf(device)) == 0) { qCritical("HackRFOutput::openDevice: could not open HackRF #%d", device); @@ -140,7 +134,7 @@ void HackRFOutput::closeDevice() if(m_dev != 0) // close HackRF { hackrf_close(m_dev); - hackrf_exit(); // TODO: this may not work if several HackRF Devices are running concurrently. It should be handled globally in the application + //hackrf_exit(); // TODO: this may not work if several HackRF Devices are running concurrently. It should be handled globally in the application } } diff --git a/plugins/samplesource/hackrfinput/hackrfinput.cpp b/plugins/samplesource/hackrfinput/hackrfinput.cpp index 285f8aa2a..ee1f7cf37 100644 --- a/plugins/samplesource/hackrfinput/hackrfinput.cpp +++ b/plugins/samplesource/hackrfinput/hackrfinput.cpp @@ -89,12 +89,6 @@ bool HackRFInput::openDevice() } else { - if (hackrf_init() != HACKRF_SUCCESS) // TODO: this may not work if several HackRF Devices are running concurrently. It should be handled globally in the application - { - qCritical("HackRFInput::openDevice: could not init HackRF"); - return false; - } - if ((m_dev = DeviceHackRF::open_hackrf(device)) == 0) { qCritical("HackRFInput::openDevice: could not open HackRF #%d", device); @@ -148,7 +142,7 @@ void HackRFInput::closeDevice() if(m_dev != 0) // close BladeRF { hackrf_close(m_dev); - hackrf_exit(); // TODO: this may not work if several HackRF Devices are running concurrently. It should be handled globally in the application + //hackrf_exit(); // TODO: this may not work if several HackRF Devices are running concurrently. It should be handled globally in the application } }