diff --git a/lib/include/srslte/phy/ch_estimation/chest_sl.h b/lib/include/srslte/phy/ch_estimation/chest_sl.h index 90bd52aeb..bd297be92 100644 --- a/lib/include/srslte/phy/ch_estimation/chest_sl.h +++ b/lib/include/srslte/phy/ch_estimation/chest_sl.h @@ -80,30 +80,30 @@ typedef struct { } srslte_chest_sl_t; -int srslte_chest_sl_init_psbch_dmrs(srslte_chest_sl_t* q); - -int srslte_chest_sl_gen_psbch_dmrs(srslte_chest_sl_t* q, srslte_sl_tm_t txMode, uint32_t N_sl_id); - -int srslte_chest_sl_put_psbch_dmrs(srslte_chest_sl_t* q, - cf_t* sf_buffer, - srslte_sl_tm_t tx_mode, - uint32_t nof_prb, - srslte_cp_t cp); - -void srslte_chest_sl_psbch_ls_estimate_equalize(srslte_chest_sl_t* q, - cf_t* sf_buffer, - cf_t* sf_buffer_rx, - uint32_t nof_prb, - srslte_sl_tm_t txMode, - srslte_cp_t cp); - -int srslte_chest_sl_get_psbch_dmrs(srslte_chest_sl_t* q, - cf_t* sf_buffer_rx, - cf_t** dmrs_received, - srslte_sl_tm_t tx_mode, - uint32_t nof_prb, - srslte_cp_t cp); - -void srslte_chest_sl_free(srslte_chest_sl_t* q); +SRSLTE_API int srslte_chest_sl_init_psbch_dmrs(srslte_chest_sl_t* q); + +SRSLTE_API int srslte_chest_sl_gen_psbch_dmrs(srslte_chest_sl_t* q, srslte_sl_tm_t txMode, uint32_t N_sl_id); + +SRSLTE_API int srslte_chest_sl_put_psbch_dmrs(srslte_chest_sl_t* q, + cf_t* sf_buffer, + srslte_sl_tm_t tx_mode, + uint32_t nof_prb, + srslte_cp_t cp); + +SRSLTE_API void srslte_chest_sl_psbch_ls_estimate_equalize(srslte_chest_sl_t* q, + cf_t* sf_buffer, + cf_t* sf_buffer_rx, + uint32_t nof_prb, + srslte_sl_tm_t txMode, + srslte_cp_t cp); + +SRSLTE_API int srslte_chest_sl_get_psbch_dmrs(srslte_chest_sl_t* q, + cf_t* sf_buffer_rx, + cf_t** dmrs_received, + srslte_sl_tm_t tx_mode, + uint32_t nof_prb, + srslte_cp_t cp); + +SRSLTE_API void srslte_chest_sl_free(srslte_chest_sl_t* q); #endif \ No newline at end of file diff --git a/lib/include/srslte/phy/phch/psbch.h b/lib/include/srslte/phy/phch/psbch.h index 94b5f5745..66ea73995 100644 --- a/lib/include/srslte/phy/phch/psbch.h +++ b/lib/include/srslte/phy/phch/psbch.h @@ -74,8 +74,6 @@ typedef struct SRSLTE_API { float* llr; // interleaving - uint8_t* temp_g_bits; - uint32_t* interleaver; uint32_t* interleaver_lut; // scrambling diff --git a/lib/src/phy/phch/test/psbch_file_test.c b/lib/src/phy/phch/test/psbch_file_test.c index 2c55331be..c3d618d7b 100644 --- a/lib/src/phy/phch/test/psbch_file_test.c +++ b/lib/src/phy/phch/test/psbch_file_test.c @@ -65,7 +65,7 @@ void parse_args(int argc, char** argv) while ((opt = getopt(argc, argv, "cdeisptv")) != -1) { switch (opt) { case 'c': - N_sl_id = atoi(argv[optind]); + N_sl_id = (int32_t)strtol(argv[optind], NULL, 10); break; case 'd': use_standard_lte_rates = true; @@ -80,10 +80,10 @@ void parse_args(int argc, char** argv) input_file_name = argv[optind]; break; case 'p': - nof_prb = atoi(argv[optind]); + nof_prb = (uint32_t)strtol(argv[optind], NULL, 10); break; case 't': - switch (atoi(argv[optind])) { + switch (strtol(argv[optind], NULL, 10)) { case 1: tm = SRSLTE_SIDELINK_TM1; break; @@ -99,7 +99,6 @@ void parse_args(int argc, char** argv) default: usage(argv[0]); exit(-1); - break; } break; case 'v': diff --git a/lib/src/phy/phch/test/psbch_test.c b/lib/src/phy/phch/test/psbch_test.c index 0cc00fc07..9fb5e0408 100644 --- a/lib/src/phy/phch/test/psbch_test.c +++ b/lib/src/phy/phch/test/psbch_test.c @@ -51,16 +51,16 @@ void parse_args(int argc, char** argv) while ((opt = getopt(argc, argv, "ceiptv")) != -1) { switch (opt) { case 'c': - N_sl_id = atoi(argv[optind]); + N_sl_id = (int32_t)strtol(argv[optind], NULL, 10); break; case 'e': cp = SRSLTE_CP_EXT; break; case 'p': - nof_prb = atoi(argv[optind]); + nof_prb = (uint32_t)strtol(argv[optind], NULL, 10); break; case 't': - switch (atoi(argv[optind])) { + switch (strtol(argv[optind], NULL, 10)) { case 1: tm = SRSLTE_SIDELINK_TM1; break; diff --git a/lib/src/phy/sync/test/psss_file_test.c b/lib/src/phy/sync/test/psss_file_test.c index 797f030ab..50e5bb8fa 100644 --- a/lib/src/phy/sync/test/psss_file_test.c +++ b/lib/src/phy/sync/test/psss_file_test.c @@ -71,13 +71,13 @@ void parse_args(int argc, char** argv) max_subframes = strtoul(argv[optind], NULL, 0); break; case 'p': - nof_prb = atoi(argv[optind]); + nof_prb = (uint32_t)strtol(argv[optind], NULL, 10); break; case 's': - snr = atof(argv[optind]); + snr = strtof(argv[optind], NULL); break; case 't': - switch (atoi(argv[optind])) { + switch (strtol(argv[optind], NULL, 10)) { case 1: tm = SRSLTE_SIDELINK_TM1; break; @@ -93,7 +93,6 @@ void parse_args(int argc, char** argv) default: usage(argv[0]); exit(-1); - break; } break; case 'v': diff --git a/lib/src/phy/sync/test/sync_sl_test.c b/lib/src/phy/sync/test/sync_sl_test.c index 7fe835442..755a9190e 100644 --- a/lib/src/phy/sync/test/sync_sl_test.c +++ b/lib/src/phy/sync/test/sync_sl_test.c @@ -67,7 +67,7 @@ void parse_args(int argc, char** argv) while ((opt = getopt(argc, argv, "cdefiopstv")) != -1) { switch (opt) { case 'c': - N_sl_id = atoi(argv[optind]); + N_sl_id = (int32_t)strtol(argv[optind], NULL, 10); break; case 'd': use_standard_lte_rates = true; @@ -76,22 +76,22 @@ void parse_args(int argc, char** argv) cp = SRSLTE_CP_EXT; break; case 'f': - frequency_offset = atof(argv[optind]); + frequency_offset = strtof(argv[optind], NULL); break; case 'i': input_file_name = argv[optind]; break; case 'o': - offset = atoi(argv[optind]); + offset = (uint32_t)strtol(argv[optind], NULL, 10); break; case 'p': - nof_prb = atoi(argv[optind]); + nof_prb = (uint32_t)strtol(argv[optind], NULL, 10); break; case 's': - snr = atof(argv[optind]); + snr = strtof(argv[optind], NULL); break; case 't': - switch (atoi(argv[optind])) { + switch (strtol(argv[optind], NULL, 10)) { case 1: tm = SRSLTE_SIDELINK_TM1; break; @@ -107,7 +107,6 @@ void parse_args(int argc, char** argv) default: usage(argv[0]); exit(-1); - break; } break; case 'v': @@ -235,7 +234,7 @@ int main(int argc, char** argv) if (samples_read != samples_to_read) { printf("Couldn't read %i samples\n", samples_to_read); - return SRSLTE_ERROR; + goto clean_exit; } // Find sync signals @@ -262,7 +261,6 @@ int main(int argc, char** argv) (int)t[0].tv_sec * 1e6 + (int)t[0].tv_usec); sync = true; - break; } } else { // Sample offset correction @@ -278,6 +276,7 @@ int main(int argc, char** argv) } } +clean_exit: srslte_filesource_free(&fsrc); srslte_ofdm_tx_free(&ifft); srslte_ssss_free(&ssss);