本文整理汇总了C++中uhd::usrp::multi_usrp::sptr::get_tx_num_channels方法的典型用法代码示例。如果您正苦于以下问题:C++ sptr::get_tx_num_channels方法的具体用法?C++ sptr::get_tx_num_channels怎么用?C++ sptr::get_tx_num_channels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uhd::usrp::multi_usrp::sptr
的用法示例。
在下文中一共展示了sptr::get_tx_num_channels方法的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
//.........这里部分代码省略.........