srsLTE: sidelink minor corrections

master
Xavier Arteaga 5 years ago committed by Andre Puschmann
parent 7de51c8236
commit 0912701cb0

@ -80,30 +80,30 @@ typedef struct {
} srslte_chest_sl_t; } srslte_chest_sl_t;
int srslte_chest_sl_init_psbch_dmrs(srslte_chest_sl_t* q); SRSLTE_API 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); SRSLTE_API 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, SRSLTE_API int srslte_chest_sl_put_psbch_dmrs(srslte_chest_sl_t* q,
cf_t* sf_buffer, cf_t* sf_buffer,
srslte_sl_tm_t tx_mode, srslte_sl_tm_t tx_mode,
uint32_t nof_prb, uint32_t nof_prb,
srslte_cp_t cp); srslte_cp_t cp);
void srslte_chest_sl_psbch_ls_estimate_equalize(srslte_chest_sl_t* q, SRSLTE_API void srslte_chest_sl_psbch_ls_estimate_equalize(srslte_chest_sl_t* q,
cf_t* sf_buffer, cf_t* sf_buffer,
cf_t* sf_buffer_rx, cf_t* sf_buffer_rx,
uint32_t nof_prb, uint32_t nof_prb,
srslte_sl_tm_t txMode, srslte_sl_tm_t txMode,
srslte_cp_t cp); srslte_cp_t cp);
int srslte_chest_sl_get_psbch_dmrs(srslte_chest_sl_t* q, SRSLTE_API int srslte_chest_sl_get_psbch_dmrs(srslte_chest_sl_t* q,
cf_t* sf_buffer_rx, cf_t* sf_buffer_rx,
cf_t** dmrs_received, cf_t** dmrs_received,
srslte_sl_tm_t tx_mode, srslte_sl_tm_t tx_mode,
uint32_t nof_prb, uint32_t nof_prb,
srslte_cp_t cp); srslte_cp_t cp);
void srslte_chest_sl_free(srslte_chest_sl_t* q); SRSLTE_API void srslte_chest_sl_free(srslte_chest_sl_t* q);
#endif #endif

