mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 15:23:04 +00:00 
			
		
		
		
	Add LimeSDR antenna selection support
This commit is contained in:
		| @@ -66,6 +66,7 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, | ||||
|     sample_rate_ = configuration->property(role + ".sampling_frequency", 2.0e6); | ||||
|     item_type_ = configuration->property(role + ".item_type", default_item_type); | ||||
|     osmosdr_args_ = configuration->property(role + ".osmosdr_args", std::string( )); | ||||
|     antenna_ = configuration->property(role + ".antenna", empty); | ||||
|  | ||||
|     if (item_type_.compare("short") == 0) | ||||
|         { | ||||
| @@ -77,6 +78,14 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, | ||||
|             // 1. Make the driver instance | ||||
|             OsmosdrSignalSource::driver_instance(); | ||||
|  | ||||
| 			// For LimeSDR: Set RX antenna  | ||||
| 			if (!antenna_.empty()) | ||||
| 				{ | ||||
| 					osmosdr_source_->set_antenna(antenna_, 0); | ||||
| 					std::cout << boost::format("Set RX Antenna : %s") % (osmosdr_source_->get_antenna(0)) << std::endl ; | ||||
| 					LOG(INFO) << boost::format("Set RX Antenna : %s") % (osmosdr_source_->get_antenna(0)); | ||||
| 				} | ||||
|  | ||||
|             // 2 set sampling rate | ||||
|             osmosdr_source_->set_sample_rate(sample_rate_); | ||||
|             std::cout << boost::format("Actual RX Rate: %f [SPS]...") % (osmosdr_source_->get_sample_rate()) << std::endl ; | ||||
|   | ||||
| @@ -104,6 +104,8 @@ private: | ||||
|  | ||||
|     osmosdr::source::sptr osmosdr_source_; | ||||
|     std::string osmosdr_args_; | ||||
|      | ||||
|     std::string antenna_; | ||||
|  | ||||
|     boost::shared_ptr<gr::block> valve_; | ||||
|     gr::blocks::file_sink::sptr file_sink_; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 osqzss
					osqzss