1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-14 15:33:34 -04:00

SoapySDR support: REST API: fixed device report

This commit is contained in:
f4exb
2018-11-15 00:47:15 +01:00
parent da5ac0f0c6
commit 5bf18ade3f
2 changed files with 48 additions and 4 deletions
@@ -1614,4 +1614,26 @@ void SoapySDROutput::webapiFormatArgInfo(const SoapySDR::ArgInfo& arg, SWGSDRang
}
argInfo->setValueString(new QString(arg.value.c_str()));
argInfo->setName(new QString(arg.name.c_str()));
argInfo->setDescription(new QString(arg.description.c_str()));
argInfo->setUnits(new QString(arg.units.c_str()));
if ((arg.range.minimum() != 0.0) || (arg.range.maximum() != 0.0))
{
argInfo->setRange(new SWGSDRangel::SWGRangeFloat());
argInfo->getRange()->setMin(arg.range.minimum());
argInfo->getRange()->setMax(arg.range.maximum());
}
argInfo->setValueOptions(new QList<QString*>);
for (const auto itOpt : arg.options) {
argInfo->getValueOptions()->append(new QString(itOpt.c_str()));
}
argInfo->setOptionNames(new QList<QString*>);
for (const auto itOpt : arg.optionNames) {
argInfo->getOptionNames()->append(new QString(itOpt.c_str()));
}
}