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.
Classes | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
PlutoSDROutput Class Reference

#include <plutosdroutput.h>

+ Inheritance diagram for PlutoSDROutput:
+ Collaboration diagram for PlutoSDROutput:

Classes

class  MsgConfigurePlutoSDR
 
class  MsgStartStop
 

Public Member Functions

 PlutoSDROutput (DeviceAPI *deviceAPI)
 
 ~PlutoSDROutput ()
 
virtual void destroy ()
 
virtual void init ()
 initializations to be done when all collaborating objects are created and possibly connected More...
 
virtual bool start ()
 
virtual void stop ()
 
virtual QByteArray serialize () const
 
virtual bool deserialize (const QByteArray &data)
 
virtual void setMessageQueueToGUI (MessageQueue *queue)
 
virtual const QString & getDeviceDescription () const
 
virtual int getSampleRate () const
 Sample rate exposed by the sink. More...
 
virtual void setSampleRate (int sampleRate)
 For when the sink sample rate is set externally. More...
 
virtual quint64 getCenterFrequency () const
 Center frequency exposed by the sink. More...
 
virtual void setCenterFrequency (qint64 centerFrequency)
 
virtual bool handleMessage (const Message &message)
 
virtual int webapiSettingsGet (SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage)
 
virtual int webapiSettingsPutPatch (bool force, const QStringList &deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage)
 
virtual int webapiReportGet (SWGSDRangel::SWGDeviceReport &response, QString &errorMessage)
 
virtual int webapiRunGet (SWGSDRangel::SWGDeviceState &response, QString &errorMessage)
 
virtual int webapiRun (bool run, SWGSDRangel::SWGDeviceState &response, QString &errorMessage)
 
uint32_t getDACSampleRate () const
 
uint32_t getFIRSampleRate () const
 
void getRSSI (std::string &rssiStr)
 
void getLORange (qint64 &minLimit, qint64 &maxLimit)
 
void getbbLPRange (quint32 &minLimit, quint32 &maxLimit)
 
bool fetchTemperature ()
 
float getTemperature ()
 
- Public Member Functions inherited from DeviceSampleSink
 DeviceSampleSink ()
 
virtual ~DeviceSampleSink ()
 
MessageQueuegetInputMessageQueue ()
 
MessageQueuegetMessageQueueToGUI ()
 
SampleSourceFifogetSampleFifo ()
 

Private Slots

void networkManagerFinished (QNetworkReply *reply)
 

Private Member Functions

bool openDevice ()
 
void closeDevice ()
 
void suspendBuddies ()
 
void resumeBuddies ()
 
bool applySettings (const PlutoSDROutputSettings &settings, bool force=false)
 
void webapiFormatDeviceSettings (SWGSDRangel::SWGDeviceSettings &response, const PlutoSDROutputSettings &settings)
 
void webapiFormatDeviceReport (SWGSDRangel::SWGDeviceReport &response)
 
void webapiReverseSendSettings (QList< QString > &deviceSettingsKeys, const PlutoSDROutputSettings &settings, bool force)
 
void webapiReverseSendStartStop (bool start)
 

Private Attributes

DeviceAPIm_deviceAPI
 
QString m_deviceDescription
 
PlutoSDROutputSettings m_settings
 
bool m_running
 
DevicePlutoSDRShared m_deviceShared
 
struct iio_buffer * m_plutoTxBuffer
 
PlutoSDROutputThreadm_plutoSDROutputThread
 
DevicePlutoSDRBox::SampleRates m_deviceSampleRates
 
QMutex m_mutex
 
QNetworkAccessManager * m_networkManager
 
QNetworkRequest m_networkRequest
 

Additional Inherited Members

- Public Types inherited from DeviceSampleSink
enum  fcPos_t { FC_POS_INFRA = 0, FC_POS_SUPRA, FC_POS_CENTER }
 
- Static Public Member Functions inherited from DeviceSampleSink
static qint64 calculateDeviceCenterFrequency (quint64 centerFrequency, qint64 transverterDeltaFrequency, int log2Interp, fcPos_t fcPos, quint32 devSampleRate, bool transverterMode=false)
 
static qint64 calculateCenterFrequency (quint64 deviceCenterFrequency, qint64 transverterDeltaFrequency, int log2Interp, fcPos_t fcPos, quint32 devSampleRate, bool transverterMode=false)
 
static qint32 calculateFrequencyShift (int log2Interp, fcPos_t fcPos, quint32 devSampleRate)
 
- Protected Slots inherited from DeviceSampleSink
void handleInputMessages ()
 
- Protected Attributes inherited from DeviceSampleSink
SampleSourceFifo m_sampleSourceFifo
 
MessageQueue m_inputMessageQueue
 Input queue to the sink. More...
 
MessageQueuem_guiMessageQueue
 Input message queue to the GUI. More...
 

Detailed Description

Definition at line 36 of file plutosdroutput.h.

Constructor & Destructor Documentation

◆ PlutoSDROutput()

PlutoSDROutput::PlutoSDROutput ( DeviceAPI deviceAPI)

Definition at line 41 of file plutosdroutput.cpp.

Referenced by PlutoSDROutput::MsgStartStop::MsgStartStop().

41  :
42  m_deviceAPI(deviceAPI),
43  m_deviceDescription("PlutoSDROutput"),
44  m_settings(),
45  m_running(false),
46  m_plutoTxBuffer(0),
48 {
56 
58  openDevice();
59  resumeBuddies();
60 
61  m_networkManager = new QNetworkAccessManager();
62  connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
63 }
struct iio_buffer * m_plutoTxBuffer
void setNbSinkStreams(uint32_t nbSinkStreams)
Definition: deviceapi.h:169
uint32_t m_hb3Rate
Rate of the HB3/(DEC3 or INT3) filter (Rx: out, Tx: in) - this is the HB2 working sample rate...
PlutoSDROutputThread * m_plutoSDROutputThread
DevicePlutoSDRBox::SampleRates m_deviceSampleRates
void networkManagerFinished(QNetworkReply *reply)
uint32_t m_firRate
Rate of FIR filter (Rx: out, Tx: in) - this is the host/device communication sample rate...
uint32_t m_hb2Rate
Rate of the HB2 filter (Rx: out, Tx: in) - this is the HB1 working sample rate.
QNetworkAccessManager * m_networkManager
uint32_t m_hb1Rate
Rate of the HB1 filter (Rx: out, Tx: in) - this is the FIR working sample rate.
uint32_t m_bbRateHz
Baseband PLL rate (Hz) - used internally.
DeviceAPI * m_deviceAPI
QString m_deviceDescription
uint32_t m_addaConnvRate
A/D or D/A converter rat - this is the HB3 working sample rate.
PlutoSDROutputSettings m_settings
+ Here is the caller graph for this function:

◆ ~PlutoSDROutput()

PlutoSDROutput::~PlutoSDROutput ( )

Definition at line 65 of file plutosdroutput.cpp.

References closeDevice(), m_networkManager, networkManagerFinished(), resumeBuddies(), and suspendBuddies().

Referenced by PlutoSDROutput::MsgStartStop::MsgStartStop().

66 {
67  disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
68  delete m_networkManager;
69 
71  closeDevice();
72  resumeBuddies();
73 }
void networkManagerFinished(QNetworkReply *reply)
QNetworkAccessManager * m_networkManager
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Function Documentation

◆ applySettings()

bool PlutoSDROutput::applySettings ( const PlutoSDROutputSettings settings,
bool  force = false 
)
private

Definition at line 323 of file plutosdroutput.cpp.

References arg(), DevicePlutoSDRShared::MsgCrossReportToBuddy::create(), DevicePlutoSDRBox::DEVICE_PHY, DevicePlutoSDRParams::getBox(), DeviceAPI::getDeviceEngineInputMessageQueue(), DeviceAPI::getSourceBuddies(), DevicePlutoSDRBox::getTxSampleRates(), PlutoSDROutputThread::isRunning(), DevicePlutoSDRBox::SampleRates::m_addaConnvRate, PlutoSDROutputSettings::m_antennaPath, PlutoSDROutputSettings::m_att, DevicePlutoSDRBox::SampleRates::m_bbRateHz, PlutoSDROutputSettings::m_centerFrequency, m_deviceAPI, DevicePlutoSDRShared::m_deviceParams, m_deviceSampleRates, m_deviceShared, PlutoSDROutputSettings::m_devSampleRate, DevicePlutoSDRBox::SampleRates::m_firRate, DevicePlutoSDRBox::SampleRates::m_hb1Rate, DevicePlutoSDRBox::SampleRates::m_hb2Rate, DevicePlutoSDRBox::SampleRates::m_hb3Rate, PlutoSDROutputSettings::m_log2Interp, PlutoSDROutputSettings::m_LOppmTenths, PlutoSDROutputSettings::m_lpfBW, PlutoSDROutputSettings::m_lpfFIRBW, PlutoSDROutputSettings::m_lpfFIREnable, PlutoSDROutputSettings::m_lpfFIRGain, PlutoSDROutputSettings::m_lpfFIRlog2Interp, m_plutoSDROutputThread, PlutoSDROutputSettings::m_reverseAPIAddress, PlutoSDROutputSettings::m_reverseAPIDeviceIndex, PlutoSDROutputSettings::m_reverseAPIPort, DeviceSampleSink::m_sampleSourceFifo, m_settings, DevicePlutoSDRShared::m_thread, DevicePlutoSDRShared::m_threadWasRunning, PlutoSDROutputSettings::m_transverterDeltaFrequency, PlutoSDROutputSettings::m_transverterMode, PlutoSDROutputSettings::m_useReverseAPI, PLUTOSDR_BLOCKSIZE_SAMPLES, MessageQueue::push(), SampleSourceFifo::resize(), DevicePlutoSDRBox::set_params(), DevicePlutoSDRBox::setFIR(), DevicePlutoSDRBox::setFIREnable(), PlutoSDROutputThread::setLog2Interpolation(), DevicePlutoSDRBox::setLOPPMTenths(), DevicePlutoSDRBox::setSampleRate(), PlutoSDROutputThread::startWork(), DevicePlutoSDRShared::ThreadInterface::startWork(), PlutoSDROutputThread::stopWork(), DevicePlutoSDRShared::ThreadInterface::stopWork(), PlutoSDROutputSettings::translateRFPath(), DevicePlutoSDRBox::USE_TX, and webapiReverseSendSettings().

