1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 21:54:55 -04:00

Implemented run action API in relevant feature plugins

This commit is contained in:
f4exb
2021-10-22 02:01:33 +02:00
parent 9f42957585
commit 920fa82022
55 changed files with 1697 additions and 13 deletions
@@ -390,6 +390,37 @@ int GS232Controller::webapiReportGet(
return 200;
}
int GS232Controller::webapiActionsPost(
const QStringList& featureActionsKeys,
SWGSDRangel::SWGFeatureActions& query,
QString& errorMessage)
{
SWGSDRangel::SWGGS232ControllerActions *swgGS232ControllerActions = query.getGs232ControllerActions();
if (swgGS232ControllerActions)
{
if (featureActionsKeys.contains("run"))
{
bool featureRun = swgGS232ControllerActions->getRun() != 0;
MsgStartStop *msg = MsgStartStop::create(featureRun);
getInputMessageQueue()->push(msg);
return 202;
}
else
{
errorMessage = "Unknown action";
return 400;
}
}
else
{
errorMessage = "Missing GS232ControllerActions in query";
return 400;
}
}
void GS232Controller::webapiFormatFeatureSettings(
SWGSDRangel::SWGFeatureSettings& response,
const GS232ControllerSettings& settings)