SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
plutosdrinput.cpp
Go to the documentation of this file.
1 // Copyright (C) 2017 Edouard Griffiths, F4EXB //
3 // //
4 // This program is free software; you can redistribute it and/or modify //
5 // it under the terms of the GNU General Public License as published by //
6 // the Free Software Foundation as version 3 of the License, or //
7 // (at your option) any later version. //
8 // //
9 // This program is distributed in the hope that it will be useful, //
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12 // GNU General Public License V3 for more details. //
13 // //
14 // You should have received a copy of the GNU General Public License //
15 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
17 
18 #include <QDebug>
19 #include <QNetworkReply>
20 #include <QBuffer>
21 
22 #include "SWGDeviceSettings.h"
23 #include "SWGDeviceState.h"
24 #include "SWGDeviceReport.h"
25 #include "SWGPlutoSdrInputReport.h"
26 
27 #include "dsp/filerecord.h"
28 #include "dsp/dspcommands.h"
29 #include "dsp/dspengine.h"
30 #include "device/deviceapi.h"
33 
34 #include "plutosdrinput.h"
35 #include "plutosdrinputthread.h"
36 
37 #define PLUTOSDR_BLOCKSIZE_SAMPLES (16*1024) //complex samples per buffer (must be multiple of 64)
38 
42 
44  m_deviceAPI(deviceAPI),
45  m_fileSink(0),
46  m_deviceDescription("PlutoSDRInput"),
47  m_running(false),
48  m_plutoRxBuffer(0),
49  m_plutoSDRInputThread(0)
50 {
51  m_deviceSampleRates.m_addaConnvRate = 0;
52  m_deviceSampleRates.m_bbRateHz = 0;
53  m_deviceSampleRates.m_firRate = 0;
54  m_deviceSampleRates.m_hb1Rate = 0;
55  m_deviceSampleRates.m_hb2Rate = 0;
56  m_deviceSampleRates.m_hb3Rate = 0;
57 
58  suspendBuddies();
59  openDevice();
60  resumeBuddies();
61 
62  m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
63  m_deviceAPI->setNbSourceStreams(1);
64  m_deviceAPI->addAncillarySink(m_fileSink);
65 
66  m_networkManager = new QNetworkAccessManager();
67  connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
68 }
69 
71 {
72  disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
73  delete m_networkManager;
75  delete m_fileSink;
77  closeDevice();
78  resumeBuddies();
79 }
80 
82 {
83  delete this;
84 }
85 
87 {
89 }
90 
92 {
94  return false;
95  }
96 
97  if (m_running) stop();
98 
99  // start / stop streaming is done in the thread.
100 
102  qDebug("PlutoSDRInput::start: thread created");
103 
104  applySettings(m_settings, true);
105 
108 
110  m_running = true;
111 
112  return true;
113 }
114 
116 {
117  if (m_plutoSDRInputThread != 0)
118  {
120  delete m_plutoSDRInputThread;
122  }
123 
125  m_running = false;
126 }
127 
128 QByteArray PlutoSDRInput::serialize() const
129 {
130  return m_settings.serialize();
131 }
132 
133 bool PlutoSDRInput::deserialize(const QByteArray& data)
134 {
135  bool success = true;
136 
137  if (!m_settings.deserialize(data))
138  {
140  success = false;
141  }
142 
144  m_inputMessageQueue.push(message);
145 
146  if (m_guiMessageQueue)
147  {
149  m_guiMessageQueue->push(messageToGUI);
150  }
151 
152  return success;
153 }
154 
156 {
157  return m_deviceDescription;
158 }
160 {
162 }
163 
165 {
167 }
168 
169 void PlutoSDRInput::setCenterFrequency(qint64 centerFrequency)
170 {
172  settings.m_centerFrequency = centerFrequency;
173 
174  MsgConfigurePlutoSDR* message = MsgConfigurePlutoSDR::create(settings, false);
175  m_inputMessageQueue.push(message);
176 
177  if (m_guiMessageQueue)
178  {
179  MsgConfigurePlutoSDR* messageToGUI = MsgConfigurePlutoSDR::create(settings, false);
180  m_guiMessageQueue->push(messageToGUI);
181  }
182 }
183 
185 {
186  if (MsgConfigurePlutoSDR::match(message))
187  {
188  MsgConfigurePlutoSDR& conf = (MsgConfigurePlutoSDR&) message;
189  qDebug() << "PlutoSDRInput::handleMessage: MsgConfigurePlutoSDR";
190 
191  if (!applySettings(conf.getSettings(), conf.getForce()))
192  {
193  qDebug("PlutoSDRInput::handleMessage config error");
194  }
195 
196  return true;
197  }
198  else if (MsgFileRecord::match(message))
199  {
200  MsgFileRecord& conf = (MsgFileRecord&) message;
201  qDebug() << "PlutoSDRInput::handleMessage: MsgFileRecord: " << conf.getStartStop();
202 
203  if (conf.getStartStop())
204  {
205  if (m_settings.m_fileRecordName.size() != 0) {
207  } else {
209  }
210 
212  }
213  else
214  {
216  }
217 
218  return true;
219  }
220  else if (MsgStartStop::match(message))
221  {
222  MsgStartStop& cmd = (MsgStartStop&) message;
223  qDebug() << "PlutoSDRInput::handleMessage: MsgStartStop: " << (cmd.getStartStop() ? "start" : "stop");
224 
225  if (cmd.getStartStop())
226  {
228  {
230  }
231  }
232  else
233  {
235  }
236 
239  }
240 
241  return true;
242  }
243  else if (DevicePlutoSDRShared::MsgCrossReportToBuddy::match(message)) // message from buddy
244  {
250  PlutoSDRInputSettings newSettings = m_settings;
251  newSettings.m_lpfFIREnable = conf.isLpfFirEnable();
252  applySettings(newSettings);
253 
254  return true;
255  }
256  else
257  {
258  return false;
259  }
260 }
261 
263 {
265  {
266  qCritical("PlutoSDRInput::openDevice: could not allocate SampleFifo");
267  return false;
268  }
269  else
270  {
271  qDebug("PlutoSDRInput::openDevice: allocated SampleFifo");
272  }
273 
274  // look for Tx buddy and get reference to common parameters
275  if (m_deviceAPI->getSinkBuddies().size() > 0) // then sink
276  {
277  qDebug("PlutoSDRInput::openDevice: look at Tx buddy");
278 
279  DeviceAPI *sinkBuddy = m_deviceAPI->getSinkBuddies()[0];
280  DevicePlutoSDRShared* buddySharedPtr = (DevicePlutoSDRShared*) sinkBuddy->getBuddySharedPtr();
281  m_deviceShared.m_deviceParams = buddySharedPtr->m_deviceParams;
282 
284  {
285  qCritical("PlutoSDRInput::openDevice: cannot get device parameters from Tx buddy");
286  return false; // the device params should have been created by the buddy
287  }
288  else
289  {
290  qDebug("PlutoSDRInput::openDevice: getting device parameters from Tx buddy");
291  }
292  }
293  // There is no buddy then create the first PlutoSDR common parameters
294  // open the device this will also populate common fields
295  else
296  {
297  qDebug("PlutoSDRInput::openDevice: open device here");
298 
300  char serial[256];
301  strcpy(serial, qPrintable(m_deviceAPI->getSamplingDeviceSerial()));
303  }
304 
305  m_deviceAPI->setBuddySharedPtr(&m_deviceShared); // propagate common parameters to API
306 
307  // acquire the channel
309  plutoBox->openRx();
311 
312  return true;
313 }
314 
316 {
317  if (m_deviceShared.m_deviceParams->getBox() == 0) { // was never open
318  return;
319  }
320 
321  if (m_deviceAPI->getSinkBuddies().size() == 0)
322  {
326  }
327 }
328 
330 {
331  // suspend Tx buddy's thread
332 
333  for (unsigned int i = 0; i < m_deviceAPI->getSinkBuddies().size(); i++)
334  {
335  DeviceAPI *buddy = m_deviceAPI->getSinkBuddies()[i];
336  DevicePlutoSDRShared *buddyShared = (DevicePlutoSDRShared *) buddy->getBuddySharedPtr();
337 
338  if (buddyShared->m_thread) {
339  buddyShared->m_thread->stopWork();
340  }
341  }
342 }
343 
345 {
346  // resume Tx buddy's thread
347 
348  for (unsigned int i = 0; i < m_deviceAPI->getSinkBuddies().size(); i++)
349  {
350  DeviceAPI *buddy = m_deviceAPI->getSinkBuddies()[i];
351  DevicePlutoSDRShared *buddyShared = (DevicePlutoSDRShared *) buddy->getBuddySharedPtr();
352 
353  if (buddyShared->m_thread) {
354  buddyShared->m_thread->startWork();
355  }
356  }
357 }
358 
359 bool PlutoSDRInput::applySettings(const PlutoSDRInputSettings& settings, bool force)
360 {
361  bool forwardChangeOwnDSP = false;
362  bool forwardChangeOtherDSP = false;
363  bool ownThreadWasRunning = false;
364  bool suspendAllOtherThreads = false; // All others means Tx in fact
366  QLocale loc;
367  QList<QString> reverseAPIKeys;
368 
369  qDebug().noquote() << "PlutoSDRInput::applySettings: center freq: " << m_settings.m_centerFrequency << " Hz"
370  << " m_devSampleRate: " << loc.toString(m_settings.m_devSampleRate) << "S/s"
371  << " m_LOppmTenths: " << m_settings.m_LOppmTenths
372  << " m_dcBlock: " << m_settings.m_dcBlock
373  << " m_iqCorrection: " << m_settings.m_iqCorrection
374  << " m_hwBBDCBlock: " << m_settings.m_hwBBDCBlock
375  << " m_hwRFDCBlock: " << m_settings.m_hwRFDCBlock
376  << " m_hwIQCorrection: " << m_settings.m_hwIQCorrection
377  << " m_lpfFIREnable: " << m_settings.m_lpfFIREnable
378  << " m_lpfFIRBW: " << loc.toString(m_settings.m_lpfFIRBW)
379  << " m_lpfFIRlog2Decim: " << m_settings.m_lpfFIRlog2Decim
380  << " m_lpfFIRGain: " << m_settings.m_lpfFIRGain
381  << " m_log2Decim: " << loc.toString(1<<m_settings.m_log2Decim)
382  << " m_fcPos: " << m_settings.m_fcPos
383  << " m_lpfBW: " << loc.toString(m_settings.m_lpfBW)
384  << " m_gain: " << m_settings.m_gain
385  << " m_antennaPath: " << (int) m_settings.m_antennaPath
386  << " m_gainMode: " << (int) m_settings.m_gainMode
387  << " m_transverterMode: " << m_settings.m_transverterMode
388  << " m_transverterDeltaFrequency: " << m_settings.m_transverterDeltaFrequency
389  << " force: " << force;
390 
391  if ((m_settings.m_centerFrequency != settings.m_centerFrequency) || force) {
392  reverseAPIKeys.append("centerFrequency");
393  }
394  if ((m_settings.m_devSampleRate != settings.m_devSampleRate) || force) {
395  reverseAPIKeys.append("devSampleRate");
396  }
397  if ((m_settings.m_LOppmTenths != settings.m_LOppmTenths) || force) {
398  reverseAPIKeys.append("LOppmTenths");
399  }
400  if ((m_settings.m_dcBlock != settings.m_dcBlock) || force) {
401  reverseAPIKeys.append("dcBlock");
402  }
403  if ((m_settings.m_iqCorrection != settings.m_iqCorrection) || force) {
404  reverseAPIKeys.append("iqCorrection");
405  }
406  if ((m_settings.m_hwBBDCBlock != settings.m_hwBBDCBlock) || force) {
407  reverseAPIKeys.append("hwBBDCBlock");
408  }
409  if ((m_settings.m_hwRFDCBlock != settings.m_hwRFDCBlock) || force) {
410  reverseAPIKeys.append("hwRFDCBlock");
411  }
412  if ((m_settings.m_hwIQCorrection != settings.m_hwIQCorrection) || force) {
413  reverseAPIKeys.append("hwIQCorrection");
414  }
415  if ((m_settings.m_lpfFIREnable != settings.m_lpfFIREnable) || force) {
416  reverseAPIKeys.append("lpfFIREnable");
417  }
418  if ((m_settings.m_lpfFIRBW != settings.m_lpfFIRBW) || force) {
419  reverseAPIKeys.append("lpfFIRBW");
420  }
421  if ((m_settings.m_lpfFIRlog2Decim != settings.m_lpfFIRlog2Decim) || force) {
422  reverseAPIKeys.append("lpfFIRlog2Decim");
423  }
424  if ((m_settings.m_lpfFIRGain != settings.m_lpfFIRGain) || force) {
425  reverseAPIKeys.append("lpfFIRGain");
426  }
427  if ((m_settings.m_log2Decim != settings.m_log2Decim) || force) {
428  reverseAPIKeys.append("log2Decim");
429  }
430  if ((m_settings.m_fcPos != settings.m_fcPos) || force) {
431  reverseAPIKeys.append("fcPos");
432  }
433  if ((m_settings.m_lpfBW != settings.m_lpfBW) || force) {
434  reverseAPIKeys.append("lpfBW");
435  }
436  if ((m_settings.m_gain != settings.m_gain) || force) {
437  reverseAPIKeys.append("gain");
438  }
439  if ((m_settings.m_antennaPath != settings.m_antennaPath) || force) {
440  reverseAPIKeys.append("antennaPath");
441  }
442  if ((m_settings.m_gainMode != settings.m_gainMode) || force) {
443  reverseAPIKeys.append("gainMode");
444  }
445  if ((m_settings.m_transverterMode != settings.m_transverterMode) || force) {
446  reverseAPIKeys.append("transverterMode");
447  }
449  reverseAPIKeys.append("transverterDeltaFrequency");
450  }
451  if ((m_settings.m_fileRecordName != settings.m_fileRecordName) || force) {
452  reverseAPIKeys.append("fileRecordName");
453  }
454 
455  // determine if buddies threads or own thread need to be suspended
456 
457  // changes affecting all buddies can occur if
458  // - device to host sample rate is changed
459  // - FIR filter is enabled or disabled
460  // - FIR filter is changed
461  // - LO correction is changed
462  if ((m_settings.m_devSampleRate != settings.m_devSampleRate) ||
463  (m_settings.m_lpfFIREnable != settings.m_lpfFIREnable) ||
465  (settings.m_lpfFIRBW != m_settings.m_lpfFIRBW) ||
466  (settings.m_lpfFIRGain != m_settings.m_lpfFIRGain) ||
467  (m_settings.m_LOppmTenths != settings.m_LOppmTenths) || force)
468  {
469  suspendAllOtherThreads = true;
470  }
471 
472  if (suspendAllOtherThreads)
473  {
474  const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
475  std::vector<DeviceAPI*>::const_iterator itSink = sinkBuddies.begin();
476 
477  for (; itSink != sinkBuddies.end(); ++itSink)
478  {
479  DevicePlutoSDRShared *buddySharedPtr = (DevicePlutoSDRShared *) (*itSink)->getBuddySharedPtr();
480 
481  if (buddySharedPtr->m_thread) {
482  buddySharedPtr->m_thread->stopWork();
483  buddySharedPtr->m_threadWasRunning = true;
484  }
485  else
486  {
487  buddySharedPtr->m_threadWasRunning = false;
488  }
489  }
490  }
491 
493  {
495  ownThreadWasRunning = true;
496  }
497 
498  // apply settings
499 
500  if ((m_settings.m_dcBlock != settings.m_dcBlock) ||
501  (m_settings.m_iqCorrection != settings.m_iqCorrection) || force)
502  {
504  }
505 
506  // Change affecting device sample rate chain and other buddies
507  if ((m_settings.m_devSampleRate != settings.m_devSampleRate) ||
508  (m_settings.m_lpfFIREnable != settings.m_lpfFIREnable) ||
510  (settings.m_lpfFIRBW != m_settings.m_lpfFIRBW) ||
511  (settings.m_lpfFIRGain != m_settings.m_lpfFIRGain) || force)
512  {
513  plutoBox->setFIR(settings.m_devSampleRate, settings.m_lpfFIRlog2Decim, DevicePlutoSDRBox::USE_RX, settings.m_lpfFIRBW, settings.m_lpfFIRGain);
514  plutoBox->setFIREnable(settings.m_lpfFIREnable); // eventually enable/disable FIR
515  plutoBox->setSampleRate(settings.m_devSampleRate); // and set end point sample rate
516 
517  plutoBox->getRxSampleRates(m_deviceSampleRates); // pick up possible new rates
518  qDebug() << "PlutoSDRInput::applySettings: BBPLL(Hz): " << m_deviceSampleRates.m_bbRateHz
519  << " ADC: " << m_deviceSampleRates.m_addaConnvRate
520  << " -HB3-> " << m_deviceSampleRates.m_hb3Rate
521  << " -HB2-> " << m_deviceSampleRates.m_hb2Rate
522  << " -HB1-> " << m_deviceSampleRates.m_hb1Rate
523  << " -FIR-> " << m_deviceSampleRates.m_firRate;
524 
525  forwardChangeOtherDSP = true;
526  forwardChangeOwnDSP = (m_settings.m_devSampleRate != settings.m_devSampleRate) || force;
527  }
528 
529  if ((m_settings.m_log2Decim != settings.m_log2Decim) || force)
530  {
531  if (m_plutoSDRInputThread != 0)
532  {
534  qDebug() << "PlutoSDRInput::applySettings: set soft decimation to " << (1<<settings.m_log2Decim);
535  }
536 
537  forwardChangeOwnDSP = true;
538  }
539 
540  if ((m_settings.m_LOppmTenths != settings.m_LOppmTenths) || force)
541  {
542  plutoBox->setLOPPMTenths(settings.m_LOppmTenths);
543  forwardChangeOtherDSP = true;
544  }
545 
546  std::vector<std::string> params;
547  bool paramsToSet = false;
548 
550  || (m_settings.m_fcPos != settings.m_fcPos)
551  || (m_settings.m_log2Decim != settings.m_log2Decim)
555  {
556  qint64 deviceCenterFrequency = DeviceSampleSource::calculateDeviceCenterFrequency(
557  settings.m_centerFrequency,
559  settings.m_log2Decim,
561  settings.m_devSampleRate,
562  DeviceSampleSource::FrequencyShiftScheme::FSHIFT_STD,
563  settings.m_transverterMode);
564 
565  params.push_back(QString(tr("out_altvoltage0_RX_LO_frequency=%1").arg(deviceCenterFrequency)).toStdString());
566  paramsToSet = true;
567  forwardChangeOwnDSP = true;
568 
569  if ((m_settings.m_fcPos != settings.m_fcPos) || force)
570  {
571  if (m_plutoSDRInputThread != 0)
572  {
574  qDebug() << "PlutoSDRInput::applySettings: set fcPos to " << settings.m_fcPos;
575  }
576  }
577  }
578 
579  if ((m_settings.m_lpfBW != settings.m_lpfBW) || force)
580  {
581  params.push_back(QString(tr("in_voltage_rf_bandwidth=%1").arg(settings.m_lpfBW)).toStdString());
582  paramsToSet = true;
583  }
584 
585  if ((m_settings.m_antennaPath != settings.m_antennaPath) || force)
586  {
587  QString rfPortStr;
589  params.push_back(QString(tr("in_voltage0_rf_port_select=%1").arg(rfPortStr)).toStdString());
590  paramsToSet = true;
591  }
592 
593  if ((m_settings.m_gainMode != settings.m_gainMode) || force)
594  {
595  QString gainModeStr;
597  params.push_back(QString(tr("in_voltage0_gain_control_mode=%1").arg(gainModeStr)).toStdString());
598  paramsToSet = true;
599  }
600 
601  if ((m_settings.m_gain != settings.m_gain) || force)
602  {
603  params.push_back(QString(tr("in_voltage0_hardwaregain=%1").arg(settings.m_gain)).toStdString());
604  paramsToSet = true;
605  }
606 
607  if ((m_settings.m_hwBBDCBlock != settings.m_hwBBDCBlock) || force)
608  {
609  params.push_back(QString(tr("in_voltage_bb_dc_offset_tracking_en=%1").arg(settings.m_hwBBDCBlock ? 1 : 0)).toStdString());
610  paramsToSet = true;
611  }
612 
613  if ((m_settings.m_hwRFDCBlock != settings.m_hwRFDCBlock) || force)
614  {
615  params.push_back(QString(tr("in_voltage_rf_dc_offset_tracking_en=%1").arg(settings.m_hwRFDCBlock ? 1 : 0)).toStdString());
616  paramsToSet = true;
617  }
618 
619  if ((m_settings.m_hwIQCorrection != settings.m_hwIQCorrection) || force)
620  {
621  params.push_back(QString(tr("in_voltage_quadrature_tracking_en=%1").arg(settings.m_hwIQCorrection ? 1 : 0)).toStdString());
622  paramsToSet = true;
623  }
624 
625  if (paramsToSet)
626  {
627  plutoBox->set_params(DevicePlutoSDRBox::DEVICE_PHY, params);
628  }
629 
630  if (settings.m_useReverseAPI)
631  {
632  bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) ||
636  webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force);
637  }
638 
639  m_settings = settings;
640 
641  if (suspendAllOtherThreads)
642  {
643  const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
644  std::vector<DeviceAPI*>::const_iterator itSink = sinkBuddies.begin();
645 
646  for (; itSink != sinkBuddies.end(); ++itSink)
647  {
648  DevicePlutoSDRShared *buddySharedPtr = (DevicePlutoSDRShared *) (*itSink)->getBuddySharedPtr();
649 
650  if (buddySharedPtr->m_threadWasRunning) {
651  buddySharedPtr->m_thread->startWork();
652  }
653  }
654  }
655 
656  if (ownThreadWasRunning) {
658  }
659 
660  // TODO: forward changes to other (Tx) DSP
661  if (forwardChangeOtherDSP)
662  {
663 
664  qDebug("PlutoSDRInput::applySettings: forwardChangeOtherDSP");
665 
666  const std::vector<DeviceAPI*>& sinkBuddies = m_deviceAPI->getSinkBuddies();
667  std::vector<DeviceAPI*>::const_iterator itSink = sinkBuddies.begin();
668 
669  for (; itSink != sinkBuddies.end(); ++itSink)
670  {
672  settings.m_devSampleRate,
673  settings.m_lpfFIREnable,
674  settings.m_lpfFIRlog2Decim,
675  settings.m_lpfFIRBW,
676  settings.m_LOppmTenths);
677 
678  if ((*itSink)->getSamplingDeviceGUIMessageQueue())
679  {
681  (*itSink)->getSamplingDeviceGUIMessageQueue()->push(msgToGUI);
682  }
683 
684  (*itSink)->getSamplingDeviceInputMessageQueue()->push(msg);
685  }
686  }
687 
688  if (forwardChangeOwnDSP)
689  {
690  qDebug("PlutoSDRInput::applySettings: forward change to self");
691 
692  int sampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2Decim);
694  m_fileSink->handleMessage(*notif); // forward to file sink
696  }
697 
698  return true;
699 }
700 
701 void PlutoSDRInput::getRSSI(std::string& rssiStr)
702 {
704 
705  if (!plutoBox->getRxRSSI(rssiStr, 0)) {
706  rssiStr = "xxx dB";
707  }
708 }
709 
710 void PlutoSDRInput::getLORange(qint64& minLimit, qint64& maxLimit)
711 {
712  uint64_t min, max;
714 
715  plutoBox->getRxLORange(min, max);
716  minLimit = min;
717  maxLimit = max;
718 }
719 
720 void PlutoSDRInput::getbbLPRange(quint32& minLimit, quint32& maxLimit)
721 {
722  uint32_t min, max;
724 
725  plutoBox->getbbLPRxRange(min, max);
726  minLimit = min;
727  maxLimit = max;
728 }
729 
730 void PlutoSDRInput::getGain(int& gaindB)
731 {
733 
734  if (!plutoBox->getRxGain(gaindB, 0)) {
735  gaindB = 0;
736  }
737 }
738 
740 {
742  return plutoBox->fetchTemp();
743 }
744 
746 {
748  return plutoBox->getTemp();
749 }
750 
752  SWGSDRangel::SWGDeviceState& response,
753  QString& errorMessage)
754 {
755  (void) errorMessage;
757  return 200;
758 }
759 
761  bool run,
762  SWGSDRangel::SWGDeviceState& response,
763  QString& errorMessage)
764 {
765  (void) errorMessage;
767  MsgStartStop *message = MsgStartStop::create(run);
768  m_inputMessageQueue.push(message);
769 
770  if (m_guiMessageQueue) // forward to GUI if any
771  {
772  MsgStartStop *msgToGUI = MsgStartStop::create(run);
773  m_guiMessageQueue->push(msgToGUI);
774  }
775 
776  return 200;
777 }
778 
781  QString& errorMessage)
782 {
783  (void) errorMessage;
785  response.getPlutoSdrInputSettings()->init();
787  return 200;
788 }
789 
791  bool force,
792  const QStringList& deviceSettingsKeys,
793  SWGSDRangel::SWGDeviceSettings& response, // query + response
794  QString& errorMessage)
795 {
796  (void) errorMessage;
798 
799  if (deviceSettingsKeys.contains("centerFrequency")) {
801  }
802  if (deviceSettingsKeys.contains("devSampleRate")) {
804  }
805  if (deviceSettingsKeys.contains("LOppmTenths")) {
806  settings.m_LOppmTenths = response.getPlutoSdrInputSettings()->getLOppmTenths();
807  }
808  if (deviceSettingsKeys.contains("lpfFIREnable")) {
809  settings.m_lpfFIREnable = response.getPlutoSdrInputSettings()->getLpfFirEnable() != 0;
810  }
811  if (deviceSettingsKeys.contains("lpfFIRBW")) {
812  settings.m_lpfFIRBW = response.getPlutoSdrInputSettings()->getLpfFirbw();
813  }
814  if (deviceSettingsKeys.contains("lpfFIRlog2Decim")) {
816  }
817  if (deviceSettingsKeys.contains("lpfFIRGain")) {
818  settings.m_lpfFIRGain = response.getPlutoSdrInputSettings()->getLpfFirGain();
819  }
820  if (deviceSettingsKeys.contains("fcPos")) {
821  int fcPos = response.getPlutoSdrInputSettings()->getFcPos();
822  fcPos = fcPos < 0 ? 0 : fcPos > 2 ? 2 : fcPos;
823  settings.m_fcPos = (PlutoSDRInputSettings::fcPos_t) fcPos;
824  }
825  if (deviceSettingsKeys.contains("dcBlock")) {
826  settings.m_dcBlock = response.getPlutoSdrInputSettings()->getDcBlock() != 0;
827  }
828  if (deviceSettingsKeys.contains("iqCorrection")) {
829  settings.m_iqCorrection = response.getPlutoSdrInputSettings()->getIqCorrection() != 0;
830  }
831  if (deviceSettingsKeys.contains("hwBBDCBlock")) {
832  settings.m_hwBBDCBlock = response.getPlutoSdrInputSettings()->getHwBbdcBlock() != 0;
833  }
834  if (deviceSettingsKeys.contains("hwRFDCBlock")) {
835  settings.m_hwBBDCBlock = response.getPlutoSdrInputSettings()->getHwRfdcBlock() != 0;
836  }
837  if (deviceSettingsKeys.contains("hwIQCorrection")) {
838  settings.m_hwBBDCBlock = response.getPlutoSdrInputSettings()->getHwIqCorrection() != 0;
839  }
840  if (deviceSettingsKeys.contains("log2Decim")) {
841  settings.m_log2Decim = response.getPlutoSdrInputSettings()->getLog2Decim();
842  }
843  if (deviceSettingsKeys.contains("lpfBW")) {
844  settings.m_lpfBW = response.getPlutoSdrInputSettings()->getLpfBw();
845  }
846  if (deviceSettingsKeys.contains("gain")) {
847  settings.m_gain = response.getPlutoSdrInputSettings()->getGain();
848  }
849  if (deviceSettingsKeys.contains("antennaPath")) {
850  int antennaPath = response.getPlutoSdrInputSettings()->getAntennaPath();
851  antennaPath = antennaPath < 0 ? 0 : antennaPath >= PlutoSDRInputSettings::RFPATH_END ? PlutoSDRInputSettings::RFPATH_END-1 : antennaPath;
852  settings.m_antennaPath = (PlutoSDRInputSettings::RFPath) antennaPath;
853  }
854  if (deviceSettingsKeys.contains("gainMode")) {
855  int gainMode = response.getPlutoSdrInputSettings()->getGainMode();
856  gainMode = gainMode < 0 ? 0 : gainMode >= PlutoSDRInputSettings::GAIN_END ? PlutoSDRInputSettings::GAIN_END-1 : gainMode;
857  settings.m_gainMode = (PlutoSDRInputSettings::GainMode) gainMode;
858  }
859  if (deviceSettingsKeys.contains("transverterDeltaFrequency")) {
861  }
862  if (deviceSettingsKeys.contains("transverterMode")) {
863  settings.m_transverterMode = response.getPlutoSdrInputSettings()->getTransverterMode() != 0;
864  }
865  if (deviceSettingsKeys.contains("fileRecordName")) {
867  }
868  if (deviceSettingsKeys.contains("useReverseAPI")) {
869  settings.m_useReverseAPI = response.getPlutoSdrInputSettings()->getUseReverseApi() != 0;
870  }
871  if (deviceSettingsKeys.contains("reverseAPIAddress")) {
873  }
874  if (deviceSettingsKeys.contains("reverseAPIPort")) {
876  }
877  if (deviceSettingsKeys.contains("reverseAPIDeviceIndex")) {
879  }
880 
881  MsgConfigurePlutoSDR *msg = MsgConfigurePlutoSDR::create(settings, force);
883 
884  if (m_guiMessageQueue) // forward to GUI if any
885  {
886  MsgConfigurePlutoSDR *msgToGUI = MsgConfigurePlutoSDR::create(settings, force);
887  m_guiMessageQueue->push(msgToGUI);
888  }
889 
890  webapiFormatDeviceSettings(response, settings);
891  return 200;
892 }
893 
896  QString& errorMessage)
897 {
898  (void) errorMessage;
900  response.getPlutoSdrInputReport()->init();
901  webapiFormatDeviceReport(response);
902  return 200;
903 }
904 
906 {
910  response.getPlutoSdrInputSettings()->setLpfFirEnable(settings.m_lpfFIREnable ? 1 : 0);
911  response.getPlutoSdrInputSettings()->setLpfFirbw(settings.m_lpfFIRBW);
914  response.getPlutoSdrInputSettings()->setFcPos((int) settings.m_fcPos);
915  response.getPlutoSdrInputSettings()->setDcBlock(settings.m_dcBlock ? 1 : 0);
916  response.getPlutoSdrInputSettings()->setIqCorrection(settings.m_iqCorrection ? 1 : 0);
917  response.getPlutoSdrInputSettings()->setHwBbdcBlock(settings.m_hwBBDCBlock ? 1 : 0);
918  response.getPlutoSdrInputSettings()->setHwRfdcBlock(settings.m_hwRFDCBlock ? 1 : 0);
919  response.getPlutoSdrInputSettings()->setHwIqCorrection(settings.m_hwIQCorrection ? 1 : 0);
920  response.getPlutoSdrInputSettings()->setLog2Decim(settings.m_log2Decim);
921  response.getPlutoSdrInputSettings()->setLpfBw(settings.m_lpfBW);
922  response.getPlutoSdrInputSettings()->setGain(settings.m_gain);
924  response.getPlutoSdrInputSettings()->setGainMode((int) settings.m_gainMode);
926  response.getPlutoSdrInputSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
927 
928  if (response.getPlutoSdrInputSettings()->getFileRecordName()) {
930  } else {
931  response.getPlutoSdrInputSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
932  }
933 
934  response.getPlutoSdrInputSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
935 
938  } else {
939  response.getPlutoSdrInputSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
940  }
941 
944 }
945 
947 {
949  std::string rssiStr;
950  getRSSI(rssiStr);
951  response.getPlutoSdrInputReport()->setRssi(new QString(rssiStr.c_str()));
952  int gainDB;
953  getGain(gainDB);
954  response.getPlutoSdrInputReport()->setGainDb(gainDB);
957 }
958 
959 void PlutoSDRInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const PlutoSDRInputSettings& settings, bool force)
960 {
962  swgDeviceSettings->setDirection(0); // single Rx
963  swgDeviceSettings->setOriginatorIndex(m_deviceAPI->getDeviceSetIndex());
964  swgDeviceSettings->setDeviceHwType(new QString("PlutoSDR"));
966  SWGSDRangel::SWGPlutoSdrInputSettings *swgPlutoSdrInputSettings = swgDeviceSettings->getPlutoSdrInputSettings();
967 
968  // transfer data that has been modified. When force is on transfer all data except reverse API data
969 
970  if (deviceSettingsKeys.contains("centerFrequency") || force) {
971  swgPlutoSdrInputSettings->setCenterFrequency(settings.m_centerFrequency);
972  }
973  if (deviceSettingsKeys.contains("devSampleRate") || force) {
974  swgPlutoSdrInputSettings->setDevSampleRate(settings.m_devSampleRate);
975  }
976  if (deviceSettingsKeys.contains("LOppmTenths") || force) {
977  swgPlutoSdrInputSettings->setLOppmTenths(settings.m_LOppmTenths);
978  }
979  if (deviceSettingsKeys.contains("lpfFIREnable") || force) {
980  swgPlutoSdrInputSettings->setLpfFirEnable(settings.m_lpfFIREnable ? 1 : 0);
981  }
982  if (deviceSettingsKeys.contains("lpfFIRBW") || force) {
983  swgPlutoSdrInputSettings->setLpfFirbw(settings.m_lpfFIRBW);
984  }
985  if (deviceSettingsKeys.contains("lpfFIRlog2Decim") || force) {
986  swgPlutoSdrInputSettings->setLpfFiRlog2Decim(settings.m_lpfFIRlog2Decim);
987  }
988  if (deviceSettingsKeys.contains("lpfFIRGain") || force) {
989  swgPlutoSdrInputSettings->setLpfFirGain(settings.m_lpfFIRGain);
990  }
991  if (deviceSettingsKeys.contains("fcPos") || force) {
992  swgPlutoSdrInputSettings->setFcPos((int) settings.m_fcPos);
993  }
994  if (deviceSettingsKeys.contains("dcBlock") || force) {
995  swgPlutoSdrInputSettings->setDcBlock(settings.m_dcBlock ? 1 : 0);
996  }
997  if (deviceSettingsKeys.contains("iqCorrection") || force) {
998  swgPlutoSdrInputSettings->setIqCorrection(settings.m_iqCorrection ? 1 : 0);
999  }
1000  if (deviceSettingsKeys.contains("hwBBDCBlock") || force) {
1001  swgPlutoSdrInputSettings->setHwBbdcBlock(settings.m_hwBBDCBlock ? 1 : 0);
1002  }
1003  if (deviceSettingsKeys.contains("hwRFDCBlock") || force) {
1004  swgPlutoSdrInputSettings->setHwRfdcBlock(settings.m_hwRFDCBlock ? 1 : 0);
1005  }
1006  if (deviceSettingsKeys.contains("hwIQCorrection") || force) {
1007  swgPlutoSdrInputSettings->setHwIqCorrection(settings.m_hwIQCorrection ? 1 : 0);
1008  }
1009  if (deviceSettingsKeys.contains("log2Decim") || force) {
1010  swgPlutoSdrInputSettings->setLog2Decim(settings.m_log2Decim);
1011  }
1012  if (deviceSettingsKeys.contains("lpfBW") || force) {
1013  swgPlutoSdrInputSettings->setLpfBw(settings.m_lpfBW);
1014  }
1015  if (deviceSettingsKeys.contains("gain") || force) {
1016  swgPlutoSdrInputSettings->setGain(settings.m_gain);
1017  }
1018  if (deviceSettingsKeys.contains("antennaPath") || force) {
1019  swgPlutoSdrInputSettings->setAntennaPath((int) settings.m_antennaPath);
1020  }
1021  if (deviceSettingsKeys.contains("gainMode") || force) {
1022  swgPlutoSdrInputSettings->setGainMode((int) settings.m_gainMode);
1023  }
1024  if (deviceSettingsKeys.contains("transverterDeltaFrequency") || force) {
1025  swgPlutoSdrInputSettings->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
1026  }
1027  if (deviceSettingsKeys.contains("transverterMode") || force) {
1028  swgPlutoSdrInputSettings->setTransverterMode(settings.m_transverterMode ? 1 : 0);
1029  }
1030  if (deviceSettingsKeys.contains("fileRecordName") || force) {
1031  swgPlutoSdrInputSettings->setFileRecordName(new QString(settings.m_fileRecordName));
1032  }
1033 
1034  QString deviceSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/device/settings")
1035  .arg(settings.m_reverseAPIAddress)
1036  .arg(settings.m_reverseAPIPort)
1037  .arg(settings.m_reverseAPIDeviceIndex);
1038  m_networkRequest.setUrl(QUrl(deviceSettingsURL));
1039  m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
1040 
1041  QBuffer *buffer=new QBuffer();
1042  buffer->open((QBuffer::ReadWrite));
1043  buffer->write(swgDeviceSettings->asJson().toUtf8());
1044  buffer->seek(0);
1045 
1046  // Always use PATCH to avoid passing reverse API settings
1047  m_networkManager->sendCustomRequest(m_networkRequest, "PATCH", buffer);
1048 
1049  delete swgDeviceSettings;
1050 }
1051 
1053 {
1055  swgDeviceSettings->setDirection(0); // single Rx
1056  swgDeviceSettings->setOriginatorIndex(m_deviceAPI->getDeviceSetIndex());
1057  swgDeviceSettings->setDeviceHwType(new QString("PlutoSDR"));
1058 
1059  QString deviceSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/device/run")
1063  m_networkRequest.setUrl(QUrl(deviceSettingsURL));
1064  m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
1065 
1066  QBuffer *buffer=new QBuffer();
1067  buffer->open((QBuffer::ReadWrite));
1068  buffer->write(swgDeviceSettings->asJson().toUtf8());
1069  buffer->seek(0);
1070 
1071  if (start) {
1072  m_networkManager->sendCustomRequest(m_networkRequest, "POST", buffer);
1073  } else {
1074  m_networkManager->sendCustomRequest(m_networkRequest, "DELETE", buffer);
1075  }
1076 
1077  delete swgDeviceSettings;
1078 }
1079 
1080 void PlutoSDRInput::networkManagerFinished(QNetworkReply *reply)
1081 {
1082  QNetworkReply::NetworkError replyError = reply->error();
1083 
1084  if (replyError)
1085  {
1086  qWarning() << "PlutoSDRInput::networkManagerFinished:"
1087  << " error(" << (int) replyError
1088  << "): " << replyError
1089  << ": " << reply->errorString();
1090  return;
1091  }
1092 
1093  QString answer = reply->readAll();
1094  answer.chop(1); // remove last \n
1095  qDebug("PlutoSDRInput::networkManagerFinished: reply:\n%s", answer.toStdString().c_str());
1096 }
bool getRxGain(int &gaindB, unsigned int chan)
void getRxLORange(uint64_t &minLimit, uint64_t &maxLimit)
bool startDeviceEngine()
Start the device engine corresponding to the stream type.
Definition: deviceapi.cpp:253
PlutoSDRInputThread * m_plutoSDRInputThread
virtual QByteArray serialize() const
void setSampleRate(uint32_t sampleRate)
virtual void destroy()
static qint64 calculateDeviceCenterFrequency(quint64 centerFrequency, qint64 transverterDeltaFrequency, int log2Decim, fcPos_t fcPos, quint32 devSampleRate, FrequencyShiftScheme frequencyShiftScheme, bool transverterMode=false)
void push(Message *message, bool emitSignal=true)
Push message onto queue.
void stopDeviceEngine()
Stop the device engine corresponding to the stream type.
Definition: deviceapi.cpp:266
void setLog2Decimation(unsigned int log2_decim)
FileRecord * m_fileSink
void setFileName(const QString &filename)
Definition: filerecord.cpp:59
uint getDeviceUID() const
Return the current device engine unique ID.
Definition: deviceapi.cpp:303
bool m_threadWasRunning
flag to know if thread needs to be resumed after suspend
bool m_lpfFIREnable
enable digital lowpass FIR filter
struct iio_buffer * m_plutoRxBuffer
quint32 m_lpfFIRlog2Decim
digital lowpass FIR filter log2 of decimation factor (0..2)
const std::vector< DeviceAPI * > & getSinkBuddies() const
Definition: deviceapi.h:166
void startRecording()
Definition: filerecord.cpp:105
static MsgConfigurePlutoSDR * create(const PlutoSDRInputSettings &settings, bool force)
Definition: plutosdrinput.h:48
MessageQueue m_inputMessageQueue
Input queue to the source.
virtual QString asJson() override
DevicePlutoSDRBox::SampleRates m_deviceSampleRates
MessageQueue * getDeviceEngineInputMessageQueue()
Device engine message queue.
Definition: deviceapi.cpp:316
static void translateRFPath(RFPath path, QString &s)
void setReverseApiDeviceIndex(qint32 reverse_api_device_index)
QNetworkAccessManager * m_networkManager
ThreadInterface * m_thread
holds the thread address if started else 0
virtual quint64 getCenterFrequency() const
Center frequency exposed by the source.
bool fetchTemperature()
virtual int webapiSettingsPutPatch(bool force, const QStringList &deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage)
virtual int webapiReportGet(SWGSDRangel::SWGDeviceReport &response, QString &errorMessage)
bool initDeviceEngine()
Init the device engine corresponding to the stream type.
Definition: deviceapi.cpp:240
QString m_deviceDescription
void setReverseApiAddress(QString *reverse_api_address)
void setHwIqCorrection(qint32 hw_iq_correction)
float getTemperature()
bool getRxRSSI(std::string &rssiStr, unsigned int chan)
void setOriginatorIndex(qint32 originator_index)
DevicePlutoSDRParams * m_deviceParams
unique hardware device parameters
bool m_hwRFDCBlock
Hardware RF DC blocking.
void getbbLPRxRange(uint32_t &minLimit, uint32_t &maxLimit)
bool open(const std::string &serial)
uint32_t m_hb3Rate
Rate of the HB3/(DEC3 or INT3) filter (Rx: out, Tx: in) - this is the HB2 working sample rate...
bool applySettings(const PlutoSDRInputSettings &settings, bool force=false)
SampleSinkFifo m_sampleFifo
bool setSize(int size)
static MsgCrossReportToBuddy * create(uint64_t devSampleRate, bool lpfFIREnable, uint32_t lpfFIRlog2Interp, uint32_t lpfFIRBW, int32_t loPPMTenths)
void webapiReverseSendSettings(QList< QString > &deviceSettingsKeys, const PlutoSDRInputSettings &settings, bool force)
unsigned int uint32_t
Definition: rtptypes_win.h:46
QByteArray serialize() const
#define PLUTOSDR_BLOCKSIZE_SAMPLES
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
virtual bool handleMessage(const Message &message)
Processing of a message. Returns true if message has actually been processed.
Definition: filerecord.cpp:128
PlutoSDRInputSettings m_settings
void getRSSI(std::string &rssiStr)
DeviceAPI * m_deviceAPI
void setFIREnable(bool enable)
void setLpfFiRlog2Decim(qint32 lpf_fi_rlog2_decim)
bool m_hwIQCorrection
Hardware IQ correction.
void getbbLPRange(quint32 &minLimit, quint32 &maxLimit)
virtual int webapiRunGet(SWGSDRangel::SWGDeviceState &response, QString &errorMessage)
void webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings &response, const PlutoSDRInputSettings &settings)
virtual int getSampleRate() const
Sample rate exposed by the source.
int getDeviceSetIndex() const
Definition: deviceapi.h:131
void * getBuddySharedPtr() const
Definition: deviceapi.h:161
#define MESSAGE_CLASS_DEFINITION(Name, BaseClass)
Definition: message.h:52
void genUniqueFileName(uint deviceUID, int istream=-1)
Definition: filerecord.cpp:67
struct iio_buffer * createRxBuffer(unsigned int size, bool cyclic)
void setLOPPMTenths(int ppmTenths)
void setReverseApiPort(qint32 reverse_api_port)
bool getRxSampleRates(SampleRates &sampleRates)
virtual void stop()
void webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport &response)
void setFIR(uint32_t sampleRate, uint32_t intdec, DeviceUse use, uint32_t bw, int gain)
SWGPlutoSdrInputReport * getPlutoSdrInputReport()
void setBuddySharedPtr(void *ptr)
Definition: deviceapi.h:162
quint64 m_devSampleRate
Host interface sample rate.
void stopRecording()
Definition: filerecord.cpp:117
int32_t i
Definition: decimators.h:244
static bool match(const Message *message)
Definition: message.cpp:45
void setFileRecordName(QString *file_record_name)
virtual bool handleMessage(const Message &message)
void removeAncillarySink(BasebandSampleSink *sink, unsigned int index=0)
Removes it.
Definition: deviceapi.cpp:100
quint32 m_lpfBW
analog lowpass filter bandwidth (Hz)
virtual int webapiRun(bool run, SWGSDRangel::SWGDeviceState &response, QString &errorMessage)
virtual bool isRunning()
quint32 m_gain
"hardware" gain
void webapiReverseSendStartStop(bool start)
void getLORange(qint64 &minLimit, qint64 &maxLimit)
MessageQueue * m_guiMessageQueue
Input message queue to the GUI.
static void translateGainMode(GainMode mod, QString &s)
bool deserialize(const QByteArray &data)
uint32_t m_firRate
Rate of FIR filter (Rx: out, Tx: in) - this is the host/device communication sample rate...
void setTransverterDeltaFrequency(qint64 transverter_delta_frequency)
DevicePlutoSDRBox * getBox()
void getDeviceEngineStateStr(QString &state)
Definition: deviceapi.cpp:389
uint32_t m_hb2Rate
Rate of the HB2 filter (Rx: out, Tx: in) - this is the HB1 working sample rate.
const QString & getSamplingDeviceSerial() const
Definition: deviceapi.h:121
virtual void init()
initializations to be done when all collaborating objects are created and possibly connected ...
qint32 m_LOppmTenths
XO correction.
const PlutoSDRInputSettings & getSettings() const
Definition: plutosdrinput.h:45
virtual int webapiSettingsGet(SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage)
DevicePlutoSDRShared m_deviceShared
uint32_t m_hb1Rate
Rate of the HB1 filter (Rx: out, Tx: in) - this is the FIR working sample rate.
void getGain(int &gainStr)
void setCenterFrequency(qint64 center_frequency)
bool m_hwBBDCBlock
Hardware baseband DC blocking.
static MsgStartStop * create(bool startStop)
Definition: plutosdrinput.h:89
uint32_t m_bbRateHz
Baseband PLL rate (Hz) - used internally.
virtual bool deserialize(const QByteArray &data)
float getTemp() const
quint32 m_lpfFIRBW
digital lowpass FIR filter bandwidth (Hz)
SWGPlutoSdrInputSettings * getPlutoSdrInputSettings()
void networkManagerFinished(QNetworkReply *reply)
virtual bool start()
virtual void setCenterFrequency(qint64 centerFrequency)
void configureCorrections(bool dcOffsetCorrection, bool iqImbalanceCorrection, int streamIndex=0)
Configure current device engine DSP corrections (Rx)
Definition: deviceapi.cpp:355
void setPlutoSdrInputSettings(SWGPlutoSdrInputSettings *pluto_sdr_input_settings)
QNetworkRequest m_networkRequest
void setDirection(qint32 direction)
uint32_t m_addaConnvRate
A/D or D/A converter rat - this is the HB3 working sample rate.
virtual const QString & getDeviceDescription() const
T max(const T &x, const T &y)
Definition: framework.h:446
uint32_t getADCSampleRate() const
void setDeviceHwType(QString *device_hw_type)
void setTransverterMode(qint32 transverter_mode)
void setPlutoSdrInputReport(SWGPlutoSdrInputReport *pluto_sdr_input_report)
void set_params(DeviceType devType, const std::vector< std::string > &params)
int m_lpfFIRGain
digital lowpass FIR filter gain (dB)
T min(const T &x, const T &y)
Definition: framework.h:440
unsigned __int64 uint64_t
Definition: rtptypes_win.h:48