@ -74,8 +74,6 @@ typedef struct SRSLTE_API {
float* llr; float* llr;
// interleaving // interleaving
uint8_t* temp_g_bits;
uint32_t* interleaver;
uint32_t* interleaver_lut; uint32_t* interleaver_lut;
// scrambling // scrambling

@ -65,7 +65,7 @@ void parse_args(int argc, char** argv)
while ((opt = getopt(argc, argv, "cdeisptv")) != -1) { while ((opt = getopt(argc, argv, "cdeisptv")) != -1) {
switch (opt) { switch (opt) {
case 'c': case 'c':
N_sl_id = atoi(argv[optind]); N_sl_id = (int32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'd': case 'd':
use_standard_lte_rates = true; use_standard_lte_rates = true;
@ -80,10 +80,10 @@ void parse_args(int argc, char** argv)
input_file_name = argv[optind]; input_file_name = argv[optind];
break; break;
case 'p': case 'p':
nof_prb = atoi(argv[optind]); nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 't': case 't':
switch (atoi(argv[optind])) { switch (strtol(argv[optind], NULL, 10)) {
case 1: case 1:
tm = SRSLTE_SIDELINK_TM1; tm = SRSLTE_SIDELINK_TM1;
break; break;
@ -99,7 +99,6 @@ void parse_args(int argc, char** argv)
default: default:
usage(argv[0]); usage(argv[0]);
exit(-1); exit(-1);
break;
} }
break; break;
case 'v': case 'v':

@ -51,16 +51,16 @@ void parse_args(int argc, char** argv)
while ((opt = getopt(argc, argv, "ceiptv")) != -1) { while ((opt = getopt(argc, argv, "ceiptv")) != -1) {
switch (opt) { switch (opt) {
case 'c': case 'c':
N_sl_id = atoi(argv[optind]); N_sl_id = (int32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'e': case 'e':
cp = SRSLTE_CP_EXT; cp = SRSLTE_CP_EXT;
break; break;
case 'p': case 'p':
nof_prb = atoi(argv[optind]); nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 't': case 't':
switch (atoi(argv[optind])) { switch (strtol(argv[optind], NULL, 10)) {
case 1: case 1:
tm = SRSLTE_SIDELINK_TM1; tm = SRSLTE_SIDELINK_TM1;
break; break;

@ -71,13 +71,13 @@ void parse_args(int argc, char** argv)
max_subframes = strtoul(argv[optind], NULL, 0); max_subframes = strtoul(argv[optind], NULL, 0);
break; break;
case 'p': case 'p':
nof_prb = atoi(argv[optind]); nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 's': case 's':
snr = atof(argv[optind]); snr = strtof(argv[optind], NULL);
break; break;
case 't': case 't':
switch (atoi(argv[optind])) { switch (strtol(argv[optind], NULL, 10)) {
case 1: case 1:
tm = SRSLTE_SIDELINK_TM1; tm = SRSLTE_SIDELINK_TM1;
break; break;
@ -93,7 +93,6 @@ void parse_args(int argc, char** argv)
default: default:
usage(argv[0]); usage(argv[0]);
exit(-1); exit(-1);
break;
} }
break; break;
case 'v': case 'v':

@ -67,7 +67,7 @@ void parse_args(int argc, char** argv)
while ((opt = getopt(argc, argv, "cdefiopstv")) != -1) { while ((opt = getopt(argc, argv, "cdefiopstv")) != -1) {
switch (opt) { switch (opt) {
case 'c': case 'c':
N_sl_id = atoi(argv[optind]); N_sl_id = (int32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'd': case 'd':
use_standard_lte_rates = true; use_standard_lte_rates = true;
@ -76,22 +76,22 @@ void parse_args(int argc, char** argv)
cp = SRSLTE_CP_EXT; cp = SRSLTE_CP_EXT;
break; break;
case 'f': case 'f':
frequency_offset = atof(argv[optind]); frequency_offset = strtof(argv[optind], NULL);
break; break;
case 'i': case 'i':
input_file_name = argv[optind]; input_file_name = argv[optind];
break; break;
case 'o': case 'o':
offset = atoi(argv[optind]); offset = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 'p': case 'p':
nof_prb = atoi(argv[optind]); nof_prb = (uint32_t)strtol(argv[optind], NULL, 10);
break; break;
case 's': case 's':
snr = atof(argv[optind]); snr = strtof(argv[optind], NULL);
break; break;
case 't': case 't':
switch (atoi(argv[optind])) { switch (strtol(argv[optind], NULL, 10)) {
case 1: case 1:
tm = SRSLTE_SIDELINK_TM1; tm = SRSLTE_SIDELINK_TM1;
break; break;
@ -107,7 +107,6 @@ void parse_args(int argc, char** argv)
default: default:
usage(argv[0]); usage(argv[0]);
exit(-1); exit(-1);
break;
} }
break; break;
case 'v': case 'v':
@ -235,7 +234,7 @@ int main(int argc, char** argv)
if (samples_read != samples_to_read) { if (samples_read != samples_to_read) {
printf("Couldn't read %i samples\n", samples_to_read); printf("Couldn't read %i samples\n", samples_to_read);
return SRSLTE_ERROR; goto clean_exit;
} }
// Find sync signals // Find sync signals
@ -262,7 +261,6 @@ int main(int argc, char** argv)
(int)t[0].tv_sec * 1e6 + (int)t[0].tv_usec); (int)t[0].tv_sec * 1e6 + (int)t[0].tv_usec);
sync = true; sync = true;
break;
} }
} else { } else {
// Sample offset correction // Sample offset correction
@ -278,6 +276,7 @@ int main(int argc, char** argv)
} }
} }
clean_exit:
srslte_filesource_free(&fsrc); srslte_filesource_free(&fsrc);
srslte_ofdm_tx_free(&ifft); srslte_ofdm_tx_free(&ifft);
srslte_ssss_free(&ssss); srslte_ssss_free(&ssss);

Loading…
Cancel
Save