Skip to content

Commit

Permalink
ChannelWebAPIUtils::patchDeviceSetting: Add support for sinks and MIMO.
Browse files Browse the repository at this point in the history
  • Loading branch information
srcejon committed Dec 24, 2024
1 parent 56bd20d commit 4510f40
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions sdrbase/channel/channelwebapiutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1319,9 +1319,15 @@ bool ChannelWebAPIUtils::patchDeviceSetting(unsigned int deviceIndex, const QStr
SWGSDRangel::SWGErrorResponse errorResponse2;
delete jsonObj;

DeviceSampleSource *source = deviceSet->m_deviceAPI->getSampleSource();

httpRC = source->webapiSettingsPutPatch(false, deviceSettingsKeys, deviceSettingsResponse, *errorResponse2.getMessage());
if (DeviceSampleSource *source = deviceSet->m_deviceAPI->getSampleSource()) {
httpRC = source->webapiSettingsPutPatch(false, deviceSettingsKeys, deviceSettingsResponse, *errorResponse2.getMessage());
} else if (DeviceSampleSink *sink = deviceSet->m_deviceAPI->getSampleSink()) {
httpRC = sink->webapiSettingsPutPatch(false, deviceSettingsKeys, deviceSettingsResponse, *errorResponse2.getMessage());
} else if (DeviceSampleMIMO *mimo = deviceSet->m_deviceAPI->getSampleMIMO()) {
httpRC = mimo->webapiSettingsPutPatch(false, deviceSettingsKeys, deviceSettingsResponse, *errorResponse2.getMessage());
} else {
httpRC = 404;
}

if (httpRC/100 == 2)
{
Expand Down

0 comments on commit 4510f40

Please sign in to comment.