Referenced by handleMessage(), init(), and start().

324 {
325  bool forwardChangeOwnDSP = false;
326  bool forwardChangeOtherDSP = false;
327  bool ownThreadWasRunning = false;
328  bool suspendAllOtherThreads = false; // All others means Rx in fact
330  QLocale loc;
331  QList<QString> reverseAPIKeys;
332 
333  qDebug().noquote() << "PlutoSDROutput::applySettings: center freq: " << m_settings.m_centerFrequency << " Hz"
334  << " m_devSampleRate: " << loc.toString(m_settings.m_devSampleRate) << "S/s"
335  << " m_LOppmTenths: " << m_settings.m_LOppmTenths
336  << " m_lpfFIREnable: " << m_settings.m_lpfFIREnable
337  << " m_lpfFIRBW: " << loc.toString(m_settings.m_lpfFIRBW)
338  << " m_lpfFIRlog2Interp: " << m_settings.m_lpfFIRlog2Interp
339  << " m_lpfFIRGain: " << m_settings.m_lpfFIRGain
340  << " m_log2Interp: " << loc.toString(1<<m_settings.m_log2Interp)
341  << " m_lpfBW: " << loc.toString(m_settings.m_lpfBW)
342  << " m_att: " << m_settings.m_att
343  << " m_antennaPath: " << (int) m_settings.m_antennaPath
344  << " m_transverterMode: " << m_settings.m_transverterMode
345  << " m_transverterDeltaFrequency: " << m_settings.m_transverterDeltaFrequency
346  << " force: " << force;
347 
348  if ((m_settings.m_devSampleRate != settings.m_devSampleRate) || force) {
349  reverseAPIKeys.append("devSampleRate");
350  }
351  if ((m_settings.m_lpfFIREnable != settings.m_lpfFIREnable) || force) {
352  reverseAPIKeys.append("lpfFIREnable");
353  }
354  if ((m_settings.m_lpfFIRlog2Interp != settings.m_lpfFIRlog2Interp) || force) {
355  reverseAPIKeys.append("lpfFIRlog2Interp");
356  }
357  if ((m_settings.m_lpfFIRBW != settings.m_lpfFIRBW) || force) {
358  reverseAPIKeys.append("lpfFIRBW");
359  }
360  if ((m_settings.m_lpfFIRGain != settings.m_lpfFIRGain) || force) {
361  reverseAPIKeys.append("lpfFIRGain");
362  }
363  if ((m_settings.m_LOppmTenths != settings.m_LOppmTenths) || force) {
364  reverseAPIKeys.append("LOppmTenths");
365  }
366 
367  // determine if buddies threads or own thread need to be suspended
368 
369  // changes affecting all buddies can occur if
370  // - device to host sample rate is changed
371  // - FIR filter is enabled or disabled
372  // - FIR filter is changed
373  // - LO correction is changed
374  if ((m_settings.m_devSampleRate != settings.m_devSampleRate) ||
375  (m_settings.m_lpfFIREnable != settings.m_lpfFIREnable) ||
377  (settings.m_lpfFIRBW != m_settings.m_lpfFIRBW) ||
378  (settings.m_lpfFIRGain != m_settings.m_lpfFIRGain) ||
379  (m_settings.m_LOppmTenths != settings.m_LOppmTenths) || force)
380  {
381  suspendAllOtherThreads = true;
382  }
383 
384  if (suspendAllOtherThreads)
385  {
386  const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
387  std::vector<DeviceAPI*>::const_iterator itSink = sourceBuddies.begin();
388 
389  for (; itSink != sourceBuddies.end(); ++itSink)
390  {
391  DevicePlutoSDRShared *buddySharedPtr = (DevicePlutoSDRShared *) (*itSink)->getBuddySharedPtr();
392 
393  if (buddySharedPtr->m_thread) {
394  buddySharedPtr->m_thread->stopWork();
395  buddySharedPtr->m_threadWasRunning = true;
396  }
397  else
398  {
399  buddySharedPtr->m_threadWasRunning = false;
400  }
401  }
402  }
403 
405  {
407  ownThreadWasRunning = true;
408  }
409 
410  // apply settings
411 
412  // Change affecting device sample rate chain and other buddies
413  if ((m_settings.m_devSampleRate != settings.m_devSampleRate) ||
414  (m_settings.m_lpfFIREnable != settings.m_lpfFIREnable) ||
416  (settings.m_lpfFIRBW != m_settings.m_lpfFIRBW) ||
417  (settings.m_lpfFIRGain != m_settings.m_lpfFIRGain) || force)
418  {
419  plutoBox->setFIR(settings.m_devSampleRate, settings.m_lpfFIRlog2Interp, DevicePlutoSDRBox::USE_TX, settings.m_lpfFIRBW, settings.m_lpfFIRGain);
420  plutoBox->setFIREnable(settings.m_lpfFIREnable); // eventually enable/disable FIR
421  plutoBox->setSampleRate(settings.m_devSampleRate); // and set end point sample rate
422 
423  plutoBox->getTxSampleRates(m_deviceSampleRates); // pick up possible new rates
424  qDebug() << "PlutoSDRInput::applySettings: BBPLL(Hz): " << m_deviceSampleRates.m_bbRateHz
425  << " DAC: " << m_deviceSampleRates.m_addaConnvRate
426  << " <-HB3- " << m_deviceSampleRates.m_hb3Rate
427  << " <-HB2- " << m_deviceSampleRates.m_hb2Rate
428  << " <-HB1- " << m_deviceSampleRates.m_hb1Rate
429  << " <-FIR- " << m_deviceSampleRates.m_firRate;
430 
431  forwardChangeOtherDSP = true;
432  forwardChangeOwnDSP = (m_settings.m_devSampleRate != settings.m_devSampleRate) || force;
433  }
434 
435  if ((m_settings.m_log2Interp != settings.m_log2Interp) || force)
436  {
437  reverseAPIKeys.append("log2Interp");
439 
440  if (m_plutoSDROutputThread != 0)
441  {
443  qDebug() << "PlutoSDROutput::applySettings: set soft interpolation in thread to " << (1<<settings.m_log2Interp);
444  }
445 
446  forwardChangeOwnDSP = true;
447  }
448 
449  if ((m_settings.m_LOppmTenths != settings.m_LOppmTenths) || force)
450  {
451  plutoBox->setLOPPMTenths(settings.m_LOppmTenths);
452  forwardChangeOtherDSP = true;
453  }
454 
455  std::vector<std::string> params;
456  bool paramsToSet = false;
457 
458  if ((m_settings.m_centerFrequency != settings.m_centerFrequency) || force) {
459  reverseAPIKeys.append("centerFrequency");
460  }
461  if ((m_settings.m_transverterMode != settings.m_transverterMode) || force) {
462  reverseAPIKeys.append("transverterMode");
463  }
465  reverseAPIKeys.append("transverterDeltaFrequency");
466  }
467 
468  if (force || (m_settings.m_centerFrequency != settings.m_centerFrequency)
471 
472  {
473  qint64 deviceCenterFrequency = settings.m_centerFrequency;
474  deviceCenterFrequency -= settings.m_transverterMode ? settings.m_transverterDeltaFrequency : 0;
475  deviceCenterFrequency = deviceCenterFrequency < 0 ? 0 : deviceCenterFrequency;
476 
477 
478  params.push_back(QString(tr("out_altvoltage1_TX_LO_frequency=%1").arg(deviceCenterFrequency)).toStdString());
479  paramsToSet = true;
480  forwardChangeOwnDSP = true;
481 
482  qDebug() << "PlutoSDROutput::applySettings: center freq: " << settings.m_centerFrequency << " Hz"
483  << " device center freq: " << deviceCenterFrequency << " Hz";
484 
485  }
486 
487  if ((m_settings.m_lpfBW != settings.m_lpfBW) || force)
488  {
489  reverseAPIKeys.append("lpfBW");
490  params.push_back(QString(tr("out_voltage_rf_bandwidth=%1").arg(settings.m_lpfBW)).toStdString());
491  paramsToSet = true;
492  }
493 
494  if ((m_settings.m_antennaPath != settings.m_antennaPath) || force)
495  {
496  reverseAPIKeys.append("antennaPath");
497  QString rfPortStr;
499  params.push_back(QString(tr("out_voltage0_rf_port_select=%1").arg(rfPortStr)).toStdString());
500  paramsToSet = true;
501  }
502 
503  if ((m_settings.m_att != settings.m_att) || force)
504  {
505  reverseAPIKeys.append("att");
506  float attF = settings.m_att * 0.25f;
507  params.push_back(QString(tr("out_voltage0_hardwaregain=%1").arg(attF)).toStdString());
508  paramsToSet = true;
509  }
510 
511  if (paramsToSet)
512  {
513  plutoBox->set_params(DevicePlutoSDRBox::DEVICE_PHY, params);
514  }
515 
516  if (settings.m_useReverseAPI)
517  {
518  bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) ||
522  webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force);
523  }
524 
525  m_settings = settings;
526 
527  if (suspendAllOtherThreads)
528  {
529  const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
530  std::vector<DeviceAPI*>::const_iterator itSource = sourceBuddies.begin();
531 
532  for (; itSource != sourceBuddies.end(); ++itSource)
533  {
534  DevicePlutoSDRShared *buddySharedPtr = (DevicePlutoSDRShared *) (*itSource)->getBuddySharedPtr();
535 
536  if (buddySharedPtr->m_threadWasRunning) {
537  buddySharedPtr->m_thread->startWork();
538  }
539  }
540  }
541 
542  if (ownThreadWasRunning) {
544  }
545 
546  // TODO: forward changes to other (Rx) DSP
547  if (forwardChangeOtherDSP)
548  {
549  qDebug("PlutoSDROutput::applySettings: forwardChangeOtherDSP");
550 
551  const std::vector<DeviceAPI*>& sourceBuddies = m_deviceAPI->getSourceBuddies();
552  std::vector<DeviceAPI*>::const_iterator itSource = sourceBuddies.begin();
553 
554  for (; itSource != sourceBuddies.end(); ++itSource)
555  {
557  settings.m_devSampleRate,
558  settings.m_lpfFIREnable,
559  settings.m_lpfFIRlog2Interp,
560  settings.m_lpfFIRBW,
561  settings.m_LOppmTenths);
562 
563  if ((*itSource)->getSamplingDeviceGUIMessageQueue())
564  {
566  (*itSource)->getSamplingDeviceGUIMessageQueue()->push(msgToGUI);
567  }
568 
569  (*itSource)->getSamplingDeviceInputMessageQueue()->push(msg);
570  }
571  }
572 
573  if (forwardChangeOwnDSP)
574  {
575  qDebug("PlutoSDROutput::applySettings: forward change to self");
576 
577  int sampleRate = m_settings.m_devSampleRate/(1<<m_settings.m_log2Interp);
580  }
581 
582  return true;
583 }
qint32 m_LOppmTenths
XO correction.
void setSampleRate(uint32_t sampleRate)
void push(Message *message, bool emitSignal=true)
Push message onto queue.
bool m_threadWasRunning
flag to know if thread needs to be resumed after suspend
MessageQueue * getDeviceEngineInputMessageQueue()
Device engine message queue.
Definition: deviceapi.cpp:316
ThreadInterface * m_thread
holds the thread address if started else 0
qint32 m_att
"hardware" attenuation in dB fourths
DevicePlutoSDRParams * m_deviceParams
unique hardware device parameters
uint32_t m_hb3Rate
Rate of the HB3/(DEC3 or INT3) filter (Rx: out, Tx: in) - this is the HB2 working sample rate...
static MsgCrossReportToBuddy * create(uint64_t devSampleRate, bool lpfFIREnable, uint32_t lpfFIRlog2Interp, uint32_t lpfFIRBW, int32_t loPPMTenths)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void setFIREnable(bool enable)
quint32 m_lpfBW
analog lowpass filter bandwidth (Hz)
void setLOPPMTenths(int ppmTenths)
PlutoSDROutputThread * m_plutoSDROutputThread
DevicePlutoSDRBox::SampleRates m_deviceSampleRates
void setFIR(uint32_t sampleRate, uint32_t intdec, DeviceUse use, uint32_t bw, int gain)
bool m_lpfFIREnable
enable digital lowpass FIR filter
void webapiReverseSendSettings(QList< QString > &deviceSettingsKeys, const PlutoSDROutputSettings &settings, bool force)
static void translateRFPath(RFPath path, QString &s)
bool getTxSampleRates(SampleRates &sampleRates)
DevicePlutoSDRShared m_deviceShared
uint32_t m_firRate
Rate of FIR filter (Rx: out, Tx: in) - this is the host/device communication sample rate...
quint32 m_lpfFIRlog2Interp
digital lowpass FIR filter log2 of interpolation factor (0..2)
DevicePlutoSDRBox * getBox()
void resize(uint32_t size)
uint32_t m_hb2Rate
Rate of the HB2 filter (Rx: out, Tx: in) - this is the HB1 working sample rate.
quint64 m_devSampleRate
Host interface sample rate.
uint32_t m_hb1Rate
Rate of the HB1 filter (Rx: out, Tx: in) - this is the FIR working sample rate.
SampleSourceFifo m_sampleSourceFifo
const std::vector< DeviceAPI * > & getSourceBuddies() const
Definition: deviceapi.h:165
uint32_t m_bbRateHz
Baseband PLL rate (Hz) - used internally.
DeviceAPI * m_deviceAPI
#define PLUTOSDR_BLOCKSIZE_SAMPLES
uint32_t m_addaConnvRate
A/D or D/A converter rat - this is the HB3 working sample rate.
int m_lpfFIRGain
digital lowpass FIR filter gain (dB)
quint32 m_lpfFIRBW
digital lowpass FIR filter bandwidth (Hz)
PlutoSDROutputSettings m_settings
void setLog2Interpolation(unsigned int log2_interp)
void set_params(DeviceType devType, const std::vector< std::string > &params)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ closeDevice()

