diff --git a/plugins/channeltx/modrtty/rttymod.cpp b/plugins/channeltx/modrtty/rttymod.cpp index bea321832..3faf11046 100644 --- a/plugins/channeltx/modrtty/rttymod.cpp +++ b/plugins/channeltx/modrtty/rttymod.cpp @@ -30,8 +30,8 @@ #include "SWGWorkspaceInfo.h" #include "SWGChannelReport.h" #include "SWGChannelActions.h" -/*#include "SWGRttyModReport.h" -#include "SWGRttyModActions.h"*/ +#include "SWGRTTYModReport.h" +#include "SWGRTTYModActions.h" #include #include @@ -262,10 +262,6 @@ void RttyMod::applySettings(const RttyModSettings& settings, bool force) reverseAPIKeys.append("rfNoise"); } - if ((settings.m_writeToFile != m_settings.m_writeToFile) || force) { - reverseAPIKeys.append("writeToFile"); - } - if ((settings.m_data != m_settings.m_data) || force) { reverseAPIKeys.append("data"); } @@ -382,10 +378,10 @@ int RttyMod::webapiSettingsGet( QString& errorMessage) { (void) errorMessage; - /*response.setRttyModSettings(new SWGSDRangel::SWGRttyModSettings()); + response.setRttyModSettings(new SWGSDRangel::SWGRTTYModSettings()); response.getRttyModSettings()->init(); webapiFormatChannelSettings(response, m_settings); - */ + return 200; } @@ -427,7 +423,7 @@ void RttyMod::webapiUpdateChannelSettings( const QStringList& channelSettingsKeys, SWGSDRangel::SWGChannelSettings& response) { - /*if (channelSettingsKeys.contains("inputFrequencyOffset")) { + if (channelSettingsKeys.contains("inputFrequencyOffset")) { settings.m_inputFrequencyOffset = response.getRttyModSettings()->getInputFrequencyOffset(); } if (channelSettingsKeys.contains("baud")) { @@ -448,9 +444,6 @@ void RttyMod::webapiUpdateChannelSettings( if (channelSettingsKeys.contains("repeat")) { settings.m_repeat = response.getRttyModSettings()->getRepeat() != 0; } - if (channelSettingsKeys.contains("repeatDelay")) { - settings.m_repeatDelay = response.getRttyModSettings()->getRepeatDelay(); - } if (channelSettingsKeys.contains("repeatCount")) { settings.m_repeatCount = response.getRttyModSettings()->getRepeatCount(); } @@ -463,9 +456,6 @@ void RttyMod::webapiUpdateChannelSettings( if (channelSettingsKeys.contains("rfNoise")) { settings.m_rfNoise = response.getRttyModSettings()->getRfNoise() != 0; } - if (channelSettingsKeys.contains("writeToFile")) { - settings.m_writeToFile = response.getRttyModSettings()->getWriteToFile() != 0; - } if (channelSettingsKeys.contains("data")) { settings.m_data = *response.getRttyModSettings()->getData(); } @@ -513,7 +503,7 @@ void RttyMod::webapiUpdateChannelSettings( } if (settings.m_rollupState && channelSettingsKeys.contains("rollupState")) { settings.m_rollupState->updateFrom(channelSettingsKeys, response.getRttyModSettings()->getRollupState()); - }*/ + } } int RttyMod::webapiReportGet( @@ -521,9 +511,9 @@ int RttyMod::webapiReportGet( QString& errorMessage) { (void) errorMessage; - /*response.setRttyModReport(new SWGSDRangel::SWGRttyModReport()); + response.setRttyModReport(new SWGSDRangel::SWGRTTYModReport()); response.getRttyModReport()->init(); - webapiFormatChannelReport(response);*/ + webapiFormatChannelReport(response); return 200; } @@ -532,7 +522,7 @@ int RttyMod::webapiActionsPost( SWGSDRangel::SWGChannelActions& query, QString& errorMessage) { - /*SWGSDRangel::SWGRttyModActions *swgRttyModActions = query.getRttyModActions(); + SWGSDRangel::SWGRTTYModActions *swgRttyModActions = query.getRttyModActions(); if (swgRttyModActions) { @@ -544,7 +534,7 @@ int RttyMod::webapiActionsPost( && (swgRttyModActions->getPayload()->getData())) { MsgTXPacketData *msg = MsgTXPacketData::create( - *swgRttyModActions->getPayload()->getData( + *swgRttyModActions->getPayload()->getData() ); m_basebandSource->getInputMessageQueue()->push(msg); } @@ -572,25 +562,23 @@ int RttyMod::webapiActionsPost( { errorMessage = "Missing RttyModActions in query"; return 400; - }*/ + } return 0; } void RttyMod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const RttyModSettings& settings) { - /*response.getRttyModSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset); + response.getRttyModSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset); response.getRttyModSettings()->setBaud(settings.m_baud); response.getRttyModSettings()->setRfBandwidth(settings.m_rfBandwidth); response.getRttyModSettings()->setFrequencyShift(settings.m_frequencyShift); response.getRttyModSettings()->setGain(settings.m_gain); response.getRttyModSettings()->setChannelMute(settings.m_channelMute ? 1 : 0); response.getRttyModSettings()->setRepeat(settings.m_repeat ? 1 : 0); - response.getRttyModSettings()->setRepeatDelay(settings.m_repeatDelay); response.getRttyModSettings()->setRepeatCount(settings.m_repeatCount); response.getRttyModSettings()->setLpfTaps(settings.m_lpfTaps); response.getRttyModSettings()->setBbNoise(settings.m_bbNoise ? 1 : 0); response.getRttyModSettings()->setRfNoise(settings.m_rfNoise ? 1 : 0); - response.getRttyModSettings()->setWriteToFile(settings.m_writeToFile ? 1 : 0); if (response.getRttyModSettings()->getData()) { *response.getRttyModSettings()->getData() = settings.m_data; @@ -651,13 +639,13 @@ void RttyMod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& respo settings.m_rollupState->formatTo(swgRollupState); response.getRttyModSettings()->setRollupState(swgRollupState); } - }*/ + } } void RttyMod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) { - /*response.getRttyModReport()->setChannelPowerDb(CalcDb::dbPower(getMagSq())); - response.getRttyModReport()->setChannelSampleRate(m_basebandSource->getChannelSampleRate());*/ + response.getRttyModReport()->setChannelPowerDb(CalcDb::dbPower(getMagSq())); + response.getRttyModReport()->setChannelSampleRate(m_basebandSource->getChannelSampleRate()); } void RttyMod::webapiReverseSendSettings(QList& channelSettingsKeys, const RttyModSettings& settings, bool force) @@ -717,12 +705,12 @@ void RttyMod::webapiFormatChannelSettings( bool force ) { - /*swgChannelSettings->setDirection(1); // single source (Tx) + swgChannelSettings->setDirection(1); // single source (Tx) swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet()); swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex()); swgChannelSettings->setChannelType(new QString(m_channelId)); - swgChannelSettings->setRttyModSettings(new SWGSDRangel::SWGRttyModSettings()); - SWGSDRangel::SWGRttyModSettings *swgRttyModSettings = swgChannelSettings->getRttyModSettings(); + swgChannelSettings->setRttyModSettings(new SWGSDRangel::SWGRTTYModSettings()); + SWGSDRangel::SWGRTTYModSettings *swgRttyModSettings = swgChannelSettings->getRttyModSettings(); // transfer data that has been modified. When force is on transfer all data except reverse API data @@ -747,9 +735,6 @@ void RttyMod::webapiFormatChannelSettings( if (channelSettingsKeys.contains("repeat") || force) { swgRttyModSettings->setRepeat(settings.m_repeat ? 1 : 0); } - if (channelSettingsKeys.contains("repeatDelay") || force) { - swgRttyModSettings->setRepeatDelay(settings.m_repeatDelay); - } if (channelSettingsKeys.contains("repeatCount") || force) { swgRttyModSettings->setRepeatCount(settings.m_repeatCount); } @@ -762,9 +747,6 @@ void RttyMod::webapiFormatChannelSettings( if (channelSettingsKeys.contains("rfNoise")) { swgRttyModSettings->setRfNoise(settings.m_rfNoise ? 1 : 0); } - if (channelSettingsKeys.contains("writeToFile")) { - swgRttyModSettings->setWriteToFile(settings.m_writeToFile ? 1 : 0); - } if (channelSettingsKeys.contains("data")) { swgRttyModSettings->setData(new QString(settings.m_data)); } @@ -805,7 +787,7 @@ void RttyMod::webapiFormatChannelSettings( SWGSDRangel::SWGRollupState *swgRollupState = new SWGSDRangel::SWGRollupState(); settings.m_rollupState->formatTo(swgRollupState); swgRttyModSettings->setRollupState(swgRollupState); - }*/ + } } void RttyMod::networkManagerFinished(QNetworkReply *reply) diff --git a/plugins/channeltx/modrtty/rttymodwebapiadapter.cpp b/plugins/channeltx/modrtty/rttymodwebapiadapter.cpp index 9e51721be..c86197520 100644 --- a/plugins/channeltx/modrtty/rttymodwebapiadapter.cpp +++ b/plugins/channeltx/modrtty/rttymodwebapiadapter.cpp @@ -31,9 +31,9 @@ int RttyModWebAPIAdapter::webapiSettingsGet( QString& errorMessage) { (void) errorMessage; - /*response.setRttyModSettings(new SWGSDRangel::SWGRttyModSettings()); + response.setRttyModSettings(new SWGSDRangel::SWGRTTYModSettings()); response.getRttyModSettings()->init(); - RttyMod::webapiFormatChannelSettings(response, m_settings);*/ + RttyMod::webapiFormatChannelSettings(response, m_settings); return 200; } diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 495206ba0..9a38ff8e2 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -3484,6 +3484,9 @@ margin-bottom: 20px; "RadioAstronomyActions" : { "$ref" : "#/definitions/RadioAstronomyActions" }, + "RTTYModActions" : { + "$ref" : "#/definitions/RTTYModActions" + }, "SigMFFileSinkActions" : { "$ref" : "#/definitions/SigMFFileSinkActions" } @@ -3773,6 +3776,9 @@ margin-bottom: 20px; "RemoteSourceReport" : { "$ref" : "#/definitions/RemoteSourceReport" }, + "RTTYModReport" : { + "$ref" : "#/definitions/RTTYModReport" + }, "PacketDemodReport" : { "$ref" : "#/definitions/PacketDemodReport" }, @@ -3904,6 +3910,9 @@ margin-bottom: 20px; "RTTYDemodSettings" : { "$ref" : "#/definitions/RTTYDemodSettings" }, + "RTTYModSettings" : { + "$ref" : "#/definitions/RTTYModSettings" + }, "HeatMapSettings" : { "$ref" : "#/definitions/HeatMapSettings" }, @@ -5895,7 +5904,8 @@ margin-bottom: 20px; }, "bandwidth" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "bandwidth ratio [0.0, 1.0]" } }, "description" : "FFT filter band definition" @@ -7269,11 +7279,13 @@ margin-bottom: 20px; "description" : "Identifier of the channel or feature plugin providing azimuth and elevation (E.g. R0:0 ADSBDemod)" }, "azimuthOffset" : { - "type" : "integer", + "type" : "number", + "format" : "float", "description" : "Azimuth offset in degrees" }, "elevationOffset" : { - "type" : "integer", + "type" : "number", + "format" : "float", "description" : "Elevation offset in degrees" }, "azimuthMin" : { @@ -8960,7 +8972,7 @@ margin-bottom: 20px; }, "fftOn" : { "type" : "integer", - "description" : "Activate FFT multiband filter\n * 0 - do not run flter\n * 1 - run filter\n" + "description" : "Activate FFT multiband filter\n * 0 - do not run filter\n * 1 - run filter\n" }, "log2FFT" : { "type" : "integer", @@ -8977,7 +8989,8 @@ margin-bottom: 20px; } }, "reverseFilter" : { - "type" : "integer" + "type" : "integer", + "description" : "* 0 - band definitions are bandpass * 1 - band definitions are band reject\n" }, "streamIndex" : { "type" : "integer", @@ -9446,7 +9459,8 @@ margin-bottom: 20px; "description" : "Angle to rotate the image by" }, "text" : { - "type" : "string" + "type" : "string", + "description" : "Text to draw on the map when item is selected" }, "latitude" : { "type" : "number", @@ -9519,7 +9533,7 @@ margin-bottom: 20px; "labelAltitudeOffset" : { "type" : "number", "format" : "float", - "description" : "Veritical offset to position label at" + "description" : "Vertical offset to position label at" }, "modelAltitudeOffset" : { "type" : "number", @@ -9605,7 +9619,8 @@ margin-bottom: 20px; "description" : "Angle to rotate the image by" }, "text" : { - "type" : "string" + "type" : "string", + "description" : "Text to draw on the map when item is selected" }, "latitude" : { "type" : "number", @@ -9678,7 +9693,7 @@ margin-bottom: 20px; "labelAltitudeOffset" : { "type" : "number", "format" : "float", - "description" : "Veritical offset to position label at" + "description" : "Vertical offset to position label at" }, "modelAltitudeOffset" : { "type" : "number", @@ -11747,6 +11762,140 @@ margin-bottom: 20px; } }, "description" : "ACARSDemod" +}; + defs.RTTYModActions = { + "properties" : { + "tx" : { + "type" : "integer", + "description" : "Transmit current text\n * 0 - Do nothing\n * 1 - Transmit\n" + }, + "payload" : { + "$ref" : "#/definitions/RTTYModActions_payload" + } + }, + "description" : "RTTYMod" +}; + defs.RTTYModActions_payload = { + "properties" : { + "data" : { + "type" : "string" + } + } +}; + defs.RTTYModReport = { + "properties" : { + "channelPowerDB" : { + "type" : "number", + "format" : "float", + "description" : "power transmitted in channel (dB)" + }, + "channelSampleRate" : { + "type" : "integer" + } + }, + "description" : "RTTYMod" +}; + defs.RTTYModSettings = { + "properties" : { + "inputFrequencyOffset" : { + "type" : "integer", + "format" : "int64" + }, + "baud" : { + "type" : "number", + "format" : "float", + "description" : "Baud rate" + }, + "rfBandwidth" : { + "type" : "integer" + }, + "frequencyShift" : { + "type" : "integer" + }, + "gain" : { + "type" : "number", + "format" : "float" + }, + "channelMute" : { + "type" : "integer" + }, + "repeat" : { + "type" : "integer" + }, + "repeatCount" : { + "type" : "integer" + }, + "lpfTaps" : { + "type" : "integer" + }, + "bbNoise" : { + "type" : "integer", + "description" : "Boolean\n * 0 - off\n * 1 - on\n" + }, + "rfNoise" : { + "type" : "integer", + "description" : "Boolean\n * 0 - off\n * 1 - on\n" + }, + "data" : { + "type" : "string" + }, + "pulseShaping" : { + "type" : "integer", + "description" : "Boolean\n * 0 - off\n * 1 - on\n" + }, + "beta" : { + "type" : "number", + "format" : "float" + }, + "symbolSpan" : { + "type" : "integer" + }, + "udpEnabled" : { + "type" : "integer", + "description" : "Whether to receive text to transmit on specified UDP port" + }, + "udpAddress" : { + "type" : "string", + "description" : "UDP address to receive text to transmit via" + }, + "udpPort" : { + "type" : "integer", + "description" : "UDP port to receive text to transmit via" + }, + "rgbColor" : { + "type" : "integer" + }, + "title" : { + "type" : "string" + }, + "streamIndex" : { + "type" : "integer", + "description" : "MIMO channel. Not relevant when connected to SI (single Rx)." + }, + "useReverseAPI" : { + "type" : "integer", + "description" : "Synchronize with reverse API (1 for yes, 0 for no)" + }, + "reverseAPIAddress" : { + "type" : "string" + }, + "reverseAPIPort" : { + "type" : "integer" + }, + "reverseAPIDeviceIndex" : { + "type" : "integer" + }, + "reverseAPIChannelIndex" : { + "type" : "integer" + }, + "channelMarker" : { + "$ref" : "#/definitions/ChannelMarker" + }, + "rollupState" : { + "$ref" : "#/definitions/RollupState" + } + }, + "description" : "RTTYMod" }; defs.RadioAstronomyActions = { "properties" : { @@ -14449,15 +14598,18 @@ margin-bottom: 20px; }, "b" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "Galactic latitude in degrees" }, "l" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "Galactic longitude in degrees" }, "d" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "Distance to object from Sun in kpc" } }, "description" : "Details of object to display in Star Tracker line-of-sight view. Can be sent by other plugins to startracker.display message queue" @@ -14469,15 +14621,18 @@ margin-bottom: 20px; }, "b" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "Galactic latitude in degrees" }, "l" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "Galactic longitude in degrees" }, "d" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "Distance to object from Sun in kpc" } }, "description" : "Details of object to display in Star Tracker line-of-sight view. Can be sent by other plugins to startracker.display message queue" @@ -14490,11 +14645,13 @@ margin-bottom: 20px; }, "azimuth" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "The azimuth angle in degrees to the target" }, "elevation" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "The elevation angle in degrees to the target" } }, "description" : "Settings to display in Star Tracker. Can be sent by other plugins to startracker.display message queue." @@ -14507,11 +14664,13 @@ margin-bottom: 20px; }, "azimuth" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "The azimuth angle in degrees to the target" }, "elevation" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "The elevation angle in degrees to the target" } }, "description" : "Settings to display in Star Tracker. Can be sent by other plugins to startracker.display message queue." @@ -14595,7 +14754,7 @@ margin-bottom: 20px; "temperature" : { "type" : "number", "format" : "float", - "description" : "Air temperature in Celsuis, for refraction" + "description" : "Air temperature in Celsius, for refraction" }, "humidity" : { "type" : "number", @@ -14618,7 +14777,8 @@ margin-bottom: 20px; "description" : "Frequency of radio waves being observed in MHz" }, "stellariumServerEnabled" : { - "type" : "integer" + "type" : "integer", + "description" : "Enable Stellarium server (1 for yes, 0 for no)" }, "stellariumPort" : { "type" : "integer", @@ -14676,15 +14836,18 @@ margin-bottom: 20px; defs.StarTrackerTarget = { "properties" : { "name" : { - "type" : "string" + "type" : "string", + "description" : "The name of the target" }, "azimuth" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "The azimuth angle in degrees to the target" }, "elevation" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "The elevation angle in degrees to the target" }, "ra" : { "type" : "number", @@ -14698,11 +14861,13 @@ margin-bottom: 20px; }, "b" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "Galactic latitude in degrees" }, "l" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "Galactic longitude in degrees" }, "earthRotationVelocity" : { "type" : "number", @@ -14745,15 +14910,18 @@ margin-bottom: 20px; defs.StarTrackerTarget_2 = { "properties" : { "name" : { - "type" : "string" + "type" : "string", + "description" : "The name of the target" }, "azimuth" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "The azimuth angle in degrees to the target" }, "elevation" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "The elevation angle in degrees to the target" }, "ra" : { "type" : "number", @@ -14767,11 +14935,13 @@ margin-bottom: 20px; }, "b" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "Galactic latitude in degrees" }, "l" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "Galactic longitude in degrees" }, "earthRotationVelocity" : { "type" : "number", @@ -14822,15 +14992,18 @@ margin-bottom: 20px; defs.TargetAzimuthElevation = { "properties" : { "name" : { - "type" : "string" + "type" : "string", + "description" : "The name of the target" }, "azimuth" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "The azimuth angle in degrees to the target" }, "elevation" : { "type" : "number", - "format" : "float" + "format" : "float", + "description" : "The elevation angle in degrees to the target" } }, "description" : "A target azimuth and elevation" @@ -22563,7 +22736,7 @@ $(document).ready(function() {

Responses

-

Status: 202 - On successful semding of the message it returns the details of the device being set

+

Status: 202 - On successful sending of the message it returns the details of the device being set