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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user