diff --git a/plugins/channeltx/modchirpchat/chirpchatmod.cpp b/plugins/channeltx/modchirpchat/chirpchatmod.cpp index 0adbbfe15..5254689c9 100644 --- a/plugins/channeltx/modchirpchat/chirpchatmod.cpp +++ b/plugins/channeltx/modchirpchat/chirpchatmod.cpp @@ -330,6 +330,9 @@ void ChirpChatMod::applySettings(const ChirpChatModSettings& settings, bool forc } } + if ((settings.m_messageRepeat != m_settings.m_messageRepeat) || force) { + reverseAPIKeys.append("messageRepeat"); + } if ((settings.m_udpEnabled != m_settings.m_udpEnabled) || force) { reverseAPIKeys.append("udpEnabled"); } @@ -549,13 +552,13 @@ void ChirpChatMod::webapiUpdateChannelSettings( settings.m_messageRepeat = response.getChirpChatModSettings()->getMessageRepeat(); } if (channelSettingsKeys.contains("udpEnabled")) { - settings.m_udpEnabled = response.getPacketDemodSettings()->getUdpEnabled(); + settings.m_udpEnabled = response.getChirpChatModSettings()->getUdpEnabled(); } if (channelSettingsKeys.contains("udpAddress")) { - settings.m_udpAddress = *response.getPacketDemodSettings()->getUdpAddress(); + settings.m_udpAddress = *response.getChirpChatModSettings()->getUdpAddress(); } if (channelSettingsKeys.contains("udpPort")) { - settings.m_udpPort = response.getPacketDemodSettings()->getUdpPort(); + settings.m_udpPort = response.getChirpChatModSettings()->getUdpPort(); } if (channelSettingsKeys.contains("rgbColor")) { settings.m_rgbColor = response.getChirpChatModSettings()->getRgbColor(); @@ -698,6 +701,7 @@ void ChirpChatMod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& bytesStr->push_back(new QString(tr("%1").arg(b, 2, 16, QChar('0')))); } + response.getChirpChatModSettings()->setMessageRepeat(settings.m_messageRepeat); response.getChirpChatModSettings()->setUdpEnabled(settings.m_udpEnabled); response.getChirpChatModSettings()->setUdpAddress(new QString(settings.m_udpAddress)); response.getChirpChatModSettings()->setUdpPort(settings.m_udpPort); @@ -732,6 +736,7 @@ void ChirpChatMod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& resp response.getChirpChatModReport()->setPayloadTimeMs(m_currentPayloadTime); response.getChirpChatModReport()->setTotalTimeMs(m_currentPayloadTime + controlMs); response.getChirpChatModReport()->setSymbolTimeMs(4.0 * fourthsMs); + response.getChirpChatModReport()->setPlaying(getModulatorActive() ? 1 : 0); } void ChirpChatMod::webapiReverseSendSettings(QList& channelSettingsKeys, const ChirpChatModSettings& settings, bool force) diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 38b54fa11..e01040003 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -3556,6 +3556,10 @@ margin-bottom: 20px; "type" : "number", "format" : "float", "description" : "total message duration inc. preamble and SFD (ms)" + }, + "playing" : { + "type" : "integer", + "description" : "Boolean - modulator is active (playing) including idle time\n * 0 - Modulator not active\n * 1 - Modulator active\n" } }, "description" : "ChirpChatMod" @@ -51367,7 +51371,7 @@ except ApiException as e:
- Generated 2021-11-21T00:20:10.840+01:00 + Generated 2021-11-21T11:04:18.372+01:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/ChirpChatMod.yaml b/sdrbase/resources/webapi/doc/swagger/include/ChirpChatMod.yaml index f33edaf6e..51d0ba3d4 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/ChirpChatMod.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/ChirpChatMod.yaml @@ -179,3 +179,9 @@ ChirpChatModReport: description: total message duration inc. preamble and SFD (ms) type: number format: float + playing: + type: integer + description: > + Boolean - modulator is active (playing) including idle time + * 0 - Modulator not active + * 1 - Modulator active diff --git a/swagger/sdrangel/api/swagger/include/ChirpChatMod.yaml b/swagger/sdrangel/api/swagger/include/ChirpChatMod.yaml index f33edaf6e..51d0ba3d4 100644 --- a/swagger/sdrangel/api/swagger/include/ChirpChatMod.yaml +++ b/swagger/sdrangel/api/swagger/include/ChirpChatMod.yaml @@ -179,3 +179,9 @@ ChirpChatModReport: description: total message duration inc. preamble and SFD (ms) type: number format: float + playing: + type: integer + description: > + Boolean - modulator is active (playing) including idle time + * 0 - Modulator not active + * 1 - Modulator active diff --git a/swagger/sdrangel/code/qt5/client/SWGChirpChatModReport.cpp b/swagger/sdrangel/code/qt5/client/SWGChirpChatModReport.cpp index 29dded288..3e47a6044 100644 --- a/swagger/sdrangel/code/qt5/client/SWGChirpChatModReport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGChirpChatModReport.cpp @@ -38,6 +38,8 @@ SWGChirpChatModReport::SWGChirpChatModReport() { m_payload_time_ms_isSet = false; total_time_ms = 0.0f; m_total_time_ms_isSet = false; + playing = 0; + m_playing_isSet = false; } SWGChirpChatModReport::~SWGChirpChatModReport() { @@ -56,6 +58,8 @@ SWGChirpChatModReport::init() { m_payload_time_ms_isSet = false; total_time_ms = 0.0f; m_total_time_ms_isSet = false; + playing = 0; + m_playing_isSet = false; } void @@ -65,6 +69,7 @@ SWGChirpChatModReport::cleanup() { + } SWGChirpChatModReport* @@ -88,6 +93,8 @@ SWGChirpChatModReport::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&total_time_ms, pJson["totalTimeMs"], "float", ""); + ::SWGSDRangel::setValue(&playing, pJson["playing"], "qint32", ""); + } QString @@ -119,6 +126,9 @@ SWGChirpChatModReport::asJsonObject() { if(m_total_time_ms_isSet){ obj->insert("totalTimeMs", QJsonValue(total_time_ms)); } + if(m_playing_isSet){ + obj->insert("playing", QJsonValue(playing)); + } return obj; } @@ -173,6 +183,16 @@ SWGChirpChatModReport::setTotalTimeMs(float total_time_ms) { this->m_total_time_ms_isSet = true; } +qint32 +SWGChirpChatModReport::getPlaying() { + return playing; +} +void +SWGChirpChatModReport::setPlaying(qint32 playing) { + this->playing = playing; + this->m_playing_isSet = true; +} + bool SWGChirpChatModReport::isSet(){ @@ -193,6 +213,9 @@ SWGChirpChatModReport::isSet(){ if(m_total_time_ms_isSet){ isObjectUpdated = true; break; } + if(m_playing_isSet){ + isObjectUpdated = true; break; + } }while(false); return isObjectUpdated; } diff --git a/swagger/sdrangel/code/qt5/client/SWGChirpChatModReport.h b/swagger/sdrangel/code/qt5/client/SWGChirpChatModReport.h index 2b24d3249..12000aad3 100644 --- a/swagger/sdrangel/code/qt5/client/SWGChirpChatModReport.h +++ b/swagger/sdrangel/code/qt5/client/SWGChirpChatModReport.h @@ -56,6 +56,9 @@ public: float getTotalTimeMs(); void setTotalTimeMs(float total_time_ms); + qint32 getPlaying(); + void setPlaying(qint32 playing); + virtual bool isSet() override; @@ -75,6 +78,9 @@ private: float total_time_ms; bool m_total_time_ms_isSet; + qint32 playing; + bool m_playing_isSet; + }; }