Skip to content

Commit e0aeb37

Browse files
committed
Fixed gains.
1 parent fb5a777 commit e0aeb37

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sources/radio/sdr_device_reader.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,15 @@ void SdrDeviceReader::updateDevice(Device& device, const SoapySDR::Kwargs args)
4646
device.connected = true;
4747
device.driver = driver;
4848
device.sample_rates = getSampleRates(sdr);
49+
const auto backupGains = device.gains;
4950
device.gains = getGains(sdr);
51+
for (auto& gain : device.gains) {
52+
for (auto& backupGain : backupGains) {
53+
if (gain.name == backupGain.name) {
54+
gain.value = backupGain.value;
55+
}
56+
}
57+
}
5058

5159
SoapySDR::Device::unmake(sdr);
5260
}

0 commit comments

Comments
 (0)