master
Xavier Arteaga 6 years ago
parent a1eca433b0
commit 27df357a66

@ -533,6 +533,10 @@ int srslte_pusch_encode(srslte_pusch_t *q, srslte_pusch_cfg_t *cfg, srslte_softb
srslte_sequence_t *seq = get_user_sequence(q, rnti, cfg->sf_idx, cfg->nbits.nof_bits);
// Run scrambling
if (!seq) {
fprintf(stderr, "Error getting scrambling sequence\n");
return SRSLTE_ERROR;
}
srslte_scrambling_bytes(seq, (uint8_t*) q->q, cfg->nbits.nof_bits);
// Correct UCI placeholder/repetition bits

@ -1269,6 +1269,22 @@ void phch_worker::encode_pusch(srslte_ra_ul_grant_t *grant, uint8_t *payload, ui
char timestr[64];
timestr[0]='\0';
/* Check input values ranges */
if (rnti == 0) {
Warning("Encode PUSCH: Invalid RNTI (= 0)\n");
return;
} else if (rv > 3) {
Warning("Encode PUSCH: Invalid RV (= %ud)\n", rv);
return;
} else if (payload == NULL) {
Warning("Encode PUSCH: NULL payload\n");
return;
} else if (softbuffer == NULL) {
Warning("Encode PUSCH: NULL softbuffer\n");
return;
}
/* Configure and encode */
if (srslte_ue_ul_cfg_grant(&ue_ul, grant, TTI_TX(tti), rv, current_tx_nb)) {
Error("Configuring UL grant\n");
}

Loading…
Cancel
Save