From 22b5f7fdded6b27664120b1d2674a848be5076e0 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 21 Aug 2018 15:53:38 +0200 Subject: [PATCH] SDRdaemon: update device center frequency and channel sample rate in channel sink --- sdrdaemon/channel/sdrdaemonchannelsink.cpp | 32 +++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/sdrdaemon/channel/sdrdaemonchannelsink.cpp b/sdrdaemon/channel/sdrdaemonchannelsink.cpp index 4f4e28432..6bd9b2d87 100644 --- a/sdrdaemon/channel/sdrdaemonchannelsink.cpp +++ b/sdrdaemon/channel/sdrdaemonchannelsink.cpp @@ -28,6 +28,7 @@ #include "util/simpleserializer.h" #include "dsp/threadedbasebandsamplesink.h" #include "dsp/downchannelizer.h" +#include "dsp/dspcommands.h" #include "device/devicesourceapi.h" #include "channel/sdrdaemonchannelsinkthread.h" #include "sdrdaemonchannelsink.h" @@ -205,7 +206,36 @@ void SDRDaemonChannelSink::stop() bool SDRDaemonChannelSink::handleMessage(const Message& cmd __attribute__((unused))) { - return false; + if (DownChannelizer::MsgChannelizerNotification::match(cmd)) + { + DownChannelizer::MsgChannelizerNotification& notif = (DownChannelizer::MsgChannelizerNotification&) cmd; + + qDebug() << "SDRDaemonChannelSink::handleMessage: MsgChannelizerNotification:" + << " channelSampleRate: " << notif.getSampleRate() + << " offsetFrequency: " << notif.getFrequencyOffset(); + + if (notif.getSampleRate() > 0) { + setSampleRate(notif.getSampleRate()); + } + + return true; + } + else if (DSPSignalNotification::match(cmd)) + { + DSPSignalNotification& notif = (DSPSignalNotification&) cmd; + + qDebug() << "SDRDaemonChannelSink::handleMessage: DSPSignalNotification:" + << " inputSampleRate: " << notif.getSampleRate() + << " centerFrequency: " << notif.getCenterFrequency(); + + setCenterFrequency(notif.getCenterFrequency()); + + return true; + } + else + { + return false; + } } QByteArray SDRDaemonChannelSink::serialize() const