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.
fcdproinput.cpp
Go to the documentation of this file.
1 // Copyright (C) 2015-2018 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 <string.h>
19 #include <errno.h>
20 
21 #include <QDebug>
22 #include <QNetworkReply>
23 #include <QBuffer>
24 
25 #include "SWGDeviceSettings.h"
26 #include "SWGDeviceState.h"
27 
28 #include "dsp/dspcommands.h"
29 #include "dsp/dspengine.h"
30 #include "dsp/filerecord.h"
31 #include "device/deviceapi.h"
32 
33 #include "fcdproinput.h"
34 #include "fcdprothread.h"
35 #include "fcdtraits.h"
36 #include "fcdproconst.h"
37 
41 
43  m_deviceAPI(deviceAPI),
44  m_dev(0),
45  m_settings(),
46  m_FCDThread(0),
47  m_deviceDescription(fcd_traits<Pro>::displayedName),
48  m_running(false)
49 {
50  m_fcdFIFO.setSize(20*fcd_traits<Pro>::convBufSize);
51  openDevice();
52  m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
53  m_deviceAPI->setNbSourceStreams(1);
54  m_deviceAPI->addAncillarySink(m_fileSink);
55  m_networkManager = new QNetworkAccessManager();
56  connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
57 }
58 
60 {
61  disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
62  delete m_networkManager;
63 
64  if (m_running) {
65  stop();
66  }
67 
69  delete m_fileSink;
70 
71  closeDevice();
72 }
73 
75 {
76  delete this;
77 }
78 
80 {
81  if (m_dev != 0) {
82  closeDevice();
83  }
84 
85  int device = m_deviceAPI->getSamplingDeviceSequence();
86  qDebug() << "FCDProInput::openDevice with device #" << device;
88 
89  if (m_dev == 0)
90  {
91  qCritical("FCDProInput::start: could not open FCD");
92  return false;
93  }
94 
96  {
97  qCritical("FCDProInput::start: could not open FCD audio source");
98  return false;
99  }
100  else
101  {
102  qDebug("FCDProInput::start: FCD audio source opened");
103  }
104 
105  return true;
106 }
107 
109 {
110  applySettings(m_settings, true);
111 }
112 
114 {
115  qDebug() << "FCDProInput::start";
116 
117 // QMutexLocker mutexLocker(&m_mutex);
118 
119  if (!m_dev) {
120  return false;
121  }
122 
123  if (m_running) stop();
124 
125  /* Apply settings before streaming to avoid bus contention;
126  * there is very little spare bandwidth on a full speed USB device.
127  * Failure is harmless if no device is found
128  * ... This is rubbish...*/
129 
130  //applySettings(m_settings, true);
131 
132  if(!m_sampleFifo.setSize(96000*4))
133  {
134  qCritical("Could not allocate SampleFifo");
135  return false;
136  }
137 
140 
141 // mutexLocker.unlock();
142  applySettings(m_settings, true);
143 
144  qDebug("FCDProInput::started");
145  m_running = true;
146 
147  return true;
148 }
149 
151 {
152  if (m_dev == 0) { // was never open
153  return;
154  }
155 
156  fcdClose(m_dev);
157  m_dev = 0;
158 
159  closeFCDAudio();
160 }
161 
162 bool FCDProInput::openFCDAudio(const char* cardname)
163 {
165  const QList<QAudioDeviceInfo>& audioList = audioDeviceManager->getInputDevices();
166 
167  for (const auto &itAudio : audioList)
168  {
169  if (itAudio.deviceName().contains(QString(cardname)))
170  {
171  int fcdDeviceIndex = audioDeviceManager->getInputDeviceIndex(itAudio.deviceName());
173  int fcdSampleRate = m_fcdAudioInput.getRate();
174  qDebug("FCDProPlusInput::openFCDAudio: %s index %d at %d S/s",
175  itAudio.deviceName().toStdString().c_str(), fcdDeviceIndex, fcdSampleRate);
177  return true;
178  }
179  }
180 
181  qCritical("FCDProInput::openFCDAudio: device with name %s not found", cardname);
182  return false;
183 }
184 
186 {
189 }
190 
192 {
193 // QMutexLocker mutexLocker(&m_mutex);
194 
195  if (m_FCDThread)
196  {
198  // wait for thread to quit ?
199  delete m_FCDThread;
200  m_FCDThread = nullptr;
201  }
202 
203  m_running = false;
204 }
205 
206 QByteArray FCDProInput::serialize() const
207 {
208  return m_settings.serialize();
209 }
210 
211 bool FCDProInput::deserialize(const QByteArray& data)
212 {
213  bool success = true;
214 
215  if (!m_settings.deserialize(data))
216  {
218  success = false;
219  }
220 
222  m_inputMessageQueue.push(message);
223 
224  if (m_guiMessageQueue)
225  {
227  m_guiMessageQueue->push(messageToGUI);
228  }
229 
230  return success;
231 }
232 
233 const QString& FCDProInput::getDeviceDescription() const
234 {
235  return m_deviceDescription;
236 }
237 
239 {
241 }
242 
244 {
246 }
247 
248 void FCDProInput::setCenterFrequency(qint64 centerFrequency)
249 {
250  FCDProSettings settings = m_settings;
251  settings.m_centerFrequency = centerFrequency;
252 
253  MsgConfigureFCDPro* message = MsgConfigureFCDPro::create(settings, false);
254  m_inputMessageQueue.push(message);
255 
256  if (m_guiMessageQueue)
257  {
258  MsgConfigureFCDPro* messageToGUI = MsgConfigureFCDPro::create(settings, false);
259  m_guiMessageQueue->push(messageToGUI);
260  }
261 }
262 
264 {
265  if(MsgConfigureFCDPro::match(message))
266  {
267  qDebug() << "FCDProInput::handleMessage: MsgConfigureFCD";
268  MsgConfigureFCDPro& conf = (MsgConfigureFCDPro&) message;
269  applySettings(conf.getSettings(), conf.getForce());
270  return true;
271  }
272  else if (MsgStartStop::match(message))
273  {
274  MsgStartStop& cmd = (MsgStartStop&) message;
275  qDebug() << "FCDProInput::handleMessage: MsgStartStop: " << (cmd.getStartStop() ? "start" : "stop");
276 
277  if (cmd.getStartStop())
278  {
280  {
282  }
283  }
284  else
285  {
287  }
288 
291  }
292 
293  return true;
294  }
295  else if (MsgFileRecord::match(message))
296  {
297  MsgFileRecord& conf = (MsgFileRecord&) message;
298  qDebug() << "FCDProInput::handleMessage: MsgFileRecord: " << conf.getStartStop();
299 
300  if (conf.getStartStop())
301  {
302  if (m_settings.m_fileRecordName.size() != 0) {
304  } else {
306  }
307 
309  }
310  else
311  {
313  }
314 
315  return true;
316  }
317  else
318  {
319  return false;
320  }
321 }
322 
323 void FCDProInput::applySettings(const FCDProSettings& settings, bool force)
324 {
325  bool forwardChange = false;
326  QList<QString> reverseAPIKeys;
327 
328  if (force || (m_settings.m_centerFrequency != settings.m_centerFrequency)) {
329  reverseAPIKeys.append("centerFrequency");
330  }
331  if (force || (m_settings.m_transverterMode != settings.m_transverterMode)) {
332  reverseAPIKeys.append("transverterMode");
333  }
335  reverseAPIKeys.append("transverterDeltaFrequency");
336  }
337  if ((m_settings.m_LOppmTenths != settings.m_LOppmTenths) || force) {
338  reverseAPIKeys.append("LOppmTenths");
339  }
340 
341  if (force || (m_settings.m_centerFrequency != settings.m_centerFrequency)
342  || (m_settings.m_LOppmTenths != settings.m_LOppmTenths)
343  || (m_settings.m_fcPos != settings.m_fcPos)
344  || (m_settings.m_log2Decim != settings.m_log2Decim)
347  {
348  qint64 deviceCenterFrequency = DeviceSampleSource::calculateDeviceCenterFrequency(
349  settings.m_centerFrequency,
351  settings.m_log2Decim,
354  DeviceSampleSource::FrequencyShiftScheme::FSHIFT_STD,
355  settings.m_transverterMode);
356 
357  if (m_dev != 0)
358  {
359  set_center_freq((double) deviceCenterFrequency);
360  }
361 
362  qDebug() << "FCDProInput::applySettings: center freq: " << settings.m_centerFrequency << " Hz"
363  << " device center freq: " << deviceCenterFrequency << " Hz";
364 
365  forwardChange = (m_settings.m_centerFrequency != settings.m_centerFrequency) || force;
366 
368  }
369 
370  if ((m_settings.m_log2Decim != settings.m_log2Decim) || force)
371  {
372  reverseAPIKeys.append("log2Decim");
373  forwardChange = true;
374 
375  if (m_FCDThread != 0)
376  {
378  qDebug() << "FCDProInput::applySettings: set decimation to " << (1<<settings.m_log2Decim);
379  }
380  }
381 
382  if ((m_settings.m_fcPos != settings.m_fcPos) || force)
383  {
384  reverseAPIKeys.append("fcPos");
385 
386  if (m_FCDThread != 0) {
387  m_FCDThread->setFcPos((int) settings.m_fcPos);
388  }
389 
390  qDebug() << "FCDProInput::applySettings: set fc pos (enum) to " << (int) settings.m_fcPos;
391  }
392 
393  if ((m_settings.m_lnaGainIndex != settings.m_lnaGainIndex) || force)
394  {
395  reverseAPIKeys.append("lnaGainIndex");
396 
397  if (m_dev != 0) {
398  set_lnaGain(settings.m_lnaGainIndex);
399  }
400  }
401 
402  if ((m_settings.m_rfFilterIndex != settings.m_rfFilterIndex) || force)
403  {
404  reverseAPIKeys.append("rfFilterIndex");
405 
406  if (m_dev != 0) {
407  set_rfFilter(settings.m_rfFilterIndex);
408  }
409  }
410 
411  if ((m_settings.m_lnaEnhanceIndex != settings.m_lnaEnhanceIndex) || force)
412  {
413  reverseAPIKeys.append("lnaEnhanceIndex");
414 
415  if (m_dev != 0) {
417  }
418  }
419 
420  if ((m_settings.m_bandIndex != settings.m_bandIndex) || force)
421  {
422  reverseAPIKeys.append("bandIndex");
423 
424  if (m_dev != 0) {
425  set_band(settings.m_bandIndex);
426  }
427  }
428 
429  if ((m_settings.m_mixerGainIndex != settings.m_mixerGainIndex) || force)
430  {
431  reverseAPIKeys.append("mixerGainIndex");
432 
433  if (m_dev != 0) {
435  }
436  }
437 
438  if ((m_settings.m_mixerFilterIndex != settings.m_mixerFilterIndex) || force)
439  {
440  reverseAPIKeys.append("mixerFilterIndex");
441 
442  if (m_dev != 0) {
444  }
445  }
446 
447  if ((m_settings.m_biasCurrentIndex != settings.m_biasCurrentIndex) || force)
448  {
449  reverseAPIKeys.append("biasCurrentIndex");
450 
451  if (m_dev != 0) {
453  }
454  }
455 
456  if ((m_settings.m_modeIndex != settings.m_modeIndex) || force)
457  {
458  reverseAPIKeys.append("modeIndex");
459 
460  if (m_dev != 0) {
461  set_mode(settings.m_modeIndex);
462  }
463  }
464 
465  if ((m_settings.m_gain1Index != settings.m_gain1Index) || force)
466  {
467  reverseAPIKeys.append("gain1Index");
468 
469  if (m_dev != 0) {
470  set_gain1(settings.m_gain1Index);
471  }
472  }
473 
474  if ((m_settings.m_rcFilterIndex != settings.m_rcFilterIndex) || force)
475  {
476  reverseAPIKeys.append("rcFilterIndex");
477 
478  if (m_dev != 0) {
479  set_rcFilter(settings.m_rcFilterIndex);
480  }
481  }
482 
483  if ((m_settings.m_gain2Index != settings.m_gain2Index) || force)
484  {
485  reverseAPIKeys.append("gain2Index");
486 
487  if (m_dev != 0) {
488  set_gain2(settings.m_gain2Index);
489  }
490  }
491 
492  if ((m_settings.m_gain3Index != settings.m_gain3Index) || force)
493  {
494  reverseAPIKeys.append("gain3Index");
495 
496  if (m_dev != 0) {
497  set_gain3(settings.m_gain3Index);
498  }
499  }
500 
501  if ((m_settings.m_gain4Index != settings.m_gain4Index) || force)
502  {
503  reverseAPIKeys.append("gain4Index");
504 
505  if (m_dev != 0) {
506  set_gain4(settings.m_gain4Index);
507  }
508  }
509 
510  if ((m_settings.m_ifFilterIndex != settings.m_ifFilterIndex) || force)
511  {
512  reverseAPIKeys.append("ifFilterIndex");
513 
514  if (m_dev != 0) {
515  set_ifFilter(settings.m_ifFilterIndex);
516  }
517  }
518 
519  if ((m_settings.m_gain5Index != settings.m_gain5Index) || force)
520  {
521  reverseAPIKeys.append("gain5Index");
522 
523  if (m_dev != 0) {
524  set_gain5(settings.m_gain5Index);
525  }
526  }
527 
528  if ((m_settings.m_gain6Index != settings.m_gain6Index) || force)
529  {
530  reverseAPIKeys.append("gain6Index");
531 
532  if (m_dev != 0) {
533  set_gain6(settings.m_gain6Index);
534  }
535  }
536 
537  if ((m_settings.m_dcBlock != settings.m_dcBlock) || force)
538  {
539  reverseAPIKeys.append("dcBlock");
541  }
542 
543  if ((m_settings.m_iqCorrection != settings.m_iqCorrection) || force)
544  {
545  reverseAPIKeys.append("iqCorrection");
547  }
548 
549  if (settings.m_useReverseAPI)
550  {
551  bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) ||
555  webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force);
556  }
557 
558  m_settings = settings;
559 
560  if (forwardChange)
561  {
563  m_fileSink->handleMessage(*notif); // forward to file sink
565  }
566 }
567 
569 {
570  freq += freq*(((double) m_settings.m_LOppmTenths)/10000000.0);
571 
572  if (fcdAppSetFreq(m_dev, freq) == FCD_MODE_NONE)
573  {
574  qDebug("No FCD HID found for frquency change");
575  }
576 
577 }
578 
580 {
581  (void) on;
582  //quint8 cmd = on ? 1 : 0;
583 
584  // TODO: use FCD Pro controls
585  //fcdAppSetParam(m_dev, FCD_CMD_APP_SET_BIAS_TEE, &cmd, 1);
586 }
587 
589 {
590  if ((index < 0) || (index >= FCDProConstants::fcdpro_lna_gain_nb_values()))
591  {
592  return;
593  }
594 
595  quint8 cmd_value = FCDProConstants::lna_gains[index].value;
596 
598  {
599  qWarning() << "FCDProPlusInput::set_lnaGain: failed to set at " << cmd_value;
600  }
601 }
602 
604 {
605  if ((index < 0) || (index >= FCDProConstants::fcdpro_rf_filter_nb_values()))
606  {
607  return;
608  }
609 
610  quint8 cmd_value = FCDProConstants::rf_filters[index].value;
611 
613  {
614  qWarning() << "FCDProPlusInput::set_rfFilter: failed to set at " << cmd_value;
615  }
616 }
617 
619 {
620  if ((index < 0) || (index >= FCDProConstants::fcdpro_lna_enhance_nb_values()))
621  {
622  return;
623  }
624 
625  quint8 cmd_value = FCDProConstants::lna_enhances[index].value;
626 
628  {
629  qWarning() << "FCDProPlusInput::set_lnaEnhance: failed to set at " << cmd_value;
630  }
631 }
632 
633 void FCDProInput::set_band(int index)
634 {
635  if ((index < 0) || (index >= FCDProConstants::fcdpro_band_nb_values()))
636  {
637  return;
638  }
639 
640  quint8 cmd_value = FCDProConstants::bands[index].value;
641 
643  {
644  qWarning() << "FCDProPlusInput::set_band: failed to set at " << cmd_value;
645  }
646 }
647 
649 {
650  if ((index < 0) || (index >= FCDProConstants::fcdpro_mixer_gain_nb_values()))
651  {
652  return;
653  }
654 
655  quint8 cmd_value = FCDProConstants::mixer_gains[index].value;
656 
658  {
659  qWarning() << "FCDProPlusInput::set_mixerGain: failed to set at " << cmd_value;
660  }
661 }
662 
664 {
665  if ((index < 0) || (index >= FCDProConstants::fcdpro_mixer_filter_nb_values()))
666  {
667  return;
668  }
669 
670  quint8 cmd_value = FCDProConstants::mixer_filters[index].value;
671 
673  {
674  qWarning() << "FCDProPlusInput::set_mixerFilter: failed to set at " << cmd_value;
675  }
676 }
677 
679 {
680  if ((index < 0) || (index >= FCDProConstants::fcdpro_bias_current_nb_values()))
681  {
682  return;
683  }
684 
685  quint8 cmd_value = FCDProConstants::bias_currents[index].value;
686 
688  {
689  qWarning() << "FCDProPlusInput::set_biasCurrent: failed to set at " << cmd_value;
690  }
691 }
692 
693 void FCDProInput::set_mode(int index)
694 {
695  if ((index < 0) || (index >= FCDProConstants::fcdpro_if_gain_mode_nb_values()))
696  {
697  return;
698  }
699 
700  quint8 cmd_value = FCDProConstants::if_gain_modes[index].value;
701 
703  {
704  qWarning() << "FCDProPlusInput::set_mode: failed to set at " << cmd_value;
705  }
706 }
707 
708 void FCDProInput::set_gain1(int index)
709 {
710  if ((index < 0) || (index >= FCDProConstants::fcdpro_if_gain1_nb_values()))
711  {
712  return;
713  }
714 
715  quint8 cmd_value = FCDProConstants::if_gains1[index].value;
716 
718  {
719  qWarning() << "FCDProPlusInput::set_gain1: failed to set at " << cmd_value;
720  }
721 }
722 
724 {
725  if ((index < 0) || (index >= FCDProConstants::fcdpro_if_rc_filter_nb_values()))
726  {
727  return;
728  }
729 
730  quint8 cmd_value = FCDProConstants::if_rc_filters[index].value;
731 
733  {
734  qWarning() << "FCDProPlusInput::set_rcFilter: failed to set at " << cmd_value;
735  }
736 }
737 
738 void FCDProInput::set_gain2(int index)
739 {
740  if ((index < 0) || (index >= FCDProConstants::fcdpro_if_gain2_nb_values()))
741  {
742  return;
743  }
744 
745  quint8 cmd_value = FCDProConstants::if_gains2[index].value;
746 
748  {
749  qWarning() << "FCDProPlusInput::set_gain2: failed to set at " << cmd_value;
750  }
751 }
752 
753 void FCDProInput::set_gain3(int index)
754 {
755  if ((index < 0) || (index >= FCDProConstants::fcdpro_if_gain3_nb_values()))
756  {
757  return;
758  }
759 
760  quint8 cmd_value = FCDProConstants::if_gains3[index].value;
761 
763  {
764  qWarning() << "FCDProPlusInput::set_gain3: failed to set at " << cmd_value;
765  }
766 }
767 
768 void FCDProInput::set_gain4(int index)
769 {
770  if ((index < 0) || (index >= FCDProConstants::fcdpro_if_gain4_nb_values()))
771  {
772  return;
773  }
774 
775  quint8 cmd_value = FCDProConstants::if_gains4[index].value;
776 
778  {
779  qWarning() << "FCDProPlusInput::set_gain4: failed to set at " << cmd_value;
780  }
781 }
782 
784 {
785  if ((index < 0) || (index >= FCDProConstants::fcdpro_if_filter_nb_values()))
786  {
787  return;
788  }
789 
790  quint8 cmd_value = FCDProConstants::if_filters[index].value;
791 
793  {
794  qWarning() << "FCDProPlusInput::set_ifFilter: failed to set at " << cmd_value;
795  }
796 
797 }
798 
799 void FCDProInput::set_gain5(int index)
800 {
801  if ((index < 0) || (index >= FCDProConstants::fcdpro_if_gain5_nb_values()))
802  {
803  return;
804  }
805 
806  quint8 cmd_value = FCDProConstants::if_gains5[index].value;
807 
809  {
810  qWarning() << "FCDProPlusInput::set_gain5: failed to set at " << cmd_value;
811  }
812 }
813 
814 void FCDProInput::set_gain6(int index)
815 {
816  if ((index < 0) || (index >= FCDProConstants::fcdpro_if_gain6_nb_values()))
817  {
818  return;
819  }
820 
821  quint8 cmd_value = FCDProConstants::if_gains6[index].value;
822 
824  {
825  qWarning() << "FCDProPlusInput::set_gain6: failed to set at " << cmd_value;
826  }
827 }
828 
830  SWGSDRangel::SWGDeviceState& response,
831  QString& errorMessage)
832 {
833  (void) errorMessage;
835  return 200;
836 }
837 
839  bool run,
840  SWGSDRangel::SWGDeviceState& response,
841  QString& errorMessage)
842 {
843  (void) errorMessage;
845  MsgStartStop *message = MsgStartStop::create(run);
846  m_inputMessageQueue.push(message);
847 
848  if (m_guiMessageQueue) // forward to GUI if any
849  {
850  MsgStartStop *msgToGUI = MsgStartStop::create(run);
851  m_guiMessageQueue->push(msgToGUI);
852  }
853 
854  return 200;
855 }
856 
859  QString& errorMessage)
860 {
861  (void) errorMessage;
863  response.getFcdProSettings()->init();
865  return 200;
866 }
867 
869  bool force,
870  const QStringList& deviceSettingsKeys,
871  SWGSDRangel::SWGDeviceSettings& response, // query + response
872  QString& errorMessage)
873 {
874  (void) errorMessage;
875  FCDProSettings settings = m_settings;
876 
877  if (deviceSettingsKeys.contains("centerFrequency")) {
878  settings.m_centerFrequency = response.getFcdProSettings()->getCenterFrequency();
879  }
880  if (deviceSettingsKeys.contains("LOppmTenths")) {
881  settings.m_LOppmTenths = response.getFcdProSettings()->getLOppmTenths();
882  }
883  if (deviceSettingsKeys.contains("lnaGainIndex")) {
884  settings.m_lnaGainIndex = response.getFcdProSettings()->getLnaGainIndex();
885  }
886  if (deviceSettingsKeys.contains("rfFilterIndex")) {
887  settings.m_rfFilterIndex = response.getFcdProSettings()->getRfFilterIndex();
888  }
889  if (deviceSettingsKeys.contains("lnaEnhanceIndex")) {
890  settings.m_lnaEnhanceIndex = response.getFcdProSettings()->getLnaEnhanceIndex();
891  }
892  if (deviceSettingsKeys.contains("bandIndex")) {
893  settings.m_bandIndex = response.getFcdProSettings()->getBandIndex();
894  }
895  if (deviceSettingsKeys.contains("mixerGainIndex")) {
896  settings.m_mixerGainIndex = response.getFcdProSettings()->getMixerGainIndex();
897  }
898  if (deviceSettingsKeys.contains("mixerFilterIndex")) {
900  }
901  if (deviceSettingsKeys.contains("biasCurrentIndex")) {
903  }
904  if (deviceSettingsKeys.contains("modeIndex")) {
905  settings.m_modeIndex = response.getFcdProSettings()->getModeIndex();
906  }
907  if (deviceSettingsKeys.contains("gain1Index")) {
908  settings.m_gain1Index = response.getFcdProSettings()->getGain1Index();
909  }
910  if (deviceSettingsKeys.contains("gain2Index")) {
911  settings.m_gain2Index = response.getFcdProSettings()->getGain2Index();
912  }
913  if (deviceSettingsKeys.contains("gain3Index")) {
914  settings.m_gain3Index = response.getFcdProSettings()->getGain3Index();
915  }
916  if (deviceSettingsKeys.contains("gain4Index")) {
917  settings.m_gain4Index = response.getFcdProSettings()->getGain4Index();
918  }
919  if (deviceSettingsKeys.contains("gain5Index")) {
920  settings.m_gain5Index = response.getFcdProSettings()->getGain5Index();
921  }
922  if (deviceSettingsKeys.contains("gain6Index")) {
923  settings.m_gain6Index = response.getFcdProSettings()->getGain6Index();
924  }
925  if (deviceSettingsKeys.contains("log2Decim")) {
926  settings.m_log2Decim = response.getFcdProSettings()->getLog2Decim();
927  }
928  if (deviceSettingsKeys.contains("fcPos")) {
929  settings.m_fcPos = (FCDProSettings::fcPos_t) response.getFcdProSettings()->getFcPos();
930  }
931  if (deviceSettingsKeys.contains("rcFilterIndex")) {
932  settings.m_rcFilterIndex = response.getFcdProSettings()->getRcFilterIndex();
933  }
934  if (deviceSettingsKeys.contains("ifFilterIndex")) {
935  settings.m_ifFilterIndex = response.getFcdProSettings()->getIfFilterIndex();
936  }
937  if (deviceSettingsKeys.contains("dcBlock")) {
938  settings.m_dcBlock = response.getFcdProSettings()->getDcBlock() != 0;
939  }
940  if (deviceSettingsKeys.contains("iqCorrection")) {
941  settings.m_iqCorrection = response.getFcdProSettings()->getIqCorrection() != 0;
942  }
943  if (deviceSettingsKeys.contains("transverterDeltaFrequency")) {
945  }
946  if (deviceSettingsKeys.contains("transverterMode")) {
947  settings.m_transverterMode = response.getFcdProSettings()->getTransverterMode() != 0;
948  }
949  if (deviceSettingsKeys.contains("fileRecordName")) {
950  settings.m_fileRecordName = *response.getFcdProSettings()->getFileRecordName();
951  }
952  if (deviceSettingsKeys.contains("useReverseAPI")) {
953  settings.m_useReverseAPI = response.getFcdProSettings()->getUseReverseApi() != 0;
954  }
955  if (deviceSettingsKeys.contains("reverseAPIAddress")) {
957  }
958  if (deviceSettingsKeys.contains("reverseAPIPort")) {
959  settings.m_reverseAPIPort = response.getFcdProSettings()->getReverseApiPort();
960  }
961  if (deviceSettingsKeys.contains("reverseAPIDeviceIndex")) {
963  }
964 
965  MsgConfigureFCDPro *msg = MsgConfigureFCDPro::create(settings, force);
967 
968  if (m_guiMessageQueue) // forward to GUI if any
969  {
970  MsgConfigureFCDPro *msgToGUI = MsgConfigureFCDPro::create(settings, force);
971  m_guiMessageQueue->push(msgToGUI);
972  }
973 
974  webapiFormatDeviceSettings(response, settings);
975  return 200;
976 }
977 
979 {
981  response.getFcdProSettings()->setLOppmTenths(settings.m_LOppmTenths);
982  response.getFcdProSettings()->setLnaGainIndex(settings.m_lnaGainIndex);
983  response.getFcdProSettings()->setRfFilterIndex(settings.m_rfFilterIndex);
985  response.getFcdProSettings()->setBandIndex(settings.m_bandIndex);
989  response.getFcdProSettings()->setModeIndex(settings.m_modeIndex);
990  response.getFcdProSettings()->setGain1Index(settings.m_gain1Index);
991  response.getFcdProSettings()->setGain2Index(settings.m_gain2Index);
992  response.getFcdProSettings()->setGain3Index(settings.m_gain3Index);
993  response.getFcdProSettings()->setGain4Index(settings.m_gain4Index);
994  response.getFcdProSettings()->setGain5Index(settings.m_gain5Index);
995  response.getFcdProSettings()->setGain6Index(settings.m_gain6Index);
996  response.getFcdProSettings()->setLog2Decim(settings.m_log2Decim);
997  response.getFcdProSettings()->setFcPos((int) settings.m_fcPos);
998  response.getFcdProSettings()->setRcFilterIndex(settings.m_rcFilterIndex);
999  response.getFcdProSettings()->setIfFilterIndex(settings.m_ifFilterIndex);
1000  response.getFcdProSettings()->setDcBlock(settings.m_dcBlock ? 1 : 0);
1001  response.getFcdProSettings()->setIqCorrection(settings.m_iqCorrection ? 1 : 0);
1003  response.getFcdProSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
1004 
1005  if (response.getFcdProSettings()->getFileRecordName()) {
1006  *response.getFcdProSettings()->getFileRecordName() = settings.m_fileRecordName;
1007  } else {
1008  response.getFcdProSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
1009  }
1010 
1011  response.getFcdProSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
1012 
1013  if (response.getFcdProSettings()->getReverseApiAddress()) {
1015  } else {
1016  response.getFcdProSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
1017  }
1018 
1021 }
1022 
1023 void FCDProInput::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const FCDProSettings& settings, bool force)
1024 {
1026  swgDeviceSettings->setDirection(0); // single Rx
1027  swgDeviceSettings->setOriginatorIndex(m_deviceAPI->getDeviceSetIndex());
1028  swgDeviceSettings->setDeviceHwType(new QString("FCDPro"));
1029  swgDeviceSettings->setFcdProSettings(new SWGSDRangel::SWGFCDProSettings());
1030  SWGSDRangel::SWGFCDProSettings *swgFCDProSettings = swgDeviceSettings->getFcdProSettings();
1031 
1032  // transfer data that has been modified. When force is on transfer all data except reverse API data
1033 
1034  if (deviceSettingsKeys.contains("centerFrequency") || force) {
1035  swgFCDProSettings->setCenterFrequency(settings.m_centerFrequency);
1036  }
1037  if (deviceSettingsKeys.contains("LOppmTenths") || force) {
1038  swgFCDProSettings->setLOppmTenths(settings.m_LOppmTenths);
1039  }
1040  if (deviceSettingsKeys.contains("lnaGainIndex") || force) {
1041  swgFCDProSettings->setLnaGainIndex(settings.m_lnaGainIndex);
1042  }
1043  if (deviceSettingsKeys.contains("rfFilterIndex") || force) {
1044  swgFCDProSettings->setRfFilterIndex(settings.m_rfFilterIndex);
1045  }
1046  if (deviceSettingsKeys.contains("lnaEnhanceIndex") || force) {
1047  swgFCDProSettings->setLnaEnhanceIndex(settings.m_lnaEnhanceIndex);
1048  }
1049  if (deviceSettingsKeys.contains("bandIndex") || force) {
1050  swgFCDProSettings->setBandIndex(settings.m_bandIndex);
1051  }
1052  if (deviceSettingsKeys.contains("mixerGainIndex") || force) {
1053  swgFCDProSettings->setMixerGainIndex(settings.m_mixerGainIndex);
1054  }
1055  if (deviceSettingsKeys.contains("mixerFilterIndex") || force) {
1056  swgFCDProSettings->setMixerFilterIndex(settings.m_mixerFilterIndex);
1057  }
1058  if (deviceSettingsKeys.contains("biasCurrentIndex") || force) {
1059  swgFCDProSettings->setBiasCurrentIndex(settings.m_biasCurrentIndex);
1060  }
1061  if (deviceSettingsKeys.contains("modeIndex") || force) {
1062  swgFCDProSettings->setModeIndex(settings.m_modeIndex);
1063  }
1064  if (deviceSettingsKeys.contains("gain1Index") || force) {
1065  swgFCDProSettings->setGain1Index(settings.m_gain1Index);
1066  }
1067  if (deviceSettingsKeys.contains("gain2Index") || force) {
1068  swgFCDProSettings->setGain2Index(settings.m_gain2Index);
1069  }
1070  if (deviceSettingsKeys.contains("gain3Index") || force) {
1071  swgFCDProSettings->setGain3Index(settings.m_gain3Index);
1072  }
1073  if (deviceSettingsKeys.contains("gain4Index") || force) {
1074  swgFCDProSettings->setGain4Index(settings.m_gain4Index);
1075  }
1076  if (deviceSettingsKeys.contains("gain5Index") || force) {
1077  swgFCDProSettings->setGain5Index(settings.m_gain5Index);
1078  }
1079  if (deviceSettingsKeys.contains("gain6Index") || force) {
1080  swgFCDProSettings->setGain6Index(settings.m_gain6Index);
1081  }
1082  if (deviceSettingsKeys.contains("log2Decim") || force) {
1083  swgFCDProSettings->setLog2Decim(settings.m_log2Decim);
1084  }
1085  if (deviceSettingsKeys.contains("fcPos") || force) {
1086  swgFCDProSettings->setFcPos(settings.m_fcPos);
1087  }
1088  if (deviceSettingsKeys.contains("rcFilterIndex") || force) {
1089  swgFCDProSettings->setRcFilterIndex(settings.m_rcFilterIndex);
1090  }
1091  if (deviceSettingsKeys.contains("ifFilterIndex") || force) {
1092  swgFCDProSettings->setIfFilterIndex(settings.m_ifFilterIndex);
1093  }
1094  if (deviceSettingsKeys.contains("dcBlock") || force) {
1095  swgFCDProSettings->setDcBlock(settings.m_dcBlock ? 1 : 0);
1096  }
1097  if (deviceSettingsKeys.contains("iqCorrection") || force) {
1098  swgFCDProSettings->setIqCorrection(settings.m_iqCorrection ? 1 : 0);
1099  }
1100  if (deviceSettingsKeys.contains("transverterDeltaFrequency") || force) {
1101  swgFCDProSettings->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
1102  }
1103  if (deviceSettingsKeys.contains("transverterMode") || force) {
1104  swgFCDProSettings->setTransverterMode(settings.m_transverterMode ? 1 : 0);
1105  }
1106  if (deviceSettingsKeys.contains("fileRecordName") || force) {
1107  swgFCDProSettings->setFileRecordName(new QString(settings.m_fileRecordName));
1108  }
1109 
1110  QString deviceSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/device/settings")
1111  .arg(settings.m_reverseAPIAddress)
1112  .arg(settings.m_reverseAPIPort)
1113  .arg(settings.m_reverseAPIDeviceIndex);
1114  m_networkRequest.setUrl(QUrl(deviceSettingsURL));
1115  m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
1116 
1117  QBuffer *buffer=new QBuffer();
1118  buffer->open((QBuffer::ReadWrite));
1119  buffer->write(swgDeviceSettings->asJson().toUtf8());
1120  buffer->seek(0);
1121 
1122  // Always use PATCH to avoid passing reverse API settings
1123  m_networkManager->sendCustomRequest(m_networkRequest, "PATCH", buffer);
1124 
1125  delete swgDeviceSettings;
1126 }
1127 
1129 {
1131  swgDeviceSettings->setDirection(0); // single Rx
1132  swgDeviceSettings->setOriginatorIndex(m_deviceAPI->getDeviceSetIndex());
1133  swgDeviceSettings->setDeviceHwType(new QString("FCDPro"));
1134 
1135  QString deviceSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/device/run")
1139  m_networkRequest.setUrl(QUrl(deviceSettingsURL));
1140  m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
1141 
1142  QBuffer *buffer=new QBuffer();
1143  buffer->open((QBuffer::ReadWrite));
1144  buffer->write(swgDeviceSettings->asJson().toUtf8());
1145  buffer->seek(0);
1146 
1147  if (start) {
1148  m_networkManager->sendCustomRequest(m_networkRequest, "POST", buffer);
1149  } else {
1150  m_networkManager->sendCustomRequest(m_networkRequest, "DELETE", buffer);
1151  }
1152 
1153  delete swgDeviceSettings;
1154 }
1155 
1156 void FCDProInput::networkManagerFinished(QNetworkReply *reply)
1157 {
1158  QNetworkReply::NetworkError replyError = reply->error();
1159 
1160  if (replyError)
1161  {
1162  qWarning() << "FCDProInput::networkManagerFinished:"
1163  << " error(" << (int) replyError
1164  << "): " << replyError
1165  << ": " << reply->errorString();
1166  return;
1167  }
1168 
1169  QString answer = reply->readAll();
1170  answer.chop(1); // remove last \n
1171  qDebug("FCDProInput::networkManagerFinished: reply:\n%s", answer.toStdString().c_str());
1172 }
void setGain1Index(qint32 gain1_index)
void setLog2Decimation(unsigned int log2_decim)
uint16_t m_reverseAPIPort
void set_gain5(int index)
fcdpro_if_gain1_value value
Definition: fcdproconst.h:168
void closeFCDAudio()
const QList< QAudioDeviceInfo > & getInputDevices() const
bool startDeviceEngine()
Start the device engine corresponding to the stream type.
Definition: deviceapi.cpp:253
virtual void stop()
AudioInput m_fcdAudioInput
Definition: fcdproinput.h:170
FCD_MODE_ENUM fcdAppSetParam(hid_device *phd, uint8_t u8Cmd, uint8_t *pu8Data, uint8_t u8len)
Write FCD parameter (e.g. gain or filter)
Definition: fcdhid.c:826
QNetworkAccessManager * m_networkManager
Definition: fcdproinput.h:178
#define FCDPRO_HID_CMD_SET_IF_FILTER
Definition: fcdprohidcmd.h:24
qint32 m_lnaEnhanceIndex
#define FCDPRO_HID_CMD_SET_MIXER_FILTER
Definition: fcdprohidcmd.h:18
SWGFCDProSettings * getFcdProSettings()
virtual bool handleMessage(const Message &message)
fcdpro_if_gain5_value value
Definition: fcdproconst.h:304
static qint64 calculateDeviceCenterFrequency(quint64 centerFrequency, qint64 transverterDeltaFrequency, int log2Decim, fcPos_t fcPos, quint32 devSampleRate, FrequencyShiftScheme frequencyShiftScheme, bool transverterMode=false)
void fcdClose(hid_device *phd)
Close FCD HID device.
Definition: fcdhid.c:78
void push(Message *message, bool emitSignal=true)
Push message onto queue.
fcdpro_if_rc_filter_value value
Definition: fcdproconst.h:206
void setMixerFilterIndex(qint32 mixer_filter_index)
void setGain6Index(qint32 gain6_index)
static int fcdpro_if_filter_nb_values()
void stopDeviceEngine()
Stop the device engine corresponding to the stream type.
Definition: deviceapi.cpp:266
static int fcdpro_rf_filter_nb_values()
Definition: fcdproconst.cpp:99
static const fcdpro_if_gain3 if_gains3[]
Definition: fcdproconst.h:338
static const fcdpro_bias_current bias_currents[]
Definition: fcdproconst.h:331
void setFileName(const QString &filename)
Definition: filerecord.cpp:59
void set_lnaEnhance(int index)
uint getDeviceUID() const
Return the current device engine unique ID.
Definition: deviceapi.cpp:303
virtual int webapiSettingsGet(SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage)
void set_rcFilter(int index)
FileRecord * m_fileSink
File sink to record device I/Q output.
Definition: fcdproinput.h:177
fcdpro_band_value value
Definition: fcdproconst.h:61
FCD_MODE_ENUM fcdAppSetFreq(hid_device *phd, int nFreq)
Set FCD frequency with Hz resolution.
Definition: fcdhid.c:450
static const fcdpro_if_gain1 if_gains1[]
Definition: fcdproconst.h:336
void startRecording()
Definition: filerecord.cpp:105
qint32 m_mixerGainIndex
MessageQueue m_inputMessageQueue
Input queue to the source.
void networkManagerFinished(QNetworkReply *reply)
void setIqCorrection(qint32 iq_correction)
static int fcdpro_mixer_gain_nb_values()
virtual QString asJson() override
void webapiReverseSendSettings(QList< QString > &deviceSettingsKeys, const FCDProSettings &settings, bool force)
static const fcdpro_if_gain_mode if_gain_modes[]
Definition: fcdproconst.h:333
MessageQueue * getDeviceEngineInputMessageQueue()
Device engine message queue.
Definition: deviceapi.cpp:316
fcdpro_mixer_filter_value value
Definition: fcdproconst.h:156
QNetworkRequest m_networkRequest
Definition: fcdproinput.h:179
void setGain5Index(qint32 gain5_index)
AudioFifo m_fcdFIFO
Definition: fcdproinput.h:171
void set_band(int index)
void setLOppmTenths(qint32 l_oppm_tenths)
void set_gain4(int index)
static int fcdpro_if_gain3_nb_values()
virtual int webapiRun(bool run, SWGSDRangel::SWGDeviceState &response, QString &errorMessage)
quint32 m_log2Decim
static int fcdpro_bias_current_nb_values()
void applySettings(const FCDProSettings &settings, bool force)
bool initDeviceEngine()
Init the device engine corresponding to the stream type.
Definition: deviceapi.cpp:240
bool m_running
Definition: fcdproinput.h:176
static const fcdpro_if_gain6 if_gains6[]
Definition: fcdproconst.h:341
void setTransverterDeltaFrequency(qint64 transverter_delta_frequency)
static const fcdpro_lna_gain lna_gains[]
Definition: fcdproconst.h:326
qint32 m_lnaGainIndex
void setReverseApiDeviceIndex(qint32 reverse_api_device_index)
void setOriginatorIndex(qint32 originator_index)
void setRfFilterIndex(qint32 rf_filter_index)
static const fcdpro_if_gain2 if_gains2[]
Definition: fcdproconst.h:337
qint32 m_ifFilterIndex
#define FCDPRO_HID_CMD_SET_BAND
Definition: fcdprohidcmd.h:14
#define FCDPRO_HID_CMD_SET_IF_GAIN2
Definition: fcdprohidcmd.h:22
SampleSinkFifo m_sampleFifo
bool setSize(int size)
#define FCDPRO_HID_CMD_SET_BIAS_CURRENT
Definition: fcdprohidcmd.h:17
FCDProSettings m_settings
Definition: fcdproinput.h:173
#define FCDPRO_HID_CMD_SET_IF_GAIN5
Definition: fcdprohidcmd.h:26
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
const FCDProSettings & getSettings() const
Definition: fcdproinput.h:52
void setCenterFrequency(qint64 center_frequency)
void set_gain6(int index)
static int fcdpro_if_gain2_nb_values()
void setBandIndex(qint32 band_index)
qint64 m_transverterDeltaFrequency
void set_rfFilter(int index)
void setGain2Index(qint32 gain2_index)
int getDeviceSetIndex() const
Definition: deviceapi.h:131
#define FCDPRO_HID_CMD_SET_MIXER_GAIN
Definition: fcdprohidcmd.h:16
void setGain4Index(qint32 gain4_index)
uint16_t m_reverseAPIDeviceIndex
#define FCDPRO_HID_CMD_SET_IF_GAIN3
Definition: fcdprohidcmd.h:23
void setModeIndex(qint32 mode_index)
hid_device * fcdOpen(uint16_t usVID, uint16_t usPID, int whichdongle)
Open FCD device.
Definition: fcdhid.c:31
#define MESSAGE_CLASS_DEFINITION(Name, BaseClass)
Definition: message.h:52
void set_gain3(int index)
void genUniqueFileName(uint deviceUID, int istream=-1)
Definition: filerecord.cpp:67
static DSPEngine * instance()
Definition: dspengine.cpp:51
static MsgConfigureFCDPro * create(const FCDProSettings &settings, bool force)
Definition: fcdproinput.h:55
void set_gain2(int index)
QByteArray serialize() const
void setRcFilterIndex(qint32 rc_filter_index)
static int fcdpro_lna_enhance_nb_values()
Definition: fcdproconst.cpp:39
void setBiasCurrentIndex(qint32 bias_current_index)
fcdpro_if_gain_mode_value value
Definition: fcdproconst.h:180
void setGain3Index(qint32 gain3_index)
void set_center_freq(double freq)
#define FCDPRO_HID_CMD_SET_IF_RC_FILTER
Definition: fcdprohidcmd.h:21
virtual void setCenterFrequency(qint64 centerFrequency)
static int fcdpro_lna_gain_nb_values()
Definition: fcdproconst.cpp:26
void stopRecording()
Definition: filerecord.cpp:117
static int fcdpro_band_nb_values()
Definition: fcdproconst.cpp:51
bool start(int device, int rate)
Definition: audioinput.cpp:49
void setLnaGainIndex(qint32 lna_gain_index)
qint32 m_LOppmTenths
fcdpro_bias_current_value value
Definition: fcdproconst.h:137
void closeDevice()
bool getStartStop() const
Definition: fcdproinput.h:94
static bool match(const Message *message)
Definition: message.cpp:45
virtual void destroy()
Definition: fcdproinput.cpp:74
static int fcdpro_if_rc_filter_nb_values()
static int fcdpro_if_gain1_nb_values()
fcdpro_if_gain4_value value
Definition: fcdproconst.h:247
void removeAncillarySink(BasebandSampleSink *sink, unsigned int index=0)
Removes it.
Definition: deviceapi.cpp:100
void setMixerGainIndex(qint32 mixer_gain_index)
void removeFifo(AudioFifo *audioFifo)
Definition: audioinput.cpp:149
void webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings &response, const FCDProSettings &settings)
#define FCDPRO_HID_CMD_SET_LNA_ENHANCE
Definition: fcdprohidcmd.h:13
static const fcdpro_rf_filter rf_filters[]
Definition: fcdproconst.h:329
#define FCDPRO_HID_CMD_SET_RF_FILTER
Definition: fcdprohidcmd.h:15
qint32 m_rfFilterIndex
MessageQueue * m_guiMessageQueue
Input message queue to the GUI.
virtual bool deserialize(const QByteArray &data)
static int fcdpro_if_gain6_nb_values()
qint32 m_mixerFilterIndex
fcdpro_if_filter_value value
Definition: fcdproconst.h:289
static const fcdpro_if_filter if_filters[]
Definition: fcdproconst.h:335
virtual ~FCDProInput()
Definition: fcdproinput.cpp:59
void webapiReverseSendStartStop(bool start)
void setFcdProSettings(SWGFCDProSettings *fcd_pro_settings)
void stop()
Definition: audioinput.cpp:121
void getDeviceEngineStateStr(QString &state)
Definition: deviceapi.cpp:389
fcdpro_if_gain6_value value
Definition: fcdproconst.h:319
void set_ifFilter(int index)
fcdpro_if_gain2_value value
Definition: fcdproconst.h:220
void setUseReverseApi(qint32 use_reverse_api)
#define FCDPRO_HID_CMD_SET_LNA_GAIN
Definition: fcdprohidcmd.h:12
void setLnaEnhanceIndex(qint32 lna_enhance_index)
AudioDeviceManager * getAudioDeviceManager()
Definition: dspengine.h:55
virtual bool start()
void setFcPos(int fcPos)
fcdpro_if_gain3_value value
Definition: fcdproconst.h:234
hid_device * m_dev
Definition: fcdproinput.h:169
virtual int getSampleRate() const
Sample rate exposed by the source.
void setFileRecordName(QString *file_record_name)
void setTransverterMode(qint32 transverter_mode)
void set_mixerGain(int index)
QString m_deviceDescription
Definition: fcdproinput.h:175
void setReverseApiPort(qint32 reverse_api_port)
void set_mode(int index)
QString m_reverseAPIAddress
DeviceAPI * m_deviceAPI
Definition: fcdproinput.h:168
void setReverseApiAddress(QString *reverse_api_address)
virtual quint64 getCenterFrequency() const
Center frequency exposed by the source.
QString m_fileRecordName
fcdpro_mixer_gain_value value
Definition: fcdproconst.h:123
void set_mixerFilter(int index)
static int fcdpro_if_gain_mode_nb_values()
void setLog2Decim(qint32 log2_decim)
Definition: fcdtraits.h:25
static const fcdpro_if_gain4 if_gains4[]
Definition: fcdproconst.h:339
int getInputDeviceIndex(const QString &deviceName) const
fcdpro_rf_filter_value value
Definition: fcdproconst.h:111
#define FCDPRO_HID_CMD_SET_IF_GAIN6
Definition: fcdprohidcmd.h:27
bool openFCDAudio(const char *filename)
qint32 m_rcFilterIndex
static const fcdpro_mixer_filter mixer_filters[]
Definition: fcdproconst.h:332
bool deserialize(const QByteArray &data)
uint getRate() const
Definition: audioinput.h:45
bool openDevice()
Definition: fcdproinput.cpp:79
void set_bias_t(bool on)
void startWork()
virtual QByteArray serialize() const
fcdpro_lna_gain_value value
Definition: fcdproconst.h:32
#define FCDPRO_HID_CMD_SET_IF_GAIN4
Definition: fcdprohidcmd.h:25
FCDProThread * m_FCDThread
Definition: fcdproinput.h:174
static const fcdpro_band bands[]
Definition: fcdproconst.h:328
void set_lnaGain(int index)
void set_gain1(int index)
virtual int webapiSettingsPutPatch(bool force, const QStringList &deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage)
static int fcdpro_if_gain4_nb_values()
void configureCorrections(bool dcOffsetCorrection, bool iqImbalanceCorrection, int streamIndex=0)
Configure current device engine DSP corrections (Rx)
Definition: deviceapi.cpp:355
uint32_t getSamplingDeviceSequence() const
Definition: deviceapi.h:123
void setDirection(qint32 direction)
fcdpro_lna_enhance_value value
Definition: fcdproconst.h:47
static const fcdpro_if_gain5 if_gains5[]
Definition: fcdproconst.h:340
quint64 m_centerFrequency
static const fcdpro_lna_enhance lna_enhances[]
Definition: fcdproconst.h:327
#define FCDPRO_HID_CMD_SET_IF_GAIN_MODE
Definition: fcdprohidcmd.h:20
static MsgStartStop * create(bool startStop)
Definition: fcdproinput.h:96
static int fcdpro_if_gain5_nb_values()
void setDeviceHwType(QString *device_hw_type)
virtual void init()
initializations to be done when all collaborating objects are created and possibly connected ...
static const fcdpro_mixer_gain mixer_gains[]
Definition: fcdproconst.h:330
qint32 m_biasCurrentIndex
#define FCDPRO_HID_CMD_SET_IF_GAIN1
Definition: fcdprohidcmd.h:19
void addFifo(AudioFifo *audioFifo)
Definition: audioinput.cpp:142
virtual const QString & getDeviceDescription() const
virtual int webapiRunGet(SWGSDRangel::SWGDeviceState &response, QString &errorMessage)
static const fcdpro_if_rc_filter if_rc_filters[]
Definition: fcdproconst.h:334
static int fcdpro_mixer_filter_nb_values()
void setIfFilterIndex(qint32 if_filter_index)
void set_biasCurrent(int index)