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

Web API: implemented instanceDVSerialGet

This commit is contained in:
f4exb
2018-08-02 23:05:53 +02:00
parent e1bef01b96
commit eef1ce9a64
214 changed files with 1063 additions and 218 deletions
+14 -1
View File
@@ -607,7 +607,20 @@ void WebAPIRequestMapper::instanceDVSerialService(qtwebapp::HttpRequest& request
response.setHeader("Content-Type", "application/json");
response.setHeader("Access-Control-Allow-Origin", "*");
if (request.getMethod() == "PATCH")
if (request.getMethod() == "GET")
{
SWGSDRangel::SWGDVSeralDevices normalResponse;
int status = m_adapter->instanceDVSerialGet(normalResponse, errorResponse);
response.setStatus(status);
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
}
}
else if (request.getMethod() == "PATCH")
{
QByteArray dvserialStr = request.getParameter("dvserial");
bool dvserial = false;