From 3fd5eb4522e84bd5523d36895e64e7fd8566bf53 Mon Sep 17 00:00:00 2001 From: ismagom Date: Mon, 1 Feb 2016 11:11:59 +0100 Subject: [PATCH] Forgot to increase counter --- srslte/lib/rf/src/rf_uhd_imp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/srslte/lib/rf/src/rf_uhd_imp.c b/srslte/lib/rf/src/rf_uhd_imp.c index 639190211..5dccd2794 100644 --- a/srslte/lib/rf/src/rf_uhd_imp.c +++ b/srslte/lib/rf/src/rf_uhd_imp.c @@ -431,6 +431,7 @@ int rf_uhd_recv_with_time(void *h, rf_uhd_handler_t *handler = (rf_uhd_handler_t*) h; size_t rxd_samples; uhd_rx_metadata_handle *md = &handler->rx_md_first; + int trials = 0; if (blocking) { int n = 0; cf_t *data_c = (cf_t*) data; @@ -451,7 +452,8 @@ int rf_uhd_recv_with_time(void *h, } md = &handler->rx_md; n += rxd_samples; - } while (n < nsamples); + trials++; + } while (n < nsamples && trials < 100); } else { void **buffs_ptr = (void**) &data; return uhd_rx_streamer_recv(handler->rx_stream, buffs_ptr, @@ -479,6 +481,7 @@ int rf_uhd_send_timed(void *h, if (has_time_spec) { uhd_tx_metadata_set_time_spec(&handler->tx_md, secs, frac_secs); } + int trials = 0; if (blocking) { int n = 0; cf_t *data_c = (cf_t*) data; @@ -511,7 +514,8 @@ int rf_uhd_send_timed(void *h, // Increase time spec uhd_tx_metadata_add_time_spec(&handler->tx_md, txd_samples/handler->tx_rate); n += txd_samples; - } while (n < nsamples); + trials++; + } while (n < nsamples && trials < 100); return nsamples; } else { const void **buffs_ptr = (const void**) &data;