From 81a5d4292402923a44868f889203693aa902ded3 Mon Sep 17 00:00:00 2001 From: ismagom Date: Mon, 4 Aug 2014 00:47:46 +0200 Subject: [PATCH] Fixed bug in cell detect not detecting cells with N_id_2!=0 --- lte/phy/examples/pdsch_ue.c | 5 +++-- lte/phy/include/liblte/phy/ue/ue_celldetect.h | 2 +- lte/phy/lib/phch/src/pdsch.c | 2 +- lte/phy/lib/ue/src/ue_celldetect.c | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lte/phy/examples/pdsch_ue.c b/lte/phy/examples/pdsch_ue.c index 09ff59c3f..adf3c8f4b 100644 --- a/lte/phy/examples/pdsch_ue.c +++ b/lte/phy/examples/pdsch_ue.c @@ -219,10 +219,11 @@ int main(int argc, char **argv) { // Plot and Printf if (!(sf_cnt % 10)) { - printf("CFO: %+.4f KHz, SFO: %+.4f Khz, NOI: %.2f Errors: %4d/%4d, BLER: %.1e, Texec: %.2f\r", + printf("CFO: %+.4f KHz, SFO: %+.4f Khz, NOI: %.2f Errors: %4d/%4d/%4d, BLER: %.1e, Texec: %.2f\r", ue_sync_get_cfo(&iodev.sframe)/1000, ue_sync_get_sfo(&iodev.sframe)/1000, pdsch_average_noi(&ue_dl.pdsch), - (int) ue_dl.pkt_errors, (int) ue_dl.pkts_total, (float) ue_dl.pkt_errors / ue_dl.pkts_total, + (int) ue_dl.pkt_errors, (int) ue_dl.pkts_total, (int) ue_dl.nof_trials, + (float) ue_dl.pkt_errors / ue_dl.pkts_total, mean_exec_time); } #ifndef DISABLE_GRAPHICS diff --git a/lte/phy/include/liblte/phy/ue/ue_celldetect.h b/lte/phy/include/liblte/phy/ue/ue_celldetect.h index 4cc10c7a3..778e17508 100644 --- a/lte/phy/include/liblte/phy/ue/ue_celldetect.h +++ b/lte/phy/include/liblte/phy/ue/ue_celldetect.h @@ -67,7 +67,7 @@ #define CS_FRAME_UNALIGNED -3 #define CS_CELL_DETECTED 2 -#define CS_CELL_NOT_DETECTED 1 +#define CS_CELL_NOT_DETECTED 3 typedef struct LIBLTE_API { uint32_t cell_id; diff --git a/lte/phy/lib/phch/src/pdsch.c b/lte/phy/lib/phch/src/pdsch.c index 2326b8f23..2c21b7dd6 100644 --- a/lte/phy/lib/phch/src/pdsch.c +++ b/lte/phy/lib/phch/src/pdsch.c @@ -590,7 +590,7 @@ int pdsch_decode_tb(pdsch_t *q, char *data, uint32_t tbs, uint32_t nb_e, par_tx = bit_unpack(&p_parity, 24); if (!par_rx) { - printf("\n\tCAUTION!! Received all-zero transport block\n\n"); + INFO("\n\tCAUTION!! Received all-zero transport block\n\n", 0); } if (par_rx == par_tx) { diff --git a/lte/phy/lib/ue/src/ue_celldetect.c b/lte/phy/lib/ue/src/ue_celldetect.c index 27cd1b5f8..fa4c75e82 100644 --- a/lte/phy/lib/ue/src/ue_celldetect.c +++ b/lte/phy/lib/ue/src/ue_celldetect.c @@ -211,7 +211,7 @@ int ue_celldetect_scan(ue_celldetect_t * q, for (uint32_t nf=0;nfsfind, q->current_N_id_2); - DEBUG("[%3d/%3d]: Searching cells with N_id_2=%d. %d frames\n", + INFO("[%3d/%3d]: Searching cells with N_id_2=%d. %d frames\n", q->current_nof_detected, q->current_nof_total, q->current_N_id_2, nof_input_frames); /* Find peak and cell id */