From a25fa6a435c8fea10cf251cfa1f8920cb73f5ba2 Mon Sep 17 00:00:00 2001 From: ismagom Date: Thu, 18 Dec 2014 10:43:05 +0000 Subject: [PATCH] Added timeout to cuhd_recv --- cuhd/lib/cuhd_imp.cpp | 6 +++++- lte/examples/cell_measurement.c | 2 +- lte/examples/pdsch_ue.c | 2 +- lte/phy/lib/ch_estimation/src/chest_dl.c | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cuhd/lib/cuhd_imp.cpp b/cuhd/lib/cuhd_imp.cpp index 1f9e60a5b..642f3155d 100644 --- a/cuhd/lib/cuhd_imp.cpp +++ b/cuhd/lib/cuhd_imp.cpp @@ -186,6 +186,7 @@ int cuhd_recv(void *h, void *data, uint32_t nsamples, bool blocking) { cuhd_handler *handler = static_cast < cuhd_handler * >(h); uhd::rx_metadata_t md; + uint32_t nof_packets = 0; if (blocking) { int n = 0, p; complex_t *data_c = (complex_t *) data; @@ -200,7 +201,10 @@ int cuhd_recv(void *h, void *data, uint32_t nsamples, bool blocking) std::cout << "\nError code: " << md.to_pp_string() << "\n\n"; } #endif - } while (n < nsamples && md.error_code == uhd::rx_metadata_t::ERROR_CODE_NONE); + nof_packets++; + } while (n < nsamples && + md.error_code == uhd::rx_metadata_t::ERROR_CODE_NONE && + nof_packets < 10); return nsamples; } else { return handler->rx_stream->recv(data, nsamples, md, 0.0); diff --git a/lte/examples/cell_measurement.c b/lte/examples/cell_measurement.c index c82be280e..0fb5796c1 100644 --- a/lte/examples/cell_measurement.c +++ b/lte/examples/cell_measurement.c @@ -49,7 +49,7 @@ float gain_offset = B210_DEFAULT_GAIN_CORREC; cell_search_cfg_t cell_detect_config = { 5000, // maximum number of frames to receive for MIB decoding 50, // maximum number of frames to receive for PSS correlation - 9.0 // early-stops cell detection if mean PSR is above this value + 16.0 // early-stops cell detection if mean PSR is above this value }; /********************************************************************** diff --git a/lte/examples/pdsch_ue.c b/lte/examples/pdsch_ue.c index 595acc100..2373f98d3 100644 --- a/lte/examples/pdsch_ue.c +++ b/lte/examples/pdsch_ue.c @@ -56,7 +56,7 @@ float gain_offset = B210_DEFAULT_GAIN_CORREC; cell_search_cfg_t cell_detect_config = { 5000, 100, // nof_frames_total - 4.0 // threshold + 16.0 // threshold }; /********************************************************************** diff --git a/lte/phy/lib/ch_estimation/src/chest_dl.c b/lte/phy/lib/ch_estimation/src/chest_dl.c index 89aca49eb..6cf6e0538 100644 --- a/lte/phy/lib/ch_estimation/src/chest_dl.c +++ b/lte/phy/lib/ch_estimation/src/chest_dl.c @@ -118,7 +118,7 @@ int chest_dl_init(chest_dl_t *q, lte_cell_t cell) //float f[3]={0.15, 0.7, 0.15}; //chest_dl_set_filter_freq(q, f, 3); - float f[5]={0.05, 0.15, 0.6, 0.15, 0.05}; + float f[5]={0.02, 0.18, 0.6, 0.18, 0.02}; chest_dl_set_filter_freq(q, f, 5); float t[2]={0.1, 0.9};