20 #include <QCoreApplication> 22 #include <QTextStream> 77 *response.
getAppname() = QCoreApplication::applicationName();
78 *response.
getVersion() = QCoreApplication::applicationVersion();
82 response.
setPid(QCoreApplication::applicationPid());
83 #if QT_VERSION >= 0x050400 84 *response.
getArchitecture() = QString(QSysInfo::currentCpuArchitecture());
85 *response.
getOs() = QString(QSysInfo::prettyProductName());
113 *response.
getMessage() = QString(
"Message to stop the SDRangel instance (MsgDeleteInstance) was submitted successfully");
129 QList<SWGSDRangel::SWGPreset*> *swgPresets = response.
getPresets();
131 for (
int i = 0;
i < nbPresets;
i++)
148 int nbSamplingDevices;
150 if (direction == 0) {
152 }
else if (direction == 1) {
155 nbSamplingDevices = 0;
160 QList<SWGSDRangel::SWGDeviceListItem*> *devices = response.
getDevices();
162 for (
int i = 0;
i < nbSamplingDevices;
i++)
166 if (direction == 0) {
168 }
else if (direction == 1) {
175 devices->back()->init();
176 *devices->back()->getDisplayedName() = samplingDevice->
displayedName;
177 *devices->back()->getHwType() = samplingDevice->
hardwareId;
178 *devices->back()->getSerial() = samplingDevice->
serial;
179 devices->back()->setSequence(samplingDevice->
sequence);
180 devices->back()->setDirection((
int) samplingDevice->
streamType);
181 devices->back()->setDeviceNbStreams(samplingDevice->
deviceNbItems);
182 devices->back()->setDeviceSetIndex(samplingDevice->
claimed);
183 devices->back()->setIndex(
i);
196 int nbChannelDevices;
201 nbChannelDevices = channelRegistrations->size();
203 else if (direction == 1)
206 nbChannelDevices = channelRegistrations->size();
210 channelRegistrations =
nullptr;
211 nbChannelDevices = 0;
215 QList<SWGSDRangel::SWGChannelListItem*> *channels = response.
getChannels();
217 for (
int i = 0;
i < nbChannelDevices;
i++)
220 channels->back()->init();
223 *channels->back()->getVersion() = pluginDescriptor.
version;
224 *channels->back()->getName() = pluginDescriptor.
displayedName;
225 channels->back()->setDirection(direction);
226 *channels->back()->getIdUri() = channelRegistrations->at(
i).m_channelIdURI;
227 *channels->back()->getId() = channelRegistrations->at(
i).m_channelId;
228 channels->back()->setIndex(
i);
295 int nbInputDevices = audioInputDevices.size();
296 int nbOutputDevices = audioOutputDevices.size();
301 QList<SWGSDRangel::SWGAudioInputDevice*> *inputDevices = response.
getInputDevices();
302 QList<SWGSDRangel::SWGAudioOutputDevice*> *outputDevices = response.
getOutputDevices();
308 inputDevices->back()->init();
311 inputDevices->back()->setIndex(-1);
312 inputDevices->back()->setSampleRate(inputDeviceInfo.
sampleRate);
313 inputDevices->back()->setIsSystemDefault(0);
314 inputDevices->back()->setDefaultUnregistered(found ? 0 : 1);
315 inputDevices->back()->setVolume(inputDeviceInfo.
volume);
318 for (
int i = 0;
i < nbInputDevices;
i++)
321 inputDevices->back()->init();
324 *inputDevices->back()->getName() = audioInputDevices.at(
i).deviceName();
325 inputDevices->back()->setIndex(
i);
326 inputDevices->back()->setSampleRate(inputDeviceInfo.
sampleRate);
327 inputDevices->back()->setIsSystemDefault(audioInputDevices.at(
i).deviceName() == QAudioDeviceInfo::defaultInputDevice().deviceName() ? 1 : 0);
328 inputDevices->back()->setDefaultUnregistered(found ? 0 : 1);
329 inputDevices->back()->setVolume(inputDeviceInfo.
volume);
334 outputDevices->back()->init();
337 outputDevices->back()->setIndex(-1);
338 outputDevices->back()->setSampleRate(outputDeviceInfo.
sampleRate);
339 inputDevices->back()->setIsSystemDefault(0);
340 outputDevices->back()->setDefaultUnregistered(found ? 0 : 1);
341 outputDevices->back()->setCopyToUdp(outputDeviceInfo.
copyToUDP ? 1 : 0);
342 outputDevices->back()->setUdpUsesRtp(outputDeviceInfo.
udpUseRTP ? 1 : 0);
343 outputDevices->back()->setUdpChannelMode((
int) outputDeviceInfo.
udpChannelMode);
344 outputDevices->back()->setUdpChannelCodec((
int) outputDeviceInfo.
udpChannelCodec);
346 *outputDevices->back()->getUdpAddress() = outputDeviceInfo.
udpAddress;
347 outputDevices->back()->setUdpPort(outputDeviceInfo.
udpPort);
350 for (
int i = 0;
i < nbOutputDevices;
i++)
353 outputDevices->back()->init();
356 *outputDevices->back()->getName() = audioOutputDevices.at(
i).deviceName();
357 outputDevices->back()->setIndex(
i);
358 outputDevices->back()->setSampleRate(outputDeviceInfo.
sampleRate);
359 outputDevices->back()->setIsSystemDefault(audioOutputDevices.at(
i).deviceName() == QAudioDeviceInfo::defaultOutputDevice().deviceName() ? 1 : 0);
360 outputDevices->back()->setDefaultUnregistered(found ? 0 : 1);
361 outputDevices->back()->setCopyToUdp(outputDeviceInfo.
copyToUDP ? 1 : 0);
362 outputDevices->back()->setUdpUsesRtp(outputDeviceInfo.
udpUseRTP ? 1 : 0);
363 outputDevices->back()->setUdpChannelMode((
int) outputDeviceInfo.
udpChannelMode);
364 outputDevices->back()->setUdpChannelCodec((
int) outputDeviceInfo.
udpChannelCodec);
366 *outputDevices->back()->getUdpAddress() = outputDeviceInfo.
udpAddress;
367 outputDevices->back()->setUdpPort(outputDeviceInfo.
udpPort);
375 const QStringList& audioInputKeys,
381 int deviceIndex = response.
getIndex();
386 *error.
getMessage() = QString(
"There is no input audio device at index %1").arg(deviceIndex);
392 if (audioInputKeys.contains(
"sampleRate")) {
395 if (audioInputKeys.contains(
"volume")) {
410 const QStringList& audioOutputKeys,
415 int deviceIndex = response.
getIndex();
420 *error.
getMessage() = QString(
"There is no output audio device at index %1").arg(deviceIndex);
426 if (audioOutputKeys.contains(
"sampleRate")) {
429 if (audioOutputKeys.contains(
"copyToUDP")) {
432 if (audioOutputKeys.contains(
"udpUsesRTP")) {
435 if (audioOutputKeys.contains(
"udpChannelMode")) {
438 if (audioOutputKeys.contains(
"udpAddress")) {
441 if (audioOutputKeys.contains(
"udpPort")) {
472 int deviceIndex = response.
getIndex();
477 *error.
getMessage() = QString(
"There is no audio input device at index %1").arg(deviceIndex);
496 int deviceIndex = response.
getIndex();
501 *error.
getMessage() = QString(
"There is no audio output device at index %1").arg(deviceIndex);
533 *response.
getMessage() = QString(
"Unregistered parameters for devices not in list of available input devices for this instance");
545 *response.
getMessage() = QString(
"Unregistered parameters for devices not in list of available output devices for this instance");
568 latitude = latitude < -90.0 ? -90.0 : latitude > 90.0 ? 90.0 : latitude;
569 longitude = longitude < -180.0 ? -180.0 : longitude > 180.0 ? 180.0 : longitude;
586 std::vector<std::string> deviceNames;
589 QList<SWGSDRangel::SWGDVSerialDevice*> *deviceNamesList = response.
getDvSerialDevices();
591 std::vector<std::string>::iterator it = deviceNames.begin();
593 while (it != deviceNames.end())
596 deviceNamesList->back()->init();
597 *deviceNamesList->back()->getDeviceName() = QString::fromStdString(*it);
614 std::vector<std::string> deviceNames;
617 QList<SWGSDRangel::SWGDVSerialDevice*> *deviceNamesList = response.
getDvSerialDevices();
619 std::vector<std::string>::iterator it = deviceNames.begin();
620 std::string deviceNamesStr =
"DV Serial devices found: ";
622 while (it != deviceNames.end())
625 deviceNamesList->back()->init();
626 *deviceNamesList->back()->getDeviceName() = QString::fromStdString(*it);
645 std::vector<std::string> deviceNames;
646 std::vector<QString> qDeviceNames;
649 for (std::vector<QString>::const_iterator it = qDeviceNames.begin(); it != qDeviceNames.end(); ++it) {
650 deviceNames.push_back(it->toStdString());
654 QList<SWGSDRangel::SWGDVSerialDevice*> *deviceNamesList = response.
getDvSerialDevices();
656 std::vector<std::string>::iterator it = deviceNames.begin();
658 while (it != deviceNames.end())
661 deviceNamesList->back()->init();
662 *deviceNamesList->back()->getDeviceName() = QString::fromStdString(*it);
676 std::vector<std::string> deviceNames;
679 QList<SWGSDRangel::SWGAMBEDevice*> *deviceNamesList = response.
getAmbeDevices();
681 std::vector<std::string>::iterator it = deviceNames.begin();
683 while (it != deviceNames.end())
686 deviceNamesList->back()->init();
687 *deviceNamesList->back()->getDeviceRef() = QString::fromStdString(*it);
688 deviceNamesList->back()->setDelete(0);
703 *response.
getMessage() = QString(
"All AMBE devices released");
715 QList<SWGSDRangel::SWGAMBEDevice *> *ambeList = query.
getAmbeDevices();
717 for (QList<SWGSDRangel::SWGAMBEDevice *>::const_iterator it = ambeList->begin(); it != ambeList->end(); ++it) {
730 QList<SWGSDRangel::SWGAMBEDevice *> *ambeList = query.
getAmbeDevices();
732 for (QList<SWGSDRangel::SWGAMBEDevice *>::const_iterator it = ambeList->begin(); it != ambeList->end(); ++it)
734 if ((*it)->getDelete()) {
754 QFile exportFile(fileName);
756 if (exportFile.open(QIODevice::ReadOnly | QIODevice::Text))
758 QByteArray base64Str;
759 QTextStream instream(&exportFile);
760 instream >> base64Str;
764 preset->
deserialize(QByteArray::fromBase64(base64Str));
785 *error.
getMessage() = QString(
"File %1 not found or not readable").arg(fileName);
792 *error.
getMessage() = QString(
"Empty file path");
810 if (selectedPreset == 0)
813 *error.
getMessage() = QString(
"There is no preset [%1, %2, %3, %4]")
821 QString base64Str = selectedPreset->
serialize().toBase64();
825 QFileInfo fileInfo(filePath);
827 if (fileInfo.suffix() !=
"prex") {
831 QFile exportFile(filePath);
833 if (exportFile.open(QIODevice::WriteOnly | QIODevice::Text))
835 QTextStream outstream(&exportFile);
836 outstream << base64Str;
850 *error.
getMessage() = QString(
"File %1 cannot be written").arg(filePath);
857 *error.
getMessage() = QString(
"Empty file path");
868 int nbPresetsThisGroup = 0;
871 QList<SWGSDRangel::SWGPresetGroup*> *groups = response.
getGroups();
872 QList<SWGSDRangel::SWGPresetItem*> *swgPresets = 0;
877 for (; i < nbPresets; i++)
881 if ((i == 0) || (groupName != preset->
getGroup()))
883 if (i > 0) { groups->back()->setNbPresets(nbPresetsThisGroup); }
885 groups->back()->init();
887 *groups->back()->getGroupName() = groupName;
888 swgPresets = groups->back()->getPresets();
890 nbPresetsThisGroup = 0;
894 swgPresets->back()->init();
896 *swgPresets->back()->getType() = preset->
isSourcePreset() ?
"R" :
"T";
898 nbPresetsThisGroup++;
901 if (i > 0) { groups->back()->setNbPresets(nbPresetsThisGroup); }
916 if (deviceSetIndex >= nbDeviceSets)
919 *error.
getMessage() = QString(
"There is no device set at index %1. Number of device sets is %2").arg(deviceSetIndex).arg(nbDeviceSets);
928 if (selectedPreset == 0)
931 *error.
getMessage() = QString(
"There is no preset [%1, %2, %3 %4]")
944 *error.
getMessage() = QString(
"Preset type (T) and device set type (Rx) mismatch");
951 *error.
getMessage() = QString(
"Preset type (R) and device set type (Tx) mismatch");
976 if (deviceSetIndex >= nbDeviceSets)
979 *error.
getMessage() = QString(
"There is no device set at index %1. Number of device sets is %2").arg(deviceSetIndex).arg(nbDeviceSets);
988 if (selectedPreset == 0)
991 *error.
getMessage() = QString(
"There is no preset [%1, %2, %3 %4]")
1005 *error.
getMessage() = QString(
"Preset type (T) and device set type (Rx) mismatch");
1012 *error.
getMessage() = QString(
"Preset type (R) and device set type (Tx) mismatch");
1038 if (deviceSetIndex >= nbDeviceSets)
1041 *error.
getMessage() = QString(
"There is no device set at index %1. Number of device sets is %2").arg(deviceSetIndex).arg(nbDeviceSets);
1046 int deviceCenterFrequency = 0;
1047 bool isSourcePreset;
1051 isSourcePreset =
true;
1054 isSourcePreset =
false;
1057 *error.
getMessage() = QString(
"Device set error");
1062 deviceCenterFrequency,
1064 *presetIdentifier->
getType());
1066 if (selectedPreset == 0)
1073 *error.
getMessage() = QString(
"Preset already exists [%1, %2, %3 %4]")
1075 .
arg(deviceCenterFrequency)
1076 .arg(*presetIdentifier->
getName())
1087 *response.
getType() = isSourcePreset ?
"R" :
"T";
1102 if (selectedPreset == 0)
1105 *error.
getMessage() = QString(
"There is no preset [%1, %2, %3 %4]")
1141 *response.
getMessage() = QString(
"Message to add a new device set (MsgAddDeviceSet) was submitted successfully");
1156 *response.
getMessage() = QString(
"Message to remove last device set (MsgRemoveLastDeviceSet) was submitted successfully");
1163 *error.
getMessage() =
"No more device sets to be removed";
1184 *error.
getMessage() = QString(
"There is no device set with index %1").arg(deviceSetIndex);
1195 *error.
getMessage() = QString(
"Not supported in server instance");
1212 *error.
getMessage() = QString(
"Device type and device set type (Tx) mismatch");
1219 *error.
getMessage() = QString(
"Device type and device set type (Rx) mismatch");
1223 int nbSamplingDevices;
1230 nbSamplingDevices = 0;
1233 for (
int i = 0;
i < nbSamplingDevices;
i++)
1291 *error.
getMessage() = QString(
"Device not found");
1297 *error.
getMessage() = QString(
"There is no device set with index %1").arg(deviceSetIndex);
1330 *error.
getMessage() = QString(
"DeviceSet error");
1336 *error.
getMessage() = QString(
"There is no device set with index %1").arg(deviceSetIndex);
1344 const QStringList& deviceSettingsKeys,
1358 *error.
getMessage() = QString(
"Single Rx device found but other type of device requested");
1376 *error.
getMessage() = QString(
"Single Tx device found but other type of device requested");
1392 *error.
getMessage() = QString(
"DeviceSet error");
1398 *error.
getMessage() = QString(
"There is no device set with index %1").arg(deviceSetIndex);
1428 *error.
getMessage() = QString(
"DeviceSet error");
1434 *error.
getMessage() = QString(
"There is no device set with index %1").arg(deviceSetIndex);
1464 *error.
getMessage() = QString(
"DeviceSet error");
1470 *error.
getMessage() = QString(
"There is no device set with index %1").arg(deviceSetIndex);
1500 *error.
getMessage() = QString(
"DeviceSet error");
1506 *error.
getMessage() = QString(
"There is no device set with index %1").arg(deviceSetIndex);
1538 *error.
getMessage() = QString(
"DeviceSet error");
1544 *error.
getMessage() = QString(
"There is no device set with index %1").arg(deviceSetIndex);
1564 *error.
getMessage() = QString(
"There is no device set with index %1").arg(deviceSetIndex);
1585 *error.
getMessage() = QString(
"Device set at %1 is not a receive device set").arg(deviceSetIndex);
1590 int nbRegistrations = channelRegistrations->size();
1592 for (; index < nbRegistrations; index++)
1594 if (channelRegistrations->at(index).m_channelId == *query.
getChannelType()) {
1599 if (index < nbRegistrations)
1605 *response.
getMessage() = QString(
"Message to add a channel (MsgAddChannel) was submitted successfully");
1621 *error.
getMessage() = QString(
"Device set at %1 is not a transmit device set").arg(deviceSetIndex);
1626 int nbRegistrations = channelRegistrations->size();
1628 for (; index < nbRegistrations; index++)
1630 if (channelRegistrations->at(index).m_channelId == *query.
getChannelType()) {
1635 if (index < nbRegistrations)
1641 *response.
getMessage() = QString(
"Message to add a channel (MsgAddChannel) was submitted successfully");
1655 *error.
getMessage() = QString(
"This type of device is not implemented yet");
1662 *error.
getMessage() = QString(
"There is no device set with index %1").arg(deviceSetIndex);
1679 if (channelIndex < deviceSet->getNumberOfRxChannels())
1685 *response.
getMessage() = QString(
"Message to delete a channel (MsgDeleteChannel) was submitted successfully");
1692 *error.
getMessage() = QString(
"There is no channel at index %1. There are %2 Rx channels")
1694 .arg(channelIndex < deviceSet->getNumberOfRxChannels());
1700 if (channelIndex < deviceSet->getNumberOfTxChannels())
1706 *response.
getMessage() = QString(
"Message to delete a channel (MsgDeleteChannel) was submitted successfully");
1713 *error.
getMessage() = QString(
"There is no channel at index %1. There are %2 Tx channels")
1715 .arg(channelIndex < deviceSet->getNumberOfRxChannels());
1722 *error.
getMessage() = QString(
"DeviceSet error");
1729 *error.
getMessage() = QString(
"There is no device set with index %1").arg(deviceSetIndex);
1750 if (channelAPI == 0)
1752 *error.
getMessage() = QString(
"There is no channel with index %1").arg(channelIndex);
1767 if (channelAPI == 0)
1769 *error.
getMessage() = QString(
"There is no channel with index %1").arg(channelIndex);
1782 *error.
getMessage() = QString(
"DeviceSet error");
1788 *error.
getMessage() = QString(
"There is no device set with index %1").arg(deviceSetIndex);
1809 if (channelAPI == 0)
1811 *error.
getMessage() = QString(
"There is no channel with index %1").arg(channelIndex);
1826 if (channelAPI == 0)
1828 *error.
getMessage() = QString(
"There is no channel with index %1").arg(channelIndex);
1841 *error.
getMessage() = QString(
"DeviceSet error");
1847 *error.
getMessage() = QString(
"There is no device set with index %1").arg(deviceSetIndex);
1856 const QStringList& channelSettingsKeys,
1870 if (channelAPI == 0)
1872 *error.
getMessage() = QString(
"There is no channel with index %1").arg(channelIndex);
1877 QString channelType;
1886 *error.
getMessage() = QString(
"There is no channel type %1 at index %2. Found %3.")
1898 if (channelAPI == 0)
1900 *error.
getMessage() = QString(
"There is no channel with index %1").arg(channelIndex);
1905 QString channelType;
1914 *error.
getMessage() = QString(
"There is no channel type %1 at index %2. Found %3.")
1924 *error.
getMessage() = QString(
"DeviceSet error");
1930 *error.
getMessage() = QString(
"There is no device set with index %1").arg(deviceSetIndex);
1937 deviceSetList->
init();
1944 QList<SWGSDRangel::SWGDeviceSet*> *deviceSets = deviceSetList->
getDeviceSets();
1953 swgDeviceSet->
init();
1955 samplingDevice->
init();
1956 samplingDevice->
setIndex(deviceUISetIndex);
1975 QList<SWGSDRangel::SWGChannel*> *channels = swgDeviceSet->
getChannels();
1980 channels->back()->init();
1984 channels->back()->setUid(channel->
getUID());
1986 channel->
getTitle(*channels->back()->getTitle());
2007 QList<SWGSDRangel::SWGChannel*> *channels = swgDeviceSet->
getChannels();
2012 channels->back()->init();
2016 channels->back()->setUid(channel->
getUID());
2018 channel->
getTitle(*channels->back()->getTitle());
2025 channelsDetail->
init();
2027 QString channelReportError;
2032 QList<SWGSDRangel::SWGChannel*> *channels = channelsDetail->
getChannels();
2037 channels->back()->init();
2041 channels->back()->setUid(channel->
getUID());
2043 channel->
getTitle(*channels->back()->getTitle());
2047 if (channel->
webapiReportGet(*channelReport, channelReportError) != 501) {
2048 channels->back()->setReport(channelReport);
2050 delete channelReport;
2058 QList<SWGSDRangel::SWGChannel*> *channels = channelsDetail->
getChannels();
2063 channels->back()->init();
2067 channels->back()->setUid(channel->
getUID());
2069 channel->
getTitle(*channels->back()->getTitle());
2073 if (channel->
webapiReportGet(*channelReport, channelReportError) != 501) {
2074 channels->back()->setReport(channelReport);
2076 delete channelReport;
2084 if (msgTypeString ==
"debug") {
2086 }
else if (msgTypeString ==
"info") {
2088 }
else if (msgTypeString ==
"warning") {
2089 return QtWarningMsg;
2090 }
else if (msgTypeString ==
"error") {
2091 return QtCriticalMsg;
2108 levelStr =
"warning";
virtual int webapiSettingsGet(SWGSDRangel::SWGChannelSettings &response, QString &errorMessage)
QList< SWGChannel * > * getChannels()
static const QString m_defaultDeviceName
float getLatitude() const
const QList< QAudioDeviceInfo > & getInputDevices() const
void setDeviceStreamIndex(qint32 device_stream_index)
const QString & getLogFileName() const
static MsgAddDeviceSet * create(int direction)
void setDeviceHwType(QString *device_hw_type)
uint32_t udpDecimationFactor
QList< ChannelRegistration > ChannelRegistrations
const QString displayedName
virtual int instanceAudioInputCleanupPatch(SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instancePresetFilePut(SWGSDRangel::SWGPresetImport &query, SWGSDRangel::SWGPresetIdentifier &response, SWGSDRangel::SWGErrorResponse &error)
DeviceSampleSink * getSink()
int sequence
The device sequence. >0 when more than one device of the same type is connected.
virtual int devicesetDeviceReportGet(int deviceSetIndex, SWGSDRangel::SWGDeviceReport &response, SWGSDRangel::SWGErrorResponse &error)
QList< SWGDeviceSet * > * getDeviceSets()
std::vector< DeviceSet * > m_deviceSets
void push(Message *message, bool emitSignal=true)
Push message onto queue.
QString displayedName
The human readable name.
virtual int instanceDVSerialGet(SWGSDRangel::SWGDVSerialDevices &response, SWGSDRangel::SWGErrorResponse &error)
virtual int devicesetChannelReportGet(int deviceSetIndex, int channelIndex, SWGSDRangel::SWGChannelReport &response, SWGSDRangel::SWGErrorResponse &error)
void setDspTxBits(qint32 dsp_tx_bits)
bool getUseFileLogger() const
static MsgSavePreset * create(Preset *preset, int deviceSetIndex, bool newPreset)
virtual ~WebAPIAdapterSrv()
void setDspRxBits(qint32 dsp_rx_bits)
virtual int instanceAMBEDevicesPut(SWGSDRangel::SWGAMBEDevices &query, SWGSDRangel::SWGAMBEDevices &response, SWGSDRangel::SWGErrorResponse &error)
ChannelAPI * getChanelSinkAPIAt(int index, int streamIndex=0)
DeviceSampleSource * getSampleSource()
Return pointer to the device sample source (single Rx) or nullptr.
void getDeviceSetList(SWGSDRangel::SWGDeviceSetList *deviceSetList)
PluginAPI::ChannelRegistrations * getRxChannelRegistrations()
void setDeviceSetIndex(qint32 device_set_index)
virtual int instanceDeviceSetDelete(SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
quint64 getCenterFrequency() const
void outputInfosCleanup()
Remove output info from map for output devices not present.
static void getMsgTypeString(const QtMsgType &msgType, QString &level)
virtual int instanceSummary(SWGSDRangel::SWGInstanceSummaryResponse &response, SWGSDRangel::SWGErrorResponse &error)
void setUdpPort(qint32 udp_port)
virtual void getIdentifier(QString &id)=0
DeviceSampleSource * getSource()
bool getUseLogFile() const
SWGPreferences * getPreferences()
virtual int devicesetDeviceRunDelete(int deviceSetIndex, SWGSDRangel::SWGDeviceState &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceDeviceSetsGet(SWGSDRangel::SWGDeviceSetList &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceAudioOutputDelete(SWGSDRangel::SWGAudioOutputDevice &response, SWGSDRangel::SWGErrorResponse &error)
uint32_t getDeviceItemIndex() const
virtual int instanceLoggingGet(SWGSDRangel::SWGLoggingInfo &response, SWGSDRangel::SWGErrorResponse &error)
QString hardwareId
The internal id that identifies the type of hardware (i.e. HackRF, BladeRF, ...)
virtual int instanceLocationGet(SWGSDRangel::SWGLocationInformation &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceAMBEDevicesGet(SWGSDRangel::SWGAMBEDevices &response, SWGSDRangel::SWGErrorResponse &error)
DSPDeviceSourceEngine * m_deviceSourceEngine
virtual const PluginDescriptor & getPluginDescriptor() const =0
QString * getDeviceHwType()
void setDirection(qint32 direction)
virtual int instanceDelete(SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
virtual int devicesetChannelSettingsGet(int deviceSetIndex, int channelIndex, SWGSDRangel::SWGChannelSettings &response, SWGSDRangel::SWGErrorResponse &error)
bool isSourcePreset() const
MessageQueue m_inputMessageQueue
void setNbOutputDevices(qint32 nb_output_devices)
uint32_t getDeviceNbItems() const
void setDirection(qint32 direction)
void scan(std::vector< QString > &ambeDevices)
void setSequence(qint32 sequence)
SWGDeviceSetList * getDevicesetlist()
QString * getDescription()
QList< SWGAudioInputDevice * > * getInputDevices()
WebAPIAdapterSrv(MainCore &mainCore)
void setChannelType(QString *channel_type)
AudioOutput::UDPChannelCodec udpChannelCodec
virtual int instanceDevices(int direction, SWGSDRangel::SWGInstanceDevicesResponse &response, SWGSDRangel::SWGErrorResponse &error)
virtual int webapiReportGet(SWGSDRangel::SWGChannelReport &response, QString &errorMessage)
PluginAPI::ChannelRegistrations * getTxChannelRegistrations()
DeviceSampleSink * getSampleSink()
Return pointer to the device sample sink (single Tx) or nullptr.
bool registerController(const std::string &deviceRef)
create a new controller for the device in reference
void setConsoleMinLogLevel(const QtMsgType &minLogLevel)
Preset * newPreset(const QString &group, const QString &description)
void setCenterFrequency(qint64 center_frequency)
virtual int devicesetFocusPatch(int deviceSetIndex, SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
void setChannelcount(qint32 channelcount)
QList< SWGPresetGroup * > * getGroups()
virtual qint64 getCenterFrequency() const =0
Applies to a default stream.
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
SWGLoggingInfo * getLogging()
void getDVSerialNames(std::vector< std::string > &deviceNames)
SWGPresetIdentifier * getPreset()
void setChannelcount(qint32 channelcount)
void setDevicecount(qint32 devicecount)
virtual int webapiReportGet(SWGSDRangel::SWGDeviceReport &response, QString &errorMessage)
SWGPresetIdentifier * getPreset()
virtual int webapiSettingsPutPatch(bool force, const QStringList &deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage)
virtual int instanceConfigGet(SWGSDRangel::SWGInstanceConfigResponse &response, SWGSDRangel::SWGErrorResponse &error)
virtual int getSampleRate() const =0
Sample rate exposed by the source.
virtual int instanceAudioOutputCleanupPatch(SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
static MsgDeleteChannel * create(int deviceSetIndex, int channelIndex, bool tx)
QList< SWGChannel * > * getChannels()
SWGSamplingDevice * getSamplingDevice()
bool getInputDeviceName(int inputDeviceIndex, QString &deviceName) const
void setUdpAddress(QString *udp_address)
virtual int instanceAMBEDevicesDelete(SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
void getDeviceSet(SWGSDRangel::SWGDeviceSet *swgDeviceSet, const DeviceSet *deviceSet, int deviceUISetIndex)
void setOutputDeviceInfo(int outputDeviceIndex, const OutputDeviceInfo &deviceInfo)
virtual int devicesetDeviceSettingsGet(int deviceSetIndex, SWGSDRangel::SWGDeviceSettings &response, SWGSDRangel::SWGErrorResponse &error)
void getChannelsDetail(SWGSDRangel::SWGChannelsDetail *channelsDetail, const DeviceSet *deviceSet)
int getPresetCount() const
void setChannelType(QString *channel_type)
virtual quint64 getCenterFrequency() const =0
Center frequency exposed by the sink.
AMBEEngine * getAMBEEngine()
virtual int devicesetChannelDelete(int deviceSetIndex, int channelIndex, SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instancePresetsGet(SWGSDRangel::SWGPresets &response, SWGSDRangel::SWGErrorResponse &error)
void setNbDevices(qint32 nb_devices)
QList< SWGPreset * > * getPresets()
virtual int webapiSettingsPutPatch(bool force, const QStringList &channelSettingsKeys, SWGSDRangel::SWGChannelSettings &response, QString &errorMessage)
virtual int instanceAudioInputDelete(SWGSDRangel::SWGAudioInputDevice &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceDVSerialPatch(bool dvserial, SWGSDRangel::SWGDVSerialDevices &response, SWGSDRangel::SWGErrorResponse &error)
void setSampleRate(qint32 sample_rate)
QtMsgType getFileMinLogLevel() const
void setChannelcount(qint32 channelcount)
QString * getDisplayedName()
QList< SWGDVSerialDevice * > * getDvSerialDevices()
int deviceNbItems
Number of items (or streams) in the device. >1 for composite devices.
void setDirection(qint32 direction)
bool getInputDeviceInfo(const QString &deviceName, InputDeviceInfo &deviceInfo) const
void setFileMinLogLevel(const QtMsgType &minLogLevel)
QByteArray serialize() const
virtual int instanceAMBEDevicesPatch(SWGSDRangel::SWGAMBEDevices &query, SWGSDRangel::SWGAMBEDevices &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instancePresetPost(SWGSDRangel::SWGPresetTransfer &query, SWGSDRangel::SWGPresetIdentifier &response, SWGSDRangel::SWGErrorResponse &error)
void inputInfosCleanup()
Remove input info from map for input devices not present.
static MsgDeletePreset * create(const Preset *preset)
void setDescription(const QString &description)
static MsgAddChannel * create(int deviceSetIndex, int channelRegistrationIndex, bool tx)
static void webapiFormatPreferences(SWGSDRangel::SWGPreferences *apiPreferences, const Preferences &preferences)
QString * getUdpAddress()
void setNbGroups(qint32 nb_groups)
void setNbDevices(qint32 nb_devices)
virtual int webapiRun(bool run, SWGSDRangel::SWGDeviceState &response, QString &errorMessage)
void setUdpDecimationFactor(qint32 udp_decimation_factor)
static QtMsgType getMsgTypeFromString(const QString &msgTypeString)
virtual int devicesetDeviceSettingsPutPatch(int deviceSetIndex, bool force, const QStringList &deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings &response, SWGSDRangel::SWGErrorResponse &error)
bool getOutputDeviceInfo(const QString &deviceName, OutputDeviceInfo &deviceInfo) const
void setGroup(const QString &group)
QString * getChannelType()
PluginManager * m_pluginManager
void setDeviceStreamIndex(qint32 device_stream_index)
qtwebapp::LoggerWithFile * m_logger
void setDVSerialSupport(bool support)
void setLongitude(float longitude)
bool getOutputDeviceName(int outputDeviceIndex, QString &deviceName) const
const MainSettings & getMainSettings() const
virtual int instanceAudioGet(SWGSDRangel::SWGAudioDevices &response, SWGSDRangel::SWGErrorResponse &error)
void setNbInputDevices(qint32 nb_input_devices)
void setIndex(qint32 index)
virtual int webapiSettingsPutPatch(bool force, const QStringList &deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage)
ChannelAPI * getChanelSourceAPIAt(int index, int streamIndex=0)
qint32 getDeviceStreamIndex()
float getLongitude() const
const QList< QAudioDeviceInfo > & getOutputDevices() const
virtual int instancePresetPut(SWGSDRangel::SWGPresetTransfer &query, SWGSDRangel::SWGPresetIdentifier &response, SWGSDRangel::SWGErrorResponse &error)
void setDirection(qint32 direction)
void unsetInputDeviceInfo(int inputDeviceIndex)
QList< SWGDeviceListItem * > * getDevices()
int claimed
This is the device set index if claimed else -1.
virtual int instanceLoggingPut(SWGSDRangel::SWGLoggingInfo &query, SWGSDRangel::SWGLoggingInfo &response, SWGSDRangel::SWGErrorResponse &error)
void setIndex(qint32 index)
void setDeviceNbStreams(qint32 device_nb_streams)
virtual int instancePresetPatch(SWGSDRangel::SWGPresetTransfer &query, SWGSDRangel::SWGPresetIdentifier &response, SWGSDRangel::SWGErrorResponse &error)
virtual int webapiSettingsGet(SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage)
const Preset * getPreset(int index) const
void setDeviceNbStreams(qint32 device_nb_streams)
QString * getChannelType()
QString serial
The device serial number defined by the vendor or a fake one (SDRplay)
void getDeviceEngineStateStr(QString &state)
virtual void getTitle(QString &title)=0
static MsgRemoveLastDeviceSet * create()
void setUdpChannelCodec(qint32 udp_channel_codec)
void setUseLogFile(bool useLogFile)
const QString & getSamplingDeviceSerial() const
MessageQueue * getInputMessageQueue()
virtual int instanceLocationPut(SWGSDRangel::SWGLocationInformation &response, SWGSDRangel::SWGErrorResponse &error)
int getNbRxSamplingDevices() const
AudioDeviceManager * getAudioDeviceManager()
virtual int webapiRunGet(SWGSDRangel::SWGDeviceState &response, QString &errorMessage)
AudioOutput::UDPChannelMode udpChannelMode
void getFileMinMessageLevelStr(QString &levelStr)
virtual int instanceDeviceSetPost(int direction, SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
qint32 getUdpChannelMode()
static MsgLoadPreset * create(const Preset *preset, int deviceSetIndex)
const PluginInterface::SamplingDevice * getTxSamplingDevice(int deviceIndex) const
const Preferences & getPreferences() const
virtual int devicesetChannelsReportGet(int deviceSetIndex, SWGSDRangel::SWGChannelsDetail &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instancePresetDelete(SWGSDRangel::SWGPresetIdentifier &response, SWGSDRangel::SWGErrorResponse &error)
const QString & getHardwareId() const
static MsgDeleteInstance * create()
QList< SWGAudioOutputDevice * > * getOutputDevices()
QList< SWGAMBEDevice * > * getAmbeDevices()
int getNbSourceChannels() const
virtual int devicesetChannelSettingsPutPatch(int deviceSetIndex, int channelIndex, bool force, const QStringList &channelSettingsKeys, SWGSDRangel::SWGChannelSettings &response, SWGSDRangel::SWGErrorResponse &error)
bool deserialize(const QByteArray &data)
virtual int devicesetGet(int deviceSetIndex, SWGSDRangel::SWGDeviceSet &response, SWGSDRangel::SWGErrorResponse &error)
SWGPreset * getWorkingPreset()
void setDevicesetcount(qint32 devicesetcount)
void setInputDeviceInfo(int inputDeviceIndex, const InputDeviceInfo &deviceInfo)
virtual int instanceAudioInputPatch(SWGSDRangel::SWGAudioInputDevice &response, const QStringList &audioInputKeys, SWGSDRangel::SWGErrorResponse &error)
virtual int devicesetChannelPost(int deviceSetIndex, SWGSDRangel::SWGChannelSettings &query, SWGSDRangel::SWGSuccessResponse &response, SWGSDRangel::SWGErrorResponse &error)
void setLatitude(float latitude)
const PluginInterface::SamplingDevice * getRxSamplingDevice(int deviceIndex) const
QString * getConsoleLevel()
qint64 getCenterFrequency()
void getConsoleMinMessageLevelStr(QString &levelStr)
virtual int devicesetDeviceRunPost(int deviceSetIndex, SWGSDRangel::SWGDeviceState &response, SWGSDRangel::SWGErrorResponse &error)
StreamType streamType
This is the type of stream supported.
virtual int instanceChannels(int direction, SWGSDRangel::SWGInstanceChannelsResponse &response, SWGSDRangel::SWGErrorResponse &error)
virtual int instanceAudioOutputPatch(SWGSDRangel::SWGAudioOutputDevice &response, const QStringList &audioOutputKeys, SWGSDRangel::SWGErrorResponse &error)
virtual int getSampleRate() const =0
Sample rate exposed by the sink.
void setCenterFrequency(qint64 center_frequency)
virtual int webapiRunGet(SWGSDRangel::SWGDeviceState &response, QString &errorMessage)
QString * getArchitecture()
virtual int webapiRun(bool run, SWGSDRangel::SWGDeviceState &response, QString &errorMessage)
void setSequence(qint32 sequence)
QtMsgType getConsoleMinLogLevel() const
static void webapiFormatPreset(SWGSDRangel::SWGPreset *apiPreset, const Preset &preset)
void setUdpUsesRtp(qint32 udp_uses_rtp)
const QString & getDescription() const
int getIndexInDeviceSet() const
virtual quint64 getCenterFrequency() const =0
Center frequency exposed by the source.
void setBandwidth(qint32 bandwidth)
virtual int instancePresetFilePost(SWGSDRangel::SWGPresetExport &query, SWGSDRangel::SWGPresetIdentifier &response, SWGSDRangel::SWGErrorResponse &error)
static DeviceEnumerator * instance()
virtual int instanceAMBESerialGet(SWGSDRangel::SWGDVSerialDevices &response, SWGSDRangel::SWGErrorResponse &error)
DSPDeviceSinkEngine * m_deviceSinkEngine
uint32_t getSamplingDeviceSequence() const
int deviceItemIndex
For composite devices this is the Rx or Tx stream index. -1 if not initialized.
void setDirection(qint32 direction)
void setDirection(qint32 direction)
virtual int devicesetDevicePut(int deviceSetIndex, SWGSDRangel::SWGDeviceListItem &query, SWGSDRangel::SWGDeviceListItem &response, SWGSDRangel::SWGErrorResponse &error)
void getLogFileName(QString &fileName)
const Preset & getWorkingPresetConst() const
virtual int webapiSettingsGet(SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage)
const QString & getGroup() const
virtual int devicesetDeviceRunGet(int deviceSetIndex, SWGSDRangel::SWGDeviceState &response, SWGSDRangel::SWGErrorResponse &error)
void setDeviceHwType(QString *device_hw_type)
void releaseController(const std::string &deviceRef)
release controller resources for the device in reference
void setLogFileName(const QString &value)
virtual int webapiReportGet(SWGSDRangel::SWGDeviceReport &response, QString &errorMessage)
void setCopyToUdp(qint32 copy_to_udp)
int getNbTxSamplingDevices() const
void setDumpToFile(qint32 dump_to_file)
static MsgSetDevice * create(int deviceSetIndex, int deviceIndex, int deviceType)
QList< SWGChannelListItem * > * getChannels()
void setUdpChannelMode(qint32 udp_channel_mode)
qint32 getDeviceSetIndex()
int getNbSinkChannels() const