1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-29 02:14:51 +00:00

Avoid throwing in the destructor

This commit is contained in:
Carles Fernandez 2018-05-19 20:34:50 +02:00
parent a05952c966
commit b4cc22abc2
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -1,6 +1,6 @@
/*!
* \filei fmcomms2_signal_source.cc
* \brief signal source for sdr hardware from analog devices based on
* \file fmcomms2_signal_source.cc
* \brief Signal source for SDR hardware from Analog Devices based on
* fmcomms2 evaluation board.
* \author Rodrigo Muñoz, 2017, rmunozl(at)inacap.cl
*
@ -36,6 +36,7 @@
#include "GPS_L1_CA.h"
#include "GPS_L2C.h"
#include <glog/logging.h>
#include <exception>
#include <iostream>
@ -70,7 +71,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration
dump_ = configuration->property(role + ".dump", false);
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
//AD9361 Local Oscillator generation for dual band operation
// AD9361 Local Oscillator generation for dual band operation
enable_dds_lo_ = configuration->property(role + ".enable_dds_lo", false);
freq_rf_tx_hz_ = configuration->property(role + ".freq_rf_tx_hz", GPS_L1_FREQ_HZ - GPS_L2_FREQ_HZ - 1000);
freq_dds_tx_hz_ = configuration->property(role + ".freq_dds_tx_hz", 1000);
@ -104,7 +105,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration
rf_port_select_.c_str(), filter_file_.c_str(),
filter_auto_);
//configure LO
// configure LO
if (enable_dds_lo_ == true)
{
std::cout << "Enabling Local Oscillator generator in FMCOMMS2\n";
@ -135,7 +136,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration
gain_mode_rx2_.c_str(), rf_gain_rx2_,
rf_port_select_.c_str(), filter_file_.c_str(),
filter_auto_);
//configure LO
// configure LO
if (enable_dds_lo_ == true)
{
std::cout << "Enabling Local Oscillator generator in FMCOMMS2\n";
@ -179,7 +180,14 @@ Fmcomms2SignalSource::~Fmcomms2SignalSource()
{
if (enable_dds_lo_ == true)
{
ad9361_disable_lo_remote(uri_);
try
{
ad9361_disable_lo_remote(uri_);
}
catch (const std::exception& e)
{
LOG(WARNING) << "Exception thrown in Fmcomms2SignalSource destructor: " << e.what();
}
}
}