Skip to content

Commit

Permalink
fix: set default AGC set point to -30dBfs and add check in 'setFreque…
Browse files Browse the repository at this point in the history
…ncy()' to make sure frequency is valid
  • Loading branch information
fventuri committed Jun 23, 2023
1 parent c4bb9af commit ab0f516
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ SoapySDRPlay::SoapySDRPlay(const SoapySDR::Kwargs &args)
// - DC correction: on
// - IQ balance: on

// change the default AGC set point to -30dBfs
chParams->ctrlParams.agc.setPoint_dBfs = -30;

// process additional device string arguments
for (std::pair<std::string, std::string> arg : args) {
// ignore 'driver', 'label', 'mode', 'serial', and 'soapy'
Expand Down Expand Up @@ -610,6 +613,13 @@ void SoapySDRPlay::setFrequency(const int direction,
{
std::lock_guard <std::mutex> lock(_general_state_mutex);

SoapySDR::RangeList frequencyRange = SoapySDRPlay::getFrequencyRange(direction, channel, name);
if (!(frequency >= frequencyRange.front().minimum() && frequency <= frequencyRange.back().maximum()))
{
SoapySDR_logf(SOAPY_SDR_WARNING, "RF center frequency out of range - frequency=%lg", frequency);
return;
}

if (direction == SOAPY_SDR_RX)
{
if ((name == "RF") && (chParams->tunerParams.rfFreq.rfHz != (uint32_t)frequency))
Expand Down

0 comments on commit ab0f516

Please sign in to comment.