1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 06:04:39 -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
+24
View File
@@ -508,6 +508,30 @@ int WebAPIAdapterSrv::instanceLocationPut(
return 200;
}
int WebAPIAdapterSrv::instanceDVSerialGet(
SWGSDRangel::SWGDVSeralDevices& response,
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{
response.init();
std::vector<std::string> deviceNames;
m_mainCore.m_dspEngine->getDVSerialNames(deviceNames);
response.setNbDevices((int) deviceNames.size());
QList<SWGSDRangel::SWGDVSerialDevice*> *deviceNamesList = response.getDvSerialDevices();
std::vector<std::string>::iterator it = deviceNames.begin();
while (it != deviceNames.end())
{
deviceNamesList->append(new SWGSDRangel::SWGDVSerialDevice);
deviceNamesList->back()->init();
*deviceNamesList->back()->getDeviceName() = QString::fromStdString(*it);
++it;
}
return 200;
}
int WebAPIAdapterSrv::instanceDVSerialPatch(
bool dvserial,
SWGSDRangel::SWGDVSeralDevices& response,