|
|
|
@ -469,7 +469,7 @@ int main(int argc, char **argv) {
|
|
|
|
|
|
|
|
|
|
uint32_t ul_sf_idx = (ue_sync_get_sfidx(&ue_sync)+6)%10;
|
|
|
|
|
|
|
|
|
|
ue_ul_set_cfo(&ue_ul, sync_get_cfo(&ue_sync.strack));
|
|
|
|
|
//ue_ul_set_cfo(&ue_ul, sync_get_cfo(&ue_sync.strack));
|
|
|
|
|
bit_pack_vector((uint8_t*) conn_request_msg, data, ra_pusch.mcs.tbs);
|
|
|
|
|
n = ue_ul_pusch_encode_rnti(&ue_ul, &ra_pusch, data, ul_sf_idx, rar_msg.temp_c_rnti, ul_signal);
|
|
|
|
|
if (n < 0) {
|
|
|
|
@ -492,20 +492,21 @@ int main(int argc, char **argv) {
|
|
|
|
|
|
|
|
|
|
uint32_t n_ta = lte_N_ta_new_rar(rar_msg.timing_adv_cmd);
|
|
|
|
|
printf("ta: %d, n_ta: %d\n", rar_msg.timing_adv_cmd, n_ta);
|
|
|
|
|
float time_adv_sec = ((float) n_ta)*TS_PRB(cell.nof_prb);
|
|
|
|
|
float time_adv_sec = ((float) n_ta)*LTE_TS;
|
|
|
|
|
|
|
|
|
|
vec_sc_prod_cfc(ul_signal, 20, ul_signal, SF_LEN_PRB(cell.nof_prb));
|
|
|
|
|
vec_sc_prod_cfc(ul_signal, 2, ul_signal, SF_LEN_PRB(cell.nof_prb));
|
|
|
|
|
|
|
|
|
|
timestamp_copy(&next_tx_time, &uhd_time);
|
|
|
|
|
|
|
|
|
|
timestamp_copy(&next_tx_time, &uhd_time);
|
|
|
|
|
timestamp_add(&next_tx_time, 0, 0.006 - time_adv_sec); // send after 6 sub-frames (6 ms)
|
|
|
|
|
printf("Send %d samples PUSCH sfn: %d. Last frame time = %.6f"
|
|
|
|
|
"send PUSCH time = %.6f TA: %.1f us\n",
|
|
|
|
|
"send PUSCH time = %.6f TA: %.1f us\n",
|
|
|
|
|
SF_LEN_PRB(cell.nof_prb), sfn, timestamp_real(&uhd_time),
|
|
|
|
|
timestamp_real(&next_tx_time), time_adv_sec*1000000);
|
|
|
|
|
timestamp_real(&next_tx_time), time_adv_sec*1000000);
|
|
|
|
|
cuhd_send_timed(uhd, ul_signal, SF_LEN_PRB(cell.nof_prb),
|
|
|
|
|
next_tx_time.full_secs, next_tx_time.frac_secs);
|
|
|
|
|
next_tx_time.full_secs, next_tx_time.frac_secs);
|
|
|
|
|
|
|
|
|
|
vec_save_file("prach_example_signal", ul_signal, sizeof(cf_t)*7680);
|
|
|
|
|
go_exit = 1;
|
|
|
|
|
}
|
|
|
|
|
if (sfn >= rar_window_stop) {
|
|
|
|
|