1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 21:54:55 -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 -1
View File
@@ -507,6 +507,30 @@ int WebAPIAdapterGUI::instanceLocationPut(
return 200;
}
int WebAPIAdapterGUI::instanceDVSerialGet(
SWGSDRangel::SWGDVSeralDevices& response,
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{
response.init();
std::vector<std::string> deviceNames;
m_mainWindow.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 WebAPIAdapterGUI::instanceDVSerialPatch(
bool dvserial,
SWGSDRangel::SWGDVSeralDevices& response,
@@ -524,7 +548,6 @@ int WebAPIAdapterGUI::instanceDVSerialPatch(
QList<SWGSDRangel::SWGDVSerialDevice*> *deviceNamesList = response.getDvSerialDevices();
std::vector<std::string>::iterator it = deviceNames.begin();
std::string deviceNamesStr = "DV Serial devices found: ";
while (it != deviceNames.end())
{