void PlutoSDROutput::closeDevice ( )
private

Definition at line 279 of file plutosdroutput.cpp.

References DevicePlutoSDRParams::close(), DevicePlutoSDRParams::getBox(), DeviceAPI::getSourceBuddies(), m_deviceAPI, DevicePlutoSDRShared::m_deviceParams, and m_deviceShared.

Referenced by ~PlutoSDROutput().

280 {
281  if (m_deviceShared.m_deviceParams->getBox() == 0) { // was never open
282  return;
283  }
284 
285  if (m_deviceAPI->getSourceBuddies().size() == 0)
286  {
290  }
291 }
DevicePlutoSDRParams * m_deviceParams
unique hardware device parameters
DevicePlutoSDRShared m_deviceShared
DevicePlutoSDRBox * getBox()
const std::vector< DeviceAPI * > & getSourceBuddies() const
Definition: deviceapi.h:165
DeviceAPI * m_deviceAPI
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deserialize()

bool PlutoSDROutput::deserialize ( const QByteArray &  data)
virtual

Implements DeviceSampleSink.

Definition at line 127 of file plutosdroutput.cpp.

References PlutoSDROutput::MsgConfigurePlutoSDR::create(), PlutoSDROutputSettings::deserialize(), DeviceSampleSink::m_guiMessageQueue, DeviceSampleSink::m_inputMessageQueue, m_settings, MessageQueue::push(), and PlutoSDROutputSettings::resetToDefaults().

Referenced by PlutoSDROutput::MsgStartStop::MsgStartStop().

