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