From 7d9b6f200ec88c9a04ec227ce84819fb0c42c316 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 30 Dec 2018 00:44:37 +0100 Subject: [PATCH] XTRX: more messages --- devices/xtrx/devicextrxshared.cpp | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/devices/xtrx/devicextrxshared.cpp b/devices/xtrx/devicextrxshared.cpp index ae733173c..204db381c 100644 --- a/devices/xtrx/devicextrxshared.cpp +++ b/devices/xtrx/devicextrxshared.cpp @@ -14,6 +14,8 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// +#include + #include "devicextrxshared.h" MESSAGE_CLASS_DEFINITION(DeviceXTRXShared::MsgReportBuddyChange, Message) @@ -46,19 +48,36 @@ double DeviceXTRXShared::set_samplerate(double rate, } } + double actualcgen; + double actualrx; + double actualtx; + int res = xtrx_set_samplerate(m_deviceParams->getDevice(), m_masterRate, m_inputRate, m_outputRate, 0, - 0, - 0, - 0); + &actualcgen, + &actualrx, + &actualtx); - if (res) { - //fprintf(stderr, "Unable to set samplerate, error=%d\n", res); + if (res) + { + qCritical("DeviceXTRXShared::set_samplerate: Unable to set %s samplerate, m_masterRate: %f, m_inputRate: %f, m_outputRate: %f, error=%d\n", + output ? "output" : "input", m_masterRate, m_inputRate, m_outputRate, res); return 0; } + else + { + qDebug() << "DeviceXTRXShared::set_samplerate: sample rate set: " + << "output: "<< output + << "m_masterRate: " << m_masterRate + << "m_inputRate: " << m_inputRate + << "m_outputRate: " << m_outputRate + << "actualcgen: " << actualcgen + << "actualrx: " << actualrx + << "actualtx: " << actualtx; + } if (output) { return m_outputRate;