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

Web API: created run state getter. Implemented in RTLSDR

This commit is contained in:
f4exb
2017-12-09 10:49:20 +01:00
parent a27ce7ea89
commit 7d122b6b67
17 changed files with 1300 additions and 26 deletions
+14 -1
View File
@@ -708,7 +708,20 @@ void WebAPIRequestMapper::devicesetDeviceRunService(const std::string& indexStr,
{
int deviceSetIndex = boost::lexical_cast<int>(indexStr);
if (request.getMethod() == "POST")
if (request.getMethod() == "GET")
{
SWGSDRangel::SWGDeviceState normalResponse;
int status = m_adapter->devicesetDeviceRunGet(deviceSetIndex, normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
}
}
else if (request.getMethod() == "POST")
{
SWGSDRangel::SWGDeviceState normalResponse;
int status = m_adapter->devicesetDeviceRunPost(deviceSetIndex, normalResponse, errorResponse);