128 {
129  bool success = true;
130 
131  if (!m_settings.deserialize(data))
132  {
134  success = false;
135  }
136 
137  MsgConfigurePlutoSDR* message = MsgConfigurePlutoSDR::create(m_settings, true);
138  m_inputMessageQueue.push(message);
139 
140  if (m_guiMessageQueue)
141  {
142  MsgConfigurePlutoSDR* messageToGUI = MsgConfigurePlutoSDR::create(m_settings, true);
143  m_guiMessageQueue->push(messageToGUI);
144  }
145 
146  return success;
147 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue m_inputMessageQueue
Input queue to the sink.
bool deserialize(const QByteArray &data)
static MsgConfigurePlutoSDR * create(const PlutoSDROutputSettings &settings, bool force)
MessageQueue * m_guiMessageQueue
Input message queue to the GUI.
PlutoSDROutputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ destroy()

void PlutoSDROutput::destroy ( )
virtual

Implements DeviceSampleSink.

Definition at line 75 of file plutosdroutput.cpp.

Referenced by PlutoSDROutput::MsgStartStop::MsgStartStop().

76 {
77  delete this;
78 }
+ Here is the caller graph for this function:

◆ fetchTemperature()

bool PlutoSDROutput::fetchTemperature ( )

Definition at line 614 of file plutosdroutput.cpp.

References DevicePlutoSDRBox::fetchTemp(), DevicePlutoSDRParams::getBox(), DevicePlutoSDRShared::m_deviceParams, and m_deviceShared.

Referenced by getFIRSampleRate(), and webapiFormatDeviceReport().

615 {
617  return plutoBox->fetchTemp();
618 }
DevicePlutoSDRParams * m_deviceParams
unique hardware device parameters
DevicePlutoSDRShared m_deviceShared
DevicePlutoSDRBox * getBox()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getbbLPRange()

void PlutoSDROutput::getbbLPRange ( quint32 &  minLimit,
quint32 &  maxLimit 
)

Definition at line 604 of file plutosdroutput.cpp.

References DevicePlutoSDRBox::getbbLPTxRange(), DevicePlutoSDRParams::getBox(), DevicePlutoSDRShared::m_deviceParams, m_deviceShared, leansdr::max(), and leansdr::min().

Referenced by getFIRSampleRate().

605 {
606  uint32_t min, max;
608 
609  plutoBox->getbbLPTxRange(min, max);
610  minLimit = min;
611  maxLimit = max;
612 }
DevicePlutoSDRParams * m_deviceParams
unique hardware device parameters
unsigned int uint32_t
Definition: rtptypes_win.h:46
DevicePlutoSDRShared m_deviceShared
DevicePlutoSDRBox * getBox()
void getbbLPTxRange(uint32_t &minLimit, uint32_t &maxLimit)
T max(const T &x, const T &y)
Definition: framework.h:446
T min(const T &x, const T &y)
Definition: framework.h:440
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCenterFrequency()

quint64 PlutoSDROutput::getCenterFrequency ( ) const
virtual

Center frequency exposed by the sink.

Implements DeviceSampleSink.

Definition at line 158 of file plutosdroutput.cpp.

References PlutoSDROutputSettings::m_centerFrequency, and m_settings.

Referenced by setSampleRate().

159 {
161 }
PlutoSDROutputSettings m_settings
+ Here is the caller graph for this function:

◆ getDACSampleRate()

uint32_t PlutoSDROutput::getDACSampleRate ( ) const
inline

Definition at line 124 of file plutosdroutput.h.

References DevicePlutoSDRBox::SampleRates::m_addaConnvRate, and m_deviceSampleRates.

Referenced by webapiFormatDeviceReport().

DevicePlutoSDRBox::SampleRates m_deviceSampleRates
uint32_t m_addaConnvRate
A/D or D/A converter rat - this is the HB3 working sample rate.
+ Here is the caller graph for this function:

◆ getDeviceDescription()

const QString & PlutoSDROutput::getDeviceDescription ( ) const
virtual

Implements DeviceSampleSink.

Definition at line 149 of file plutosdroutput.cpp.

References m_deviceDescription.

Referenced by setMessageQueueToGUI().

150 {
151  return m_deviceDescription;
152 }
QString m_deviceDescription
+ Here is the caller graph for this function:

◆ getFIRSampleRate()

uint32_t PlutoSDROutput::getFIRSampleRate ( ) const
inline

Definition at line 125 of file plutosdroutput.h.

References fetchTemperature(), getbbLPRange(), getLORange(), getRSSI(), getTemperature(), m_deviceSampleRates, and DevicePlutoSDRBox::SampleRates::m_hb1Rate.

125 { return m_deviceSampleRates.m_hb1Rate; }
DevicePlutoSDRBox::SampleRates m_deviceSampleRates
uint32_t m_hb1Rate
Rate of the HB1 filter (Rx: out, Tx: in) - this is the FIR working sample rate.
+ Here is the call graph for this function:

◆ getLORange()

void PlutoSDROutput::getLORange ( qint64 &  minLimit,
qint64 &  maxLimit 
)

Definition at line 594 of file plutosdroutput.cpp.

References DevicePlutoSDRParams::getBox(), DevicePlutoSDRBox::getTxLORange(), DevicePlutoSDRShared::m_deviceParams, m_deviceShared, leansdr::max(), and leansdr::min().

Referenced by getFIRSampleRate().

595 {
596  uint64_t min, max;
598 
599  plutoBox->getTxLORange(min, max);
600  minLimit = min;
601  maxLimit = max;
602 }
DevicePlutoSDRParams * m_deviceParams
unique hardware device parameters
DevicePlutoSDRShared m_deviceShared
void getTxLORange(uint64_t &minLimit, uint64_t &maxLimit)
DevicePlutoSDRBox * getBox()
T max(const T &x, const T &y)
Definition: framework.h:446
T min(const T &x, const T &y)
Definition: framework.h:440
unsigned __int64 uint64_t
Definition: rtptypes_win.h:48
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRSSI()

void PlutoSDROutput::getRSSI ( std::string &  rssiStr)

Definition at line 585 of file plutosdroutput.cpp.

References DevicePlutoSDRParams::getBox(), DevicePlutoSDRBox::getTxRSSI(), DevicePlutoSDRShared::m_deviceParams, and m_deviceShared.

Referenced by getFIRSampleRate(), and webapiFormatDeviceReport().

586 {
588 
589  if (!plutoBox->getTxRSSI(rssiStr, 0)) {
590  rssiStr = "xxx dB";
591  }
592 }
bool getTxRSSI(std::string &rssiStr, unsigned int chan)
DevicePlutoSDRParams * m_deviceParams
unique hardware device parameters
DevicePlutoSDRShared m_deviceShared
DevicePlutoSDRBox * getBox()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSampleRate()

int PlutoSDROutput::getSampleRate ( ) const
virtual

Sample rate exposed by the sink.

Implements DeviceSampleSink.

Definition at line 153 of file plutosdroutput.cpp.

References PlutoSDROutputSettings::m_devSampleRate, PlutoSDROutputSettings::m_log2Interp, and m_settings.

Referenced by setMessageQueueToGUI().

154 {
156 }
quint64 m_devSampleRate
Host interface sample rate.
PlutoSDROutputSettings m_settings
+ Here is the caller graph for this function:

◆ getTemperature()

float PlutoSDROutput::getTemperature ( )

Definition at line 620 of file plutosdroutput.cpp.

References DevicePlutoSDRParams::getBox(), DevicePlutoSDRBox::getTemp(), DevicePlutoSDRShared::m_deviceParams, and m_deviceShared.

Referenced by getFIRSampleRate(), and webapiFormatDeviceReport().

621 {
623  return plutoBox->getTemp();
624 }
DevicePlutoSDRParams * m_deviceParams
unique hardware device parameters
DevicePlutoSDRShared m_deviceShared
DevicePlutoSDRBox * getBox()
float getTemp() const
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleMessage()

bool PlutoSDROutput::handleMessage ( const Message message)
virtual

Implements DeviceSampleSink.

Definition at line 178 of file plutosdroutput.cpp.

References applySettings(), DevicePlutoSDRShared::MsgCrossReportToBuddy::getDevSampleRate(), PlutoSDROutput::MsgConfigurePlutoSDR::getForce(), DevicePlutoSDRShared::MsgCrossReportToBuddy::getLoPPMTenths(), DevicePlutoSDRShared::MsgCrossReportToBuddy::getLpfFirbw(), DevicePlutoSDRShared::MsgCrossReportToBuddy::getLpfFiRlog2IntDec(), PlutoSDROutput::MsgConfigurePlutoSDR::getSettings(), PlutoSDROutput::MsgStartStop::getStartStop(), DeviceAPI::initDeviceEngine(), DevicePlutoSDRShared::MsgCrossReportToBuddy::isLpfFirEnable(), m_deviceAPI, PlutoSDROutputSettings::m_devSampleRate, PlutoSDROutputSettings::m_LOppmTenths, PlutoSDROutputSettings::m_lpfFIRBW, PlutoSDROutputSettings::m_lpfFIREnable, PlutoSDROutputSettings::m_lpfFIRlog2Interp, m_settings, PlutoSDROutputSettings::m_useReverseAPI, Message::match(), DeviceAPI::startDeviceEngine(), DeviceAPI::stopDeviceEngine(), and webapiReverseSendStartStop().

Referenced by setSampleRate().

179 {
180  if (MsgConfigurePlutoSDR::match(message))
181  {
182  MsgConfigurePlutoSDR& conf = (MsgConfigurePlutoSDR&) message;
183  qDebug() << "PlutoSDROutput::handleMessage: MsgConfigurePlutoSDR";
184 
185  if (!applySettings(conf.getSettings(), conf.getForce()))
186  {
187  qDebug("PlutoSDROutput::handleMessage config error");
188  }
189 
190  return true;
191  }
192  else if (DevicePlutoSDRShared::MsgCrossReportToBuddy::match(message)) // message from buddy
193  {
199  PlutoSDROutputSettings newSettings = m_settings;
200  newSettings.m_lpfFIREnable = conf.isLpfFirEnable();
201  applySettings(newSettings);
202 
203  return true;
204  }
205  else if (MsgStartStop::match(message))
206  {
207  MsgStartStop& cmd = (MsgStartStop&) message;
208  qDebug() << "PlutoSDROutput::handleMessage: MsgStartStop: " << (cmd.getStartStop() ? "start" : "stop");
209 
210  if (cmd.getStartStop())
211  {
213  {
215  }
216  }
217  else
218  {
220  }
221 
223  webapiReverseSendStartStop(cmd.getStartStop());
224  }
225 
226  return true;
227  }
228  else
229  {
230  return false;
231  }
232 }
qint32 m_LOppmTenths
XO correction.
void webapiReverseSendStartStop(bool start)
bool startDeviceEngine()
Start the device engine corresponding to the stream type.
Definition: deviceapi.cpp:253
void stopDeviceEngine()
Stop the device engine corresponding to the stream type.
Definition: deviceapi.cpp:266
bool initDeviceEngine()
Init the device engine corresponding to the stream type.
Definition: deviceapi.cpp:240
bool m_lpfFIREnable
enable digital lowpass FIR filter
static bool match(const Message *message)
Definition: message.cpp:45
quint32 m_lpfFIRlog2Interp
digital lowpass FIR filter log2 of interpolation factor (0..2)
bool applySettings(const PlutoSDROutputSettings &settings, bool force=false)
quint64 m_devSampleRate
Host interface sample rate.
DeviceAPI * m_deviceAPI
quint32 m_lpfFIRBW
digital lowpass FIR filter bandwidth (Hz)
PlutoSDROutputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init()

void PlutoSDROutput::init ( )
virtual

initializations to be done when all collaborating objects are created and possibly connected

Implements DeviceSampleSink.

Definition at line 80 of file plutosdroutput.cpp.

References applySettings(), and m_settings.

Referenced by PlutoSDROutput::MsgStartStop::MsgStartStop().

81 {
83 }
bool applySettings(const PlutoSDROutputSettings &settings, bool force=false)
PlutoSDROutputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ networkManagerFinished

void PlutoSDROutput::networkManagerFinished ( QNetworkReply *  reply)
privateslot

Definition at line 886 of file plutosdroutput.cpp.

Referenced by ~PlutoSDROutput().

887 {
888  QNetworkReply::NetworkError replyError = reply->error();
889 
890  if (replyError)
891  {
892  qWarning() << "PlutoSDROutput::networkManagerFinished:"
893  << " error(" << (int) replyError
894  << "): " << replyError
895  << ": " << reply->errorString();
896  return;
897  }
898 
899  QString answer = reply->readAll();
900  answer.chop(1); // remove last \n
901  qDebug("PlutoSDROutput::networkManagerFinished: reply:\n%s", answer.toStdString().c_str());
902 }
+ Here is the caller graph for this function:

◆ openDevice()

bool PlutoSDROutput::openDevice ( )
private

Definition at line 234 of file plutosdroutput.cpp.

References DevicePlutoSDRBox::createTxBuffer(), DevicePlutoSDRParams::getBox(), DeviceAPI::getBuddySharedPtr(), DeviceAPI::getSamplingDeviceSerial(), DeviceAPI::getSourceBuddies(), m_deviceAPI, DevicePlutoSDRShared::m_deviceParams, m_deviceShared, m_plutoTxBuffer, DeviceSampleSink::m_sampleSourceFifo, DevicePlutoSDRParams::open(), DevicePlutoSDRBox::openTx(), PLUTOSDR_BLOCKSIZE_SAMPLES, SampleSourceFifo::resize(), and DeviceAPI::setBuddySharedPtr().

235 {
237 
238  // look for Rx buddy and get reference to common parameters
239  if (m_deviceAPI->getSourceBuddies().size() > 0) // then sink
240  {
241  qDebug("PlutoSDROutput::openDevice: look at Rx buddy");
242 
243  DeviceAPI *sourceBuddy = m_deviceAPI->getSourceBuddies()[0];
244  DevicePlutoSDRShared* buddySharedPtr = (DevicePlutoSDRShared*) sourceBuddy->getBuddySharedPtr();
245  m_deviceShared.m_deviceParams = buddySharedPtr->m_deviceParams;
246 
248  {
249  qCritical("PlutoSDROutput::openDevice: cannot get device parameters from Rx buddy");
250  return false; // the device params should have been created by the buddy
251  }
252  else
253  {
254  qDebug("PlutoSDROutput::openDevice: getting device parameters from Rx buddy");
255  }
256  }
257  // There is no buddy then create the first PlutoSDR common parameters
258  // open the device this will also populate common fields
259  else
260  {
261  qDebug("PlutoSDROutput::openDevice: open device here");
262 
264  char serial[256];
265  strcpy(serial, qPrintable(m_deviceAPI->getSamplingDeviceSerial()));
267  }
268 
269  m_deviceAPI->setBuddySharedPtr(&m_deviceShared); // propagate common parameters to API
270 
271  // acquire the channel
273  plutoBox->openTx();
274  m_plutoTxBuffer = plutoBox->createTxBuffer(PLUTOSDR_BLOCKSIZE_SAMPLES, false); // PlutoSDR buffer size is counted in number of (I,Q) samples
275 
276  return true;
277 }
struct iio_buffer * m_plutoTxBuffer
DevicePlutoSDRParams * m_deviceParams
unique hardware device parameters
bool open(const std::string &serial)
void * getBuddySharedPtr() const
Definition: deviceapi.h:161
void setBuddySharedPtr(void *ptr)
Definition: deviceapi.h:162
DevicePlutoSDRShared m_deviceShared
struct iio_buffer * createTxBuffer(unsigned int size, bool cyclic)
DevicePlutoSDRBox * getBox()
void resize(uint32_t size)
const QString & getSamplingDeviceSerial() const
Definition: deviceapi.h:121
SampleSourceFifo m_sampleSourceFifo
const std::vector< DeviceAPI * > & getSourceBuddies() const
Definition: deviceapi.h:165
DeviceAPI * m_deviceAPI
#define PLUTOSDR_BLOCKSIZE_SAMPLES
+ Here is the call graph for this function:

◆ resumeBuddies()

void PlutoSDROutput::resumeBuddies ( )
private

Definition at line 308 of file plutosdroutput.cpp.

References DeviceAPI::getBuddySharedPtr(), DeviceAPI::getSourceBuddies(), i, m_deviceAPI, DevicePlutoSDRShared::m_thread, and DevicePlutoSDRShared::ThreadInterface::startWork().

Referenced by ~PlutoSDROutput().

309 {
310  // resume Rx buddy's thread
311 
312  for (unsigned int i = 0; i < m_deviceAPI->getSourceBuddies().size(); i++)
313  {
315  DevicePlutoSDRShared *buddyShared = (DevicePlutoSDRShared *) buddy->getBuddySharedPtr();
316 
317  if (buddyShared->m_thread) {
318  buddyShared->m_thread->startWork();
319  }
320  }
321 }
ThreadInterface * m_thread
holds the thread address if started else 0
void * getBuddySharedPtr() const
Definition: deviceapi.h:161
int32_t i
Definition: decimators.h:244
const std::vector< DeviceAPI * > & getSourceBuddies() const
Definition: deviceapi.h:165
DeviceAPI * m_deviceAPI
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

QByteArray PlutoSDROutput::serialize ( ) const
virtual

Implements DeviceSampleSink.

Definition at line 122 of file plutosdroutput.cpp.

References m_settings, and PlutoSDROutputSettings::serialize().

Referenced by PlutoSDROutput::MsgStartStop::MsgStartStop().

123 {
124  return m_settings.serialize();
125 }
PlutoSDROutputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCenterFrequency()

void PlutoSDROutput::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements DeviceSampleSink.

Definition at line 163 of file plutosdroutput.cpp.

References PlutoSDROutput::MsgConfigurePlutoSDR::create(), PlutoSDROutputSettings::m_centerFrequency, DeviceSampleSink::m_guiMessageQueue, DeviceSampleSink::m_inputMessageQueue, m_settings, and MessageQueue::push().

Referenced by setSampleRate().

164 {
166  settings.m_centerFrequency = centerFrequency;
167 
168  MsgConfigurePlutoSDR* message = MsgConfigurePlutoSDR::create(settings, false);
169  m_inputMessageQueue.push(message);
170 
171  if (m_guiMessageQueue)
172  {
173  MsgConfigurePlutoSDR* messageToGUI = MsgConfigurePlutoSDR::create(settings, false);
174  m_guiMessageQueue->push(messageToGUI);
175  }
176 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue m_inputMessageQueue
Input queue to the sink.
static MsgConfigurePlutoSDR * create(const PlutoSDROutputSettings &settings, bool force)
MessageQueue * m_guiMessageQueue
Input message queue to the GUI.
PlutoSDROutputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMessageQueueToGUI()

virtual void PlutoSDROutput::setMessageQueueToGUI ( MessageQueue queue)
inlinevirtual

Implements DeviceSampleSink.

Definition at line 92 of file plutosdroutput.h.

References getDeviceDescription(), getSampleRate(), and DeviceSampleSink::m_guiMessageQueue.

92 { m_guiMessageQueue = queue; }
MessageQueue * m_guiMessageQueue
Input message queue to the GUI.
+ Here is the call graph for this function:

◆ setSampleRate()

virtual void PlutoSDROutput::setSampleRate ( int  sampleRate)
inlinevirtual

For when the sink sample rate is set externally.

Implements DeviceSampleSink.

Definition at line 95 of file plutosdroutput.h.

References getCenterFrequency(), handleMessage(), setCenterFrequency(), webapiReportGet(), webapiRun(), webapiRunGet(), webapiSettingsGet(), and webapiSettingsPutPatch().

95 { (void) sampleRate; }
+ Here is the call graph for this function:

◆ start()

bool PlutoSDROutput::start ( )
virtual

Implements DeviceSampleSink.

Definition at line 85 of file plutosdroutput.cpp.

References applySettings(), DevicePlutoSDRParams::getBox(), DevicePlutoSDRShared::m_deviceParams, m_deviceShared, PlutoSDROutputSettings::m_log2Interp, m_plutoSDROutputThread, m_running, DeviceSampleSink::m_sampleSourceFifo, m_settings, DevicePlutoSDRShared::m_thread, PLUTOSDR_BLOCKSIZE_SAMPLES, PlutoSDROutputThread::setLog2Interpolation(), PlutoSDROutputThread::startWork(), and stop().

Referenced by PlutoSDROutput::MsgStartStop::MsgStartStop().

86 {
88  return false;
89  }
90 
91  if (m_running) stop();
92 
93  // start / stop streaming is done in the thread.
94 
96  qDebug("PlutoSDROutput::start: thread created");
97 
99 
102 
104  m_running = true;
105 
106  return true;
107 }
ThreadInterface * m_thread
holds the thread address if started else 0
DevicePlutoSDRParams * m_deviceParams
unique hardware device parameters
PlutoSDROutputThread * m_plutoSDROutputThread
DevicePlutoSDRShared m_deviceShared
virtual void stop()
DevicePlutoSDRBox * getBox()
bool applySettings(const PlutoSDROutputSettings &settings, bool force=false)
SampleSourceFifo m_sampleSourceFifo
#define PLUTOSDR_BLOCKSIZE_SAMPLES
PlutoSDROutputSettings m_settings
void setLog2Interpolation(unsigned int log2_interp)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stop()

void PlutoSDROutput::stop ( )
virtual

Implements DeviceSampleSink.

Definition at line 109 of file plutosdroutput.cpp.

References m_deviceShared, m_plutoSDROutputThread, m_running, DevicePlutoSDRShared::m_thread, and PlutoSDROutputThread::stopWork().

Referenced by PlutoSDROutput::MsgStartStop::MsgStartStop(), and start().

110 {
111  if (m_plutoSDROutputThread != 0)
112  {
114  delete m_plutoSDROutputThread;
116  }
117 
119  m_running = false;
120 }
ThreadInterface * m_thread
holds the thread address if started else 0
PlutoSDROutputThread * m_plutoSDROutputThread
DevicePlutoSDRShared m_deviceShared
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ suspendBuddies()

void PlutoSDROutput::suspendBuddies ( )
private

Definition at line 293 of file plutosdroutput.cpp.

References DeviceAPI::getBuddySharedPtr(), DeviceAPI::getSourceBuddies(), i, m_deviceAPI, DevicePlutoSDRShared::m_thread, and DevicePlutoSDRShared::ThreadInterface::stopWork().

Referenced by ~PlutoSDROutput().

294 {
295  // suspend Rx buddy's thread
296 
297  for (unsigned int i = 0; i < m_deviceAPI->getSourceBuddies().size(); i++)
298  {
300  DevicePlutoSDRShared *buddyShared = (DevicePlutoSDRShared *) buddy->getBuddySharedPtr();
301 
302  if (buddyShared->m_thread) {
303  buddyShared->m_thread->stopWork();
304  }
305  }
306 }
ThreadInterface * m_thread
holds the thread address if started else 0
void * getBuddySharedPtr() const
Definition: deviceapi.h:161
int32_t i
Definition: decimators.h:244
const std::vector< DeviceAPI * > & getSourceBuddies() const
Definition: deviceapi.h:165
DeviceAPI * m_deviceAPI
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiFormatDeviceReport()

void PlutoSDROutput::webapiFormatDeviceReport ( SWGSDRangel::SWGDeviceReport response)
private

Definition at line 779 of file plutosdroutput.cpp.

References fetchTemperature(), getDACSampleRate(), SWGSDRangel::SWGDeviceReport::getPlutoSdrOutputReport(), getRSSI(), getTemperature(), SWGSDRangel::SWGPlutoSdrOutputReport::setDacRate(), SWGSDRangel::SWGPlutoSdrOutputReport::setRssi(), and SWGSDRangel::SWGPlutoSdrOutputReport::setTemperature().

Referenced by webapiReportGet().

780 {
782  std::string rssiStr;
783  getRSSI(rssiStr);
784  response.getPlutoSdrOutputReport()->setRssi(new QString(rssiStr.c_str()));
787 }
void getRSSI(std::string &rssiStr)
SWGPlutoSdrOutputReport * getPlutoSdrOutputReport()
uint32_t getDACSampleRate() const
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiFormatDeviceSettings()

void PlutoSDROutput::webapiFormatDeviceSettings ( SWGSDRangel::SWGDeviceSettings response,
const PlutoSDROutputSettings settings 
)
private

Definition at line 752 of file plutosdroutput.cpp.

References SWGSDRangel::SWGDeviceSettings::getPlutoSdrOutputSettings(), SWGSDRangel::SWGPlutoSdrOutputSettings::getReverseApiAddress(), PlutoSDROutputSettings::m_antennaPath, PlutoSDROutputSettings::m_att, PlutoSDROutputSettings::m_centerFrequency, PlutoSDROutputSettings::m_devSampleRate, PlutoSDROutputSettings::m_log2Interp, PlutoSDROutputSettings::m_LOppmTenths, PlutoSDROutputSettings::m_lpfBW, PlutoSDROutputSettings::m_lpfFIRBW, PlutoSDROutputSettings::m_lpfFIREnable, PlutoSDROutputSettings::m_lpfFIRGain, PlutoSDROutputSettings::m_lpfFIRlog2Interp, PlutoSDROutputSettings::m_reverseAPIAddress, PlutoSDROutputSettings::m_reverseAPIDeviceIndex, PlutoSDROutputSettings::m_reverseAPIPort, PlutoSDROutputSettings::m_transverterDeltaFrequency, PlutoSDROutputSettings::m_transverterMode, PlutoSDROutputSettings::m_useReverseAPI, SWGSDRangel::SWGPlutoSdrOutputSettings::setAntennaPath(), SWGSDRangel::SWGPlutoSdrOutputSettings::setAtt(), SWGSDRangel::SWGPlutoSdrOutputSettings::setCenterFrequency(), SWGSDRangel::SWGPlutoSdrOutputSettings::setDevSampleRate(), SWGSDRangel::SWGPlutoSdrOutputSettings::setLog2Interp(), SWGSDRangel::SWGPlutoSdrOutputSettings::setLOppmTenths(), SWGSDRangel::SWGPlutoSdrOutputSettings::setLpfBw(), SWGSDRangel::SWGPlutoSdrOutputSettings::setLpfFirbw(), SWGSDRangel::SWGPlutoSdrOutputSettings::setLpfFirEnable(), SWGSDRangel::SWGPlutoSdrOutputSettings::setLpfFirGain(), SWGSDRangel::SWGPlutoSdrOutputSettings::setLpfFiRlog2Interp(), SWGSDRangel::SWGPlutoSdrOutputSettings::setReverseApiAddress(), SWGSDRangel::SWGPlutoSdrOutputSettings::setReverseApiDeviceIndex(), SWGSDRangel::SWGPlutoSdrOutputSettings::setReverseApiPort(), SWGSDRangel::SWGPlutoSdrOutputSettings::setTransverterDeltaFrequency(), SWGSDRangel::SWGPlutoSdrOutputSettings::setTransverterMode(), and SWGSDRangel::SWGPlutoSdrOutputSettings::setUseReverseApi().

Referenced by webapiSettingsGet(), and webapiSettingsPutPatch().

753 {
757  response.getPlutoSdrOutputSettings()->setLpfFirEnable(settings.m_lpfFIREnable ? 1 : 0);
758  response.getPlutoSdrOutputSettings()->setLpfFirbw(settings.m_lpfFIRBW);
762  response.getPlutoSdrOutputSettings()->setLpfBw(settings.m_lpfBW);
763  response.getPlutoSdrOutputSettings()->setAtt(settings.m_att);
764  response.getPlutoSdrOutputSettings()->setAntennaPath((int) settings.m_antennaPath);
766  response.getPlutoSdrOutputSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
767  response.getPlutoSdrOutputSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
768 
771  } else {
772  response.getPlutoSdrOutputSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
773  }
774 
777 }
qint32 m_LOppmTenths
XO correction.
void setReverseApiAddress(QString *reverse_api_address)
SWGPlutoSdrOutputSettings * getPlutoSdrOutputSettings()
qint32 m_att
"hardware" attenuation in dB fourths
void setLpfFiRlog2Interp(qint32 lpf_fi_rlog2_interp)
quint32 m_lpfBW
analog lowpass filter bandwidth (Hz)
bool m_lpfFIREnable
enable digital lowpass FIR filter
quint32 m_lpfFIRlog2Interp
digital lowpass FIR filter log2 of interpolation factor (0..2)
void setTransverterDeltaFrequency(qint64 transverter_delta_frequency)
quint64 m_devSampleRate
Host interface sample rate.
void setReverseApiDeviceIndex(qint32 reverse_api_device_index)
int m_lpfFIRGain
digital lowpass FIR filter gain (dB)
quint32 m_lpfFIRBW
digital lowpass FIR filter bandwidth (Hz)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiReportGet()

int PlutoSDROutput::webapiReportGet ( SWGSDRangel::SWGDeviceReport response,
QString &  errorMessage 
)
virtual

Reimplemented from DeviceSampleSink.

Definition at line 741 of file plutosdroutput.cpp.

References SWGSDRangel::SWGDeviceReport::getPlutoSdrOutputReport(), SWGSDRangel::SWGPlutoSdrOutputReport::init(), SWGSDRangel::SWGDeviceReport::setPlutoSdrOutputReport(), and webapiFormatDeviceReport().

Referenced by setSampleRate().

744 {
745  (void) errorMessage;
747  response.getPlutoSdrOutputReport()->init();
748  webapiFormatDeviceReport(response);
749  return 200;
750 }
SWGPlutoSdrOutputReport * getPlutoSdrOutputReport()
void setPlutoSdrOutputReport(SWGPlutoSdrOutputReport *pluto_sdr_output_report)
void webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport &response)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiReverseSendSettings()

void PlutoSDROutput::webapiReverseSendSettings ( QList< QString > &  deviceSettingsKeys,
const PlutoSDROutputSettings settings,
bool  force 
)
private

Definition at line 789 of file plutosdroutput.cpp.

References SWGSDRangel::SWGDeviceSettings::asJson(), DeviceAPI::getDeviceSetIndex(), SWGSDRangel::SWGDeviceSettings::getPlutoSdrOutputSettings(), PlutoSDROutputSettings::m_antennaPath, PlutoSDROutputSettings::m_att, PlutoSDROutputSettings::m_centerFrequency, m_deviceAPI, PlutoSDROutputSettings::m_devSampleRate, PlutoSDROutputSettings::m_log2Interp, PlutoSDROutputSettings::m_LOppmTenths, PlutoSDROutputSettings::m_lpfBW, PlutoSDROutputSettings::m_lpfFIRBW, PlutoSDROutputSettings::m_lpfFIREnable, PlutoSDROutputSettings::m_lpfFIRGain, PlutoSDROutputSettings::m_lpfFIRlog2Interp, m_networkManager, m_networkRequest, PlutoSDROutputSettings::m_reverseAPIAddress, PlutoSDROutputSettings::m_reverseAPIDeviceIndex, PlutoSDROutputSettings::m_reverseAPIPort, PlutoSDROutputSettings::m_transverterDeltaFrequency, PlutoSDROutputSettings::m_transverterMode, SWGSDRangel::SWGPlutoSdrOutputSettings::setAntennaPath(), SWGSDRangel::SWGPlutoSdrOutputSettings::setAtt(), SWGSDRangel::SWGPlutoSdrOutputSettings::setCenterFrequency(), SWGSDRangel::SWGDeviceSettings::setDeviceHwType(), SWGSDRangel::SWGPlutoSdrOutputSettings::setDevSampleRate(), SWGSDRangel::SWGDeviceSettings::setDirection(), SWGSDRangel::SWGPlutoSdrOutputSettings::setLog2Interp(), SWGSDRangel::SWGPlutoSdrOutputSettings::setLOppmTenths(), SWGSDRangel::SWGPlutoSdrOutputSettings::setLpfBw(), SWGSDRangel::SWGPlutoSdrOutputSettings::setLpfFirbw(), SWGSDRangel::SWGPlutoSdrOutputSettings::setLpfFirEnable(), SWGSDRangel::SWGPlutoSdrOutputSettings::setLpfFirGain(), SWGSDRangel::SWGPlutoSdrOutputSettings::setLpfFiRlog2Interp(), SWGSDRangel::SWGDeviceSettings::setOriginatorIndex(), SWGSDRangel::SWGDeviceSettings::setPlutoSdrOutputSettings(), SWGSDRangel::SWGPlutoSdrOutputSettings::setTransverterDeltaFrequency(), and SWGSDRangel::SWGPlutoSdrOutputSettings::setTransverterMode().

Referenced by applySettings().

790 {
792  swgDeviceSettings->setDirection(1); // single Tx
793  swgDeviceSettings->setOriginatorIndex(m_deviceAPI->getDeviceSetIndex());
794  swgDeviceSettings->setDeviceHwType(new QString("PlutoSDR"));
796  SWGSDRangel::SWGPlutoSdrOutputSettings *swgPlutoSdrOutputSettings = swgDeviceSettings->getPlutoSdrOutputSettings();
797 
798  // transfer data that has been modified. When force is on transfer all data except reverse API data
799 
800  if (deviceSettingsKeys.contains("centerFrequency") || force) {
801  swgPlutoSdrOutputSettings->setCenterFrequency(settings.m_centerFrequency);
802  }
803  if (deviceSettingsKeys.contains("devSampleRate") || force) {
804  swgPlutoSdrOutputSettings->setDevSampleRate(settings.m_devSampleRate);
805  }
806  if (deviceSettingsKeys.contains("LOppmTenths") || force) {
807  swgPlutoSdrOutputSettings->setLOppmTenths(settings.m_LOppmTenths);
808  }
809  if (deviceSettingsKeys.contains("lpfFIREnable") || force) {
810  swgPlutoSdrOutputSettings->setLpfFirEnable(settings.m_lpfFIREnable ? 1 : 0);
811  }
812  if (deviceSettingsKeys.contains("lpfFIRBW") || force) {
813  swgPlutoSdrOutputSettings->setLpfFirbw(settings.m_lpfFIRBW);
814  }
815  if (deviceSettingsKeys.contains("lpfFIRlog2Interp") || force) {
816  swgPlutoSdrOutputSettings->setLpfFiRlog2Interp(settings.m_lpfFIRlog2Interp);
817  }
818  if (deviceSettingsKeys.contains("lpfFIRGain") || force) {
819  swgPlutoSdrOutputSettings->setLpfFirGain(settings.m_lpfFIRGain);
820  }
821  if (deviceSettingsKeys.contains("log2Interp") || force) {
822  swgPlutoSdrOutputSettings->setLog2Interp(settings.m_log2Interp);
823  }
824  if (deviceSettingsKeys.contains("lpfBW") || force) {
825  swgPlutoSdrOutputSettings->setLpfBw(settings.m_lpfBW);
826  }
827  if (deviceSettingsKeys.contains("att") || force) {
828  swgPlutoSdrOutputSettings->setAtt(settings.m_att);
829  }
830  if (deviceSettingsKeys.contains("antennaPath") || force) {
831  swgPlutoSdrOutputSettings->setAntennaPath((int) settings.m_antennaPath);
832  }
833  if (deviceSettingsKeys.contains("transverterDeltaFrequency") || force) {
834  swgPlutoSdrOutputSettings->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
835  }
836  if (deviceSettingsKeys.contains("transverterMode") || force) {
837  swgPlutoSdrOutputSettings->setTransverterMode(settings.m_transverterMode ? 1 : 0);
838  }
839 
840  QString deviceSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/device/settings")
841  .arg(settings.m_reverseAPIAddress)
842  .arg(settings.m_reverseAPIPort)
843  .arg(settings.m_reverseAPIDeviceIndex);
844  m_networkRequest.setUrl(QUrl(deviceSettingsURL));
845  m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
846 
847  QBuffer *buffer=new QBuffer();
848  buffer->open((QBuffer::ReadWrite));
849  buffer->write(swgDeviceSettings->asJson().toUtf8());
850  buffer->seek(0);
851 
852  // Always use PATCH to avoid passing reverse API settings
853  m_networkManager->sendCustomRequest(m_networkRequest, "PATCH", buffer);
854 
855  delete swgDeviceSettings;
856 }
qint32 m_LOppmTenths
XO correction.
void setPlutoSdrOutputSettings(SWGPlutoSdrOutputSettings *pluto_sdr_output_settings)
virtual QString asJson() override
SWGPlutoSdrOutputSettings * getPlutoSdrOutputSettings()
qint32 m_att
"hardware" attenuation in dB fourths
void setLpfFiRlog2Interp(qint32 lpf_fi_rlog2_interp)
void setOriginatorIndex(qint32 originator_index)
int getDeviceSetIndex() const
Definition: deviceapi.h:131
quint32 m_lpfBW
analog lowpass filter bandwidth (Hz)
bool m_lpfFIREnable
enable digital lowpass FIR filter
QNetworkRequest m_networkRequest
quint32 m_lpfFIRlog2Interp
digital lowpass FIR filter log2 of interpolation factor (0..2)
void setTransverterDeltaFrequency(qint64 transverter_delta_frequency)
quint64 m_devSampleRate
Host interface sample rate.
QNetworkAccessManager * m_networkManager
DeviceAPI * m_deviceAPI
void setDirection(qint32 direction)
int m_lpfFIRGain
digital lowpass FIR filter gain (dB)
quint32 m_lpfFIRBW
digital lowpass FIR filter bandwidth (Hz)
void setDeviceHwType(QString *device_hw_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiReverseSendStartStop()

void PlutoSDROutput::webapiReverseSendStartStop ( bool  start)
private

Definition at line 858 of file plutosdroutput.cpp.

References SWGSDRangel::SWGDeviceSettings::asJson(), DeviceAPI::getDeviceSetIndex(), m_deviceAPI, m_networkManager, m_networkRequest, PlutoSDROutputSettings::m_reverseAPIAddress, PlutoSDROutputSettings::m_reverseAPIDeviceIndex, PlutoSDROutputSettings::m_reverseAPIPort, m_settings, SWGSDRangel::SWGDeviceSettings::setDeviceHwType(), SWGSDRangel::SWGDeviceSettings::setDirection(), and SWGSDRangel::SWGDeviceSettings::setOriginatorIndex().

Referenced by handleMessage().

859 {
861  swgDeviceSettings->setDirection(1); // single Tx
862  swgDeviceSettings->setOriginatorIndex(m_deviceAPI->getDeviceSetIndex());
863  swgDeviceSettings->setDeviceHwType(new QString("PlutoSDR"));
864 
865  QString deviceSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/device/run")
869  m_networkRequest.setUrl(QUrl(deviceSettingsURL));
870  m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
871 
872  QBuffer *buffer=new QBuffer();
873  buffer->open((QBuffer::ReadWrite));
874  buffer->write(swgDeviceSettings->asJson().toUtf8());
875  buffer->seek(0);
876 
877  if (start) {
878  m_networkManager->sendCustomRequest(m_networkRequest, "POST", buffer);
879  } else {
880  m_networkManager->sendCustomRequest(m_networkRequest, "DELETE", buffer);
881  }
882 
883  delete swgDeviceSettings;
884 }
virtual QString asJson() override
void setOriginatorIndex(qint32 originator_index)
int getDeviceSetIndex() const
Definition: deviceapi.h:131
QNetworkRequest m_networkRequest
QNetworkAccessManager * m_networkManager
virtual bool start()
DeviceAPI * m_deviceAPI
void setDirection(qint32 direction)
PlutoSDROutputSettings m_settings
void setDeviceHwType(QString *device_hw_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiRun()

int PlutoSDROutput::webapiRun ( bool  run,
SWGSDRangel::SWGDeviceState response,
QString &  errorMessage 
)
virtual

Reimplemented from DeviceSampleSink.

Definition at line 635 of file plutosdroutput.cpp.

References PlutoSDROutput::MsgStartStop::create(), DeviceAPI::getDeviceEngineStateStr(), SWGSDRangel::SWGDeviceState::getState(), m_deviceAPI, DeviceSampleSink::m_guiMessageQueue, DeviceSampleSink::m_inputMessageQueue, and MessageQueue::push().

Referenced by setSampleRate().

639 {
640  (void) errorMessage;
642  MsgStartStop *message = MsgStartStop::create(run);
643  m_inputMessageQueue.push(message);
644 
645  if (m_guiMessageQueue)
646  {
647  MsgStartStop *messagetoGui = MsgStartStop::create(run);
648  m_guiMessageQueue->push(messagetoGui);
649  }
650 
651  return 200;
652 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue m_inputMessageQueue
Input queue to the sink.
void getDeviceEngineStateStr(QString &state)
Definition: deviceapi.cpp:389
DeviceAPI * m_deviceAPI
static MsgStartStop * create(bool startStop)
MessageQueue * m_guiMessageQueue
Input message queue to the GUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiRunGet()

int PlutoSDROutput::webapiRunGet ( SWGSDRangel::SWGDeviceState response,
QString &  errorMessage 
)
virtual

Reimplemented from DeviceSampleSink.

Definition at line 626 of file plutosdroutput.cpp.

References DeviceAPI::getDeviceEngineStateStr(), SWGSDRangel::SWGDeviceState::getState(), and m_deviceAPI.

Referenced by setSampleRate().

629 {
630  (void) errorMessage;
632  return 200;
633 }
void getDeviceEngineStateStr(QString &state)
Definition: deviceapi.cpp:389
DeviceAPI * m_deviceAPI
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiSettingsGet()

int PlutoSDROutput::webapiSettingsGet ( SWGSDRangel::SWGDeviceSettings response,
QString &  errorMessage 
)
virtual

Reimplemented from DeviceSampleSink.

Definition at line 654 of file plutosdroutput.cpp.

References SWGSDRangel::SWGDeviceSettings::getPlutoSdrOutputSettings(), SWGSDRangel::SWGPlutoSdrOutputSettings::init(), m_settings, SWGSDRangel::SWGDeviceSettings::setPlutoSdrOutputSettings(), and webapiFormatDeviceSettings().

Referenced by setSampleRate().

657 {
658  (void) errorMessage;
660  response.getPlutoSdrOutputSettings()->init();
662  return 200;
663 }
void setPlutoSdrOutputSettings(SWGPlutoSdrOutputSettings *pluto_sdr_output_settings)
SWGPlutoSdrOutputSettings * getPlutoSdrOutputSettings()
void webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings &response, const PlutoSDROutputSettings &settings)
PlutoSDROutputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiSettingsPutPatch()

int PlutoSDROutput::webapiSettingsPutPatch ( bool  force,
const QStringList &  deviceSettingsKeys,
SWGSDRangel::SWGDeviceSettings response,
QString &  errorMessage 
)
virtual

Reimplemented from DeviceSampleSink.

Definition at line 665 of file plutosdroutput.cpp.

References PlutoSDROutput::MsgConfigurePlutoSDR::create(), SWGSDRangel::SWGPlutoSdrOutputSettings::getAntennaPath(), SWGSDRangel::SWGPlutoSdrOutputSettings::getAtt(), SWGSDRangel::SWGPlutoSdrOutputSettings::getCenterFrequency(), SWGSDRangel::SWGPlutoSdrOutputSettings::getDevSampleRate(), SWGSDRangel::SWGPlutoSdrOutputSettings::getLog2Interp(), SWGSDRangel::SWGPlutoSdrOutputSettings::getLOppmTenths(), SWGSDRangel::SWGPlutoSdrOutputSettings::getLpfBw(), SWGSDRangel::SWGPlutoSdrOutputSettings::getLpfFirbw(), SWGSDRangel::SWGPlutoSdrOutputSettings::getLpfFirEnable(), SWGSDRangel::SWGPlutoSdrOutputSettings::getLpfFirGain(), SWGSDRangel::SWGPlutoSdrOutputSettings::getLpfFiRlog2Interp(), SWGSDRangel::SWGDeviceSettings::getPlutoSdrOutputSettings(), SWGSDRangel::SWGPlutoSdrOutputSettings::getReverseApiAddress(), SWGSDRangel::SWGPlutoSdrOutputSettings::getReverseApiDeviceIndex(), SWGSDRangel::SWGPlutoSdrOutputSettings::getReverseApiPort(), SWGSDRangel::SWGPlutoSdrOutputSettings::getTransverterDeltaFrequency(), SWGSDRangel::SWGPlutoSdrOutputSettings::getTransverterMode(), SWGSDRangel::SWGPlutoSdrOutputSettings::getUseReverseApi(), PlutoSDROutputSettings::m_antennaPath, PlutoSDROutputSettings::m_att, PlutoSDROutputSettings::m_centerFrequency, PlutoSDROutputSettings::m_devSampleRate, DeviceSampleSink::m_guiMessageQueue, DeviceSampleSink::m_inputMessageQueue, PlutoSDROutputSettings::m_log2Interp, PlutoSDROutputSettings::m_LOppmTenths, PlutoSDROutputSettings::m_lpfBW, PlutoSDROutputSettings::m_lpfFIRBW, PlutoSDROutputSettings::m_lpfFIREnable, PlutoSDROutputSettings::m_lpfFIRGain, PlutoSDROutputSettings::m_lpfFIRlog2Interp, PlutoSDROutputSettings::m_reverseAPIAddress, PlutoSDROutputSettings::m_reverseAPIDeviceIndex, PlutoSDROutputSettings::m_reverseAPIPort, m_settings, PlutoSDROutputSettings::m_transverterDeltaFrequency, PlutoSDROutputSettings::m_transverterMode, PlutoSDROutputSettings::m_useReverseAPI, MessageQueue::push(), PlutoSDROutputSettings::RFPATH_END, and webapiFormatDeviceSettings().

Referenced by setSampleRate().

670 {
671  (void) errorMessage;
673 
674  if (deviceSettingsKeys.contains("centerFrequency")) {
676  }
677  if (deviceSettingsKeys.contains("devSampleRate")) {
679  }
680  if (deviceSettingsKeys.contains("LOppmTenths")) {
681  settings.m_LOppmTenths = response.getPlutoSdrOutputSettings()->getLOppmTenths();
682  }
683  if (deviceSettingsKeys.contains("lpfFIREnable")) {
684  settings.m_lpfFIREnable = response.getPlutoSdrOutputSettings()->getLpfFirEnable() != 0;
685  }
686  if (deviceSettingsKeys.contains("lpfFIRBW")) {
687  settings.m_lpfFIRBW = response.getPlutoSdrOutputSettings()->getLpfFirbw();
688  }
689  if (deviceSettingsKeys.contains("lpfFIRlog2Interp")) {
691  }
692  if (deviceSettingsKeys.contains("lpfFIRGain")) {
693  settings.m_lpfFIRGain = response.getPlutoSdrOutputSettings()->getLpfFirGain();
694  }
695  if (deviceSettingsKeys.contains("log2Interp")) {
696  settings.m_log2Interp = response.getPlutoSdrOutputSettings()->getLog2Interp();
697  }
698  if (deviceSettingsKeys.contains("lpfBW")) {
699  settings.m_lpfBW = response.getPlutoSdrOutputSettings()->getLpfBw();
700  }
701  if (deviceSettingsKeys.contains("att")) {
702  settings.m_att = response.getPlutoSdrOutputSettings()->getAtt();
703  }
704  if (deviceSettingsKeys.contains("antennaPath")) {
705  int antennaPath = response.getPlutoSdrOutputSettings()->getAntennaPath();
706  antennaPath = antennaPath < 0 ? 0 : antennaPath >= PlutoSDROutputSettings::RFPATH_END ? PlutoSDROutputSettings::RFPATH_END-1 : antennaPath;
707  settings.m_antennaPath = (PlutoSDROutputSettings::RFPath) antennaPath;
708  }
709  if (deviceSettingsKeys.contains("transverterDeltaFrequency")) {
711  }
712  if (deviceSettingsKeys.contains("transverterMode")) {
713  settings.m_transverterMode = response.getPlutoSdrOutputSettings()->getTransverterMode() != 0;
714  }
715  if (deviceSettingsKeys.contains("useReverseAPI")) {
716  settings.m_useReverseAPI = response.getPlutoSdrOutputSettings()->getUseReverseApi() != 0;
717  }
718  if (deviceSettingsKeys.contains("reverseAPIAddress")) {
720  }
721  if (deviceSettingsKeys.contains("reverseAPIPort")) {
723  }
724  if (deviceSettingsKeys.contains("reverseAPIDeviceIndex")) {
726  }
727 
728  MsgConfigurePlutoSDR *msg = MsgConfigurePlutoSDR::create(settings, force);
730 
731  if (m_guiMessageQueue) // forward to GUI if any
732  {
733  MsgConfigurePlutoSDR *msgToGUI = MsgConfigurePlutoSDR::create(settings, force);
734  m_guiMessageQueue->push(msgToGUI);
735  }
736 
737  webapiFormatDeviceSettings(response, settings);
738  return 200;
739 }
qint32 m_LOppmTenths
XO correction.
void push(Message *message, bool emitSignal=true)
Push message onto queue.
SWGPlutoSdrOutputSettings * getPlutoSdrOutputSettings()
qint32 m_att
"hardware" attenuation in dB fourths
MessageQueue m_inputMessageQueue
Input queue to the sink.
quint32 m_lpfBW
analog lowpass filter bandwidth (Hz)
static MsgConfigurePlutoSDR * create(const PlutoSDROutputSettings &settings, bool force)
bool m_lpfFIREnable
enable digital lowpass FIR filter
quint32 m_lpfFIRlog2Interp
digital lowpass FIR filter log2 of interpolation factor (0..2)
quint64 m_devSampleRate
Host interface sample rate.
void webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings &response, const PlutoSDROutputSettings &settings)
int m_lpfFIRGain
digital lowpass FIR filter gain (dB)
quint32 m_lpfFIRBW
digital lowpass FIR filter bandwidth (Hz)
MessageQueue * m_guiMessageQueue
Input message queue to the GUI.
PlutoSDROutputSettings m_settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_deviceAPI

DeviceAPI* PlutoSDROutput::m_deviceAPI
private

◆ m_deviceDescription

QString PlutoSDROutput::m_deviceDescription
private

Definition at line 134 of file plutosdroutput.h.

Referenced by getDeviceDescription().

◆ m_deviceSampleRates

DevicePlutoSDRBox::SampleRates PlutoSDROutput::m_deviceSampleRates
private

Definition at line 140 of file plutosdroutput.h.

Referenced by applySettings(), getDACSampleRate(), and getFIRSampleRate().

◆ m_deviceShared

DevicePlutoSDRShared PlutoSDROutput::m_deviceShared
private

◆ m_mutex

QMutex PlutoSDROutput::m_mutex
private

Definition at line 141 of file plutosdroutput.h.

◆ m_networkManager

QNetworkAccessManager* PlutoSDROutput::m_networkManager
private

◆ m_networkRequest

QNetworkRequest PlutoSDROutput::m_networkRequest
private

Definition at line 143 of file plutosdroutput.h.

Referenced by webapiReverseSendSettings(), and webapiReverseSendStartStop().

◆ m_plutoSDROutputThread

PlutoSDROutputThread* PlutoSDROutput::m_plutoSDROutputThread
private

Definition at line 139 of file plutosdroutput.h.

Referenced by applySettings(), start(), and stop().

◆ m_plutoTxBuffer

struct iio_buffer* PlutoSDROutput::m_plutoTxBuffer
private

Definition at line 138 of file plutosdroutput.h.

Referenced by openDevice().

◆ m_running

bool PlutoSDROutput::m_running
private

Definition at line 136 of file plutosdroutput.h.

Referenced by start(), and stop().

◆ m_settings

PlutoSDROutputSettings PlutoSDROutput::m_settings
private

The documentation for this class was generated from the following files: