当前位置: 首页>>代码示例>>C++>>正文


C++ sptr::get_tx_subdev_spec方法代码示例

本文整理汇总了C++中uhd::usrp::multi_usrp::sptr::get_tx_subdev_spec方法的典型用法代码示例。如果您正苦于以下问题:C++ sptr::get_tx_subdev_spec方法的具体用法?C++ sptr::get_tx_subdev_spec怎么用?C++ sptr::get_tx_subdev_spec使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在uhd::usrp::multi_usrp::sptr的用法示例。


在下文中一共展示了sptr::get_tx_subdev_spec方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: get_tx_parameters

void get_tx_parameters(uhd::usrp::multi_usrp::sptr usrp, size_t mboard, std::ostream & os)
{
	using namespace std;
	namespace radio = uhd::usrp;

	size_t nchan = 0;

	// CONFIGURATION SUB_DEVICE
	
	os << std::endl << "********** TX Sub Device ***********" << std::endl;
	// Get sub device specification
	os << std::endl << "-----> Get TX Subdevice" << std::endl;
	try
	{
	os << "TX Subdevice Specification: ";
	radio::subdev_spec_t tx_subdev = usrp->get_tx_subdev_spec(mboard);
	os << tx_subdev.to_pp_string() << endl;
	}
	catch(uhd::runtime_error &e)
	{
		os << " Exception occurred : " << e.code() << endl;
	}
	
	// Number of tx channels
	os << std::endl << "-----> Get number of TX channels" << std::endl;
	try
	{
	size_t num_tx = usrp->get_tx_num_channels();
	os << "Number of TX channels: " ;
	os << num_tx << endl;
	}
	catch (uhd::runtime_error &e)
	{
		os << " Exception occurred : " << e.code() << endl;
	}
	
	// TX Device Name
	os << std::endl << "-----> Get TX Subdevice Name" << std::endl;
	try
	{
	os << "TX Subdevice Name: ";
	string tx_name = usrp->get_tx_subdev_name(nchan);
	os << tx_name << endl;
	}
	catch (uhd::runtime_error &e)
	{
		os << " Exception occurred : " << e.code() << endl;
	}
	
	// TX SAMPLE RATE
	
	os << std::endl << "********** TX Sample Rate ***********" << std::endl;
	
	// Get Current TX rate
	os << std::endl << "-----> Get TX Rate" << std::endl;
	try
	{
		os << "TX Rate: " ;
		double tx_rate = usrp->get_tx_rate(nchan);
		os << tx_rate << endl;
	}
	catch (uhd::runtime_error &e)
	{
		os << " Exception occurred : " << e.code() << endl;
	}
	
	// Get list of TX rates
	os << std::endl << "-----> Get TX Rate List" << std::endl;
	try
	{
		os << "TX Rate List: " ;
		uhd::meta_range_t tx_rates = usrp->get_tx_rates(nchan);
		os << "Start: " << tx_rates.start() << "   Stop: " << tx_rates.stop() << "   Step: " << tx_rates.step() << endl;
		os << tx_rates.to_pp_string() << endl;
	}
	catch (uhd::runtime_error &e)
	{
		os << " Exception occurred : " << e.code() << endl;
	}

	// TX FREQUENCIES
	
	os << std::endl << "********** TX Frequencies ***********" << std::endl;
	
	// Current TX frequency
	os << std::endl << "-----> Get TX Center Frequency" << std::endl;
	try
	{
		os << "TX Freq: ";
		double tx_freq = usrp->get_tx_freq(nchan);
		os << tx_freq << endl;
	}
	catch (uhd::runtime_error &e)
	{
		os << " Exception occurred : " << e.code() << endl;
	}

	// TX Frequency Range
	os << std::endl << "-----> Get TX Center Frequency Range" << std::endl;
	try
//.........这里部分代码省略.........
开发者ID:Radioguy00,项目名称:E100_Og2Modem,代码行数:101,代码来源:uhd_utilities.cpp


注:本文中的uhd::usrp::multi_usrp::sptr::get_tx_subdev_spec方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。