1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 06:04:39 -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
@@ -257,6 +257,35 @@ int RigCtlServer::webapiSettingsPutPatch(
return 200;
}
int RigCtlServer::webapiActionsPost(
const QStringList& featureActionsKeys,
SWGSDRangel::SWGFeatureActions& query,
QString& errorMessage)
{
SWGSDRangel::SWGRigCtlServerActions *swgRigCtlServerActions = query.getRigCtlServerActions();
if (swgRigCtlServerActions)
{
if (featureActionsKeys.contains("run"))
{
bool featureRun = swgRigCtlServerActions->getRun() != 0;
MsgStartStop *msg = MsgStartStop::create(featureRun);
getInputMessageQueue()->push(msg);
return 202;
}
else
{
errorMessage = "Unknown action";
return 400;
}
}
else
{
errorMessage = "Missing RigCtlServerActions in query";
return 400;
}
}
void RigCtlServer::webapiFormatFeatureSettings(
SWGSDRangel::SWGFeatureSettings& response,
const RigCtlServerSettings& settings)