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