diff --git a/devices/hackrf/devicehackrfshared.h b/devices/hackrf/devicehackrfshared.h index c1b3d32d2..824d97798 100644 --- a/devices/hackrf/devicehackrfshared.h +++ b/devices/hackrf/devicehackrfshared.h @@ -21,6 +21,7 @@ class DeviceHackRFShared { +public: class MsgConfigureFrequencyDelta : public Message { MESSAGE_CLASS_DECLARATION diff --git a/plugins/samplesink/hackrfoutput/hackrfoutputgui.cpp b/plugins/samplesink/hackrfoutput/hackrfoutputgui.cpp index f108395df..d4f73bbeb 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutputgui.cpp +++ b/plugins/samplesink/hackrfoutput/hackrfoutputgui.cpp @@ -28,6 +28,7 @@ #include "device/devicesinkapi.h" #include "device/devicesourceapi.h" #include "hackrf/devicehackrfvalues.h" +#include "hackrf/devicehackrfshared.h" #include "ui_hackrfoutputgui.h" @@ -148,6 +149,13 @@ void HackRFOutputGui::handleDSPMessages() qDebug("HackRFOutputGui::handleDSPMessages: SampleRate:%d, CenterFrequency:%llu", notif->getSampleRate(), notif->getCenterFrequency()); updateSampleRateAndFrequency(); + delete message; + } + else if (DeviceHackRFShared::MsgConfigureFrequencyDelta::match(*message)) + { + DeviceHackRFShared::MsgConfigureFrequencyDelta* deltaMsg = (DeviceHackRFShared::MsgConfigureFrequencyDelta *) message; + ui->centerFrequency->setValue(ui->centerFrequency->getValue() + (deltaMsg->getFrequencyDelta()/1000)); + delete message; } } diff --git a/plugins/samplesource/hackrfinput/hackrfinput.cpp b/plugins/samplesource/hackrfinput/hackrfinput.cpp index 184f0d310..6a751c69b 100644 --- a/plugins/samplesource/hackrfinput/hackrfinput.cpp +++ b/plugins/samplesource/hackrfinput/hackrfinput.cpp @@ -26,6 +26,7 @@ #include "device/devicesourceapi.h" #include "device/devicesinkapi.h" #include "hackrf/devicehackrfvalues.h" +#include "hackrf/devicehackrfshared.h" #include "hackrfinputgui.h" #include "hackrfinputthread.h" @@ -278,6 +279,16 @@ bool HackRFInput::applySettings(const HackRFInputSettings& settings, bool force) qint64 f_img = deviceCenterFrequency; quint32 devSampleRate =m_settings.m_devSampleRate; + if (force || (m_settings.m_centerFrequency != settings.m_centerFrequency)) // forward delta to buddy if necessary + { + if (m_settings.m_linkTxFrequency && (m_deviceAPI->getSinkBuddies().size() > 0)) + { + DeviceSinkAPI *buddy = m_deviceAPI->getSinkBuddies()[0]; + DeviceHackRFShared::MsgConfigureFrequencyDelta *deltaMsg = DeviceHackRFShared::MsgConfigureFrequencyDelta::create(settings.m_centerFrequency - m_settings.m_centerFrequency); + buddy->getDeviceOutputMessageQueue()->push(deltaMsg); + } + } + if (force || (m_settings.m_centerFrequency != settings.m_centerFrequency) || (m_settings.m_LOppmTenths != settings.m_LOppmTenths) || (m_settings.m_fcPos != settings.m_fcPos))