本文整理汇总了C++中uhd::usrp::multi_usrp::sptr::get_tx_bandwidth方法的典型用法代码示例。如果您正苦于以下问题:C++ sptr::get_tx_bandwidth方法的具体用法?C++ sptr::get_tx_bandwidth怎么用?C++ sptr::get_tx_bandwidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uhd::usrp::multi_usrp::sptr
的用法示例。
在下文中一共展示了sptr::get_tx_bandwidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_tx_parameters
//.........这里部分代码省略.........
// ANTENNA FUNCTIONS
os << std::endl << "********** TX ANTENNA ***********" << std::endl;
// Current Tx Antenna
os << std::endl << "-----> Get TX Antenna" << std::endl;
try
{
os << "TX Antenna: " ;
string tx_antenna = usrp->get_tx_antenna(nchan);
os << tx_antenna << endl;
}
catch(uhd::runtime_error &e)
{
os << "Exception code: " << e.code() <<endl;
}
// TX Antenna choices
os << std::endl << "-----> Get Tx Antenna List" << std::endl;
try
{
os << "TX Antennas : " << std::endl;
std::vector<std::string> tx_antennas = usrp->get_tx_antennas(nchan);
for (int index =0; index < tx_antennas.size(); index++)
os << "\t" << tx_antennas[index] << std::endl;
}
catch(uhd::runtime_error &e)
{
os << "Exception code: " << e.code() <<endl;
}
// TX BANDWIDTH FUNCTIONS
os << std::endl << "********** TX BANDWIDTH ***********" << std::endl;
// Current TX Bandwidth
os << endl << "-----> Get TX Bandwidth" << endl;
try
{
os << "TX Bandwidth " ;
double tx_bandwidth = usrp->get_tx_bandwidth(nchan);
os << tx_bandwidth << endl;
}
catch (uhd::runtime_error &e)
{
os << "Exception occured " << e.code() << endl;
}
// TX Bandwidth Range
os << endl << "-----> Get TX Bandwidth Range" << endl;
try
{
os << "TX Bandwidth Range: " ;
uhd::gain_range_t tx_bandwidth_range = usrp->get_tx_bandwidth_range(nchan);
os << "Start: " << tx_bandwidth_range .start() << " End: " << tx_bandwidth_range .stop() << " Step: " << tx_bandwidth_range .step() << endl;
}
catch(uhd::runtime_error &e)
{
os << "Exception code: " << e.code() <<endl;
}
// TX DBOARD INTERFACE OBJECT
os << std::endl << "********** TX DBOARD INTERFACE ***********" << std::endl;
// TX Dboard Interface
os << endl << "-----> Get tx_dboard_iface()" << endl;
try
{
os << "TX Dboard Interface " ;
uhd::usrp::dboard_iface::sptr tx_dboard_iface = usrp->get_tx_dboard_iface(nchan);
os << tx_dboard_iface << endl;
}
catch (uhd::runtime_error &e)
{
os << "Exception occured " << e.code() << endl;
}
// TX _SENSORS
os << std::endl << "********** TX Sensors ***********" << std::endl;
// List of all available sensors
os << std::endl << "-----> Get TX Sensors Name" << std::endl;
std::vector<std::string> tx_sensor_names = usrp->get_tx_sensor_names(nchan);
os << "Sensor Names: " << std::endl;
for (int index =0; index < tx_sensor_names.size(); index++)
{
// Name
os << "\t" << tx_sensor_names[index] << ": ";
// Value
try
{
uhd::sensor_value_t tx_sensor_value = usrp->get_tx_sensor(tx_sensor_names[index], nchan);
os << tx_sensor_value.to_pp_string()<< std::endl;
}
catch(uhd::runtime_error &e)
{
os << "Exception occured " << e.code() << endl;
}
}
}