diff options
Diffstat (limited to 'host/examples')
-rw-r--r-- | host/examples/tx_samples_from_file.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/host/examples/tx_samples_from_file.cpp b/host/examples/tx_samples_from_file.cpp index 89e961b38..695cdf6f4 100644 --- a/host/examples/tx_samples_from_file.cpp +++ b/host/examples/tx_samples_from_file.cpp @@ -44,7 +44,13 @@ void send_from_file( md.end_of_burst = infile.eof(); - tx_stream->send(&buff.front(), num_tx_samps, md); + const size_t samples_sent = tx_stream->send(&buff.front(), num_tx_samps, md); + if (samples_sent != num_tx_samps) { + UHD_LOG_ERROR("TX-STREAM", + "The tx_stream timed out sending " << num_tx_samps << " samples (" + << samples_sent << " sent)."); + return; + } } infile.close(); @@ -179,7 +185,7 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) sensor_names = usrp->get_mboard_sensor_names(0); if ((ref == "mimo") and (std::find(sensor_names.begin(), sensor_names.end(), "mimo_locked") - != sensor_names.end())) { + != sensor_names.end())) { uhd::sensor_value_t mimo_locked = usrp->get_mboard_sensor("mimo_locked", 0); std::cout << boost::format("Checking TX: %s ...") % mimo_locked.to_pp_string() << std::endl; @@ -187,7 +193,7 @@ int UHD_SAFE_MAIN(int argc, char* argv[]) } if ((ref == "external") and (std::find(sensor_names.begin(), sensor_names.end(), "ref_locked") - != sensor_names.end())) { + != sensor_names.end())) { uhd::sensor_value_t ref_locked = usrp->get_mboard_sensor("ref_locked", 0); std::cout << boost::format("Checking TX: %s ...") % ref_locked.to_pp_string() << std::endl; |