Added timeout to cuhd_recv

This commit is contained in:
ismagom 2014-12-18 10:43:05 +00:00
parent 5e6abc7186
commit a25fa6a435
4 changed files with 8 additions and 4 deletions

View File

@ -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);

View File

@ -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
};
/**********************************************************************

View File

@ -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
};
/**********************************************************************

View File

@ -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};