1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-07-28 21:14:15 -04:00

Web API: AirspyHF device report

This commit is contained in:
f4exb
2018-05-26 02:33:35 +02:00
parent 7767d538f6
commit 30cca07554
14 changed files with 294 additions and 5 deletions
@@ -20,6 +20,8 @@
#include "SWGDeviceSettings.h"
#include "SWGDeviceState.h"
#include "SWGDeviceReport.h"
#include "SWGAirspyHFReport.h"
#include <device/devicesourceapi.h>
#include <dsp/filerecord.h>
@@ -561,6 +563,27 @@ void AirspyHFInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& r
}
}
void AirspyHFInput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response)
{
response.getAirspyHfReport()->setSampleRates(new QList<SWGSDRangel::SWGAirspyReport_sampleRates*>);
for (std::vector<uint32_t>::const_iterator it = getSampleRates().begin(); it != getSampleRates().end(); ++it)
{
response.getAirspyHfReport()->getSampleRates()->append(new SWGSDRangel::SWGAirspyReport_sampleRates);
response.getAirspyHfReport()->getSampleRates()->back()->setSampleRate(*it);
}
}
int AirspyHFInput::webapiReportGet(
SWGSDRangel::SWGDeviceReport& response,
QString& errorMessage __attribute__((unused)))
{
response.setAirspyHfReport(new SWGSDRangel::SWGAirspyHFReport());
response.getAirspyHfReport()->init();
webapiFormatDeviceReport(response);
return 200;
}
int AirspyHFInput::webapiRunGet(
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage __attribute__((unused)))