Browse Source

Fix missing YAML-to-SWG mappings for MeshCore plugins

The MeshCore mod plugin references SWGMeshcoreModActions in
meshcoremod.cpp, but MeshcoreMod.yaml had no MeshcoreModActions
section. When swagger files are regenerated, the auto-generated
SWGChannelActions.h/cpp lose the meshcore_mod_actions member and
accessors, which would break compilation of meshcoremod.cpp.

Changes across five files:

- MeshcoreMod.yaml: add MeshcoreModActions definition (sendNow
  field, matching existing hand-authored SWGMeshcoreModActions)
- ChannelActions.yaml: add MeshcoreModActions  pointing to
  the new section
- SWGModelFactory.h: add #include and create() registration
  block for SWGMeshcoreModActions (was missing despite
  SWGMeshcoreModSettings/MeshcoreDemod* being registered)
- webapirequestmapper.cpp: add channelActionsKey routing branch
  for MeshcoreModActions (was completely absent)
- webapiutils.cpp: add m_channelURIToSettingsKey and
  m_channelTypeToSettingsKey entries for both MeshcoreDemod and
  MeshcoreMod (were missing, unlike ChirpChat and Meshtastic
  which have entries for their channel types)
chirpmodem-v8.0.0
Tom Hensel 4 months ago
parent
commit
583ba39829
No known key found for this signature in database
  1. 5
      sdrbase/webapi/webapirequestmapper.cpp
  2. 4
      sdrbase/webapi/webapiutils.cpp
  3. 2
      swagger/sdrangel/api/swagger/include/ChannelActions.yaml
  4. 10
      swagger/sdrangel/api/swagger/include/MeshcoreMod.yaml
  5. 6
      swagger/sdrangel/code/qt5/client/SWGModelFactory.h

5
sdrbase/webapi/webapirequestmapper.cpp

@ -4855,6 +4855,11 @@ bool WebAPIRequestMapper::getChannelActions( @@ -4855,6 +4855,11 @@ bool WebAPIRequestMapper::getChannelActions(
channelActions->setIeee802154ModActions(new SWGSDRangel::SWGIEEE_802_15_4_ModActions());
channelActions->getIeee802154ModActions()->fromJsonObject(actionsJsonObject);
}
else if (channelActionsKey == "MeshcoreModActions")
{
channelActions->setMeshcoreModActions(new SWGSDRangel::SWGMeshcoreModActions());
channelActions->getMeshcoreModActions()->fromJsonObject(actionsJsonObject);
}
else if (channelActionsKey == "RadioAstronomyActions")
{
channelActions->setRadioAstronomyActions(new SWGSDRangel::SWGRadioAstronomyActions());

4
sdrbase/webapi/webapiutils.cpp

@ -39,6 +39,8 @@ const QMap<QString, QString> WebAPIUtils::m_channelURIToSettingsKey = { @@ -39,6 +39,8 @@ const QMap<QString, QString> WebAPIUtils::m_channelURIToSettingsKey = {
{"sdrangel.channel.chirpchatdemod", "ChirpChatDemodSettings"},
{"sdrangel.channel.meshtasticdemod", "ChirpChatDemodSettings"}, // alias: Meshtastic uses ChirpChatDemodSettings schema
{"sdrangel.channel.modchirpchat", "ChirpChatModSettings"},
{"sdrangel.channel.meshcoredemod", "MeshcoreDemodSettings"},
{"sdrangel.channeltx.modmeshcore", "MeshcoreModSettings"},
{"sdrangel.channel.demodatv", "ATVDemodSettings"},
{"sdrangel.channel.demoddatv", "DATVDemodSettings"},
{"sdrangel.channel.dabdemod", "DABDemodSettings"},
@ -165,6 +167,8 @@ const QMap<QString, QString> WebAPIUtils::m_channelTypeToSettingsKey = { @@ -165,6 +167,8 @@ const QMap<QString, QString> WebAPIUtils::m_channelTypeToSettingsKey = {
{"ChirpChatDemod", "ChirpChatDemodSettings"},
{"MeshtasticDemod", "ChirpChatDemodSettings"}, // alias: Meshtastic uses ChirpChatDemodSettings schema
{"ChirpChatMod", "ChirpChatModSettings"},
{"MeshcoreDemod", "MeshcoreDemodSettings"},
{"MeshcoreMod", "MeshcoreModSettings"},
{"ChannelPower", "ChannelPowerSettings"},
{"DATVDemod", "DATVDemodSettings"},
{"DATVMod", "DATVModSettings"},

2
swagger/sdrangel/api/swagger/include/ChannelActions.yaml

@ -29,6 +29,8 @@ ChannelActions: @@ -29,6 +29,8 @@ ChannelActions:
$ref: "http://swgserver:8081/api/swagger/include/FreqScanner.yaml#/FreqScannerActions"
IEEE_802_15_4_ModActions:
$ref: "http://swgserver:8081/api/swagger/include/IEEE_802_15_4_Mod.yaml#/IEEE_802_15_4_ModActions"
MeshcoreModActions:
$ref: "http://swgserver:8081/api/swagger/include/MeshcoreMod.yaml#/MeshcoreModActions"
PacketModActions:
$ref: "http://swgserver:8081/api/swagger/include/PacketMod.yaml#/PacketModActions"
PSK31ModActions:

10
swagger/sdrangel/api/swagger/include/MeshcoreMod.yaml

@ -126,3 +126,13 @@ MeshcoreModReport: @@ -126,3 +126,13 @@ MeshcoreModReport:
Boolean - modulator is active (playing) including idle time
* 0 - Modulator not active
* 1 - Modulator active
MeshcoreModActions:
description: MeshcoreMod
properties:
sendNow:
type: integer
description: >
Send packet immediately
* 0 - Do nothing
* 1 - Send packet

6
swagger/sdrangel/code/qt5/client/SWGModelFactory.h

@ -234,6 +234,7 @@ @@ -234,6 +234,7 @@
#include "SWGMeshtasticModSettings.h"
#include "SWGMeshcoreDemodReport.h"
#include "SWGMeshcoreDemodSettings.h"
#include "SWGMeshcoreModActions.h"
#include "SWGMeshcoreModReport.h"
#include "SWGMeshcoreModSettings.h"
#include "SWGMetisMISOSettings.h"
@ -1516,6 +1517,11 @@ namespace SWGSDRangel { @@ -1516,6 +1517,11 @@ namespace SWGSDRangel {
obj->init();
return obj;
}
if(QString("SWGMeshcoreModActions").compare(type) == 0) {
SWGMeshcoreModActions *obj = new SWGMeshcoreModActions();
obj->init();
return obj;
}
if(QString("SWGMetisMISOSettings").compare(type) == 0) {
SWGMetisMISOSettings *obj = new SWGMetisMISOSettings();
obj->init();

Loading…
Cancel
Save