Fix incorrect MIB generation. Fixes issue #232

master
Ismael Gomez 6 years ago
parent a8f6081837
commit 1a1471955e

@ -70,13 +70,11 @@ int srslte_enb_dl_init(srslte_enb_dl_t *q, cf_t *out_buffer[SRSLTE_MAX_PORTS], u
} }
} }
if (srslte_ofdm_tx_init_mbsfn(&q->ifft_mbsfn, SRSLTE_CP_EXT, q->sf_symbols[0], out_buffer[0], max_prb)) { if (srslte_ofdm_tx_init_mbsfn(&q->ifft_mbsfn, SRSLTE_CP_EXT, q->sf_symbols[0], out_buffer[0], max_prb)) {
fprintf(stderr, "Error initiating FFT \n"); fprintf(stderr, "Error initiating FFT \n");
goto clean_exit; goto clean_exit;
} }
if (srslte_pbch_init(&q->pbch)) { if (srslte_pbch_init(&q->pbch)) {
fprintf(stderr, "Error creating PBCH object\n"); fprintf(stderr, "Error creating PBCH object\n");
goto clean_exit; goto clean_exit;
@ -174,6 +172,9 @@ int srslte_enb_dl_set_cell(srslte_enb_dl_t *q, srslte_cell_t cell)
return SRSLTE_ERROR; return SRSLTE_ERROR;
} }
for (int i = 0; i < q->cell.nof_ports; i++) { for (int i = 0; i < q->cell.nof_ports; i++) {
q->slot1_symbols[i] = &q->sf_symbols[i][SRSLTE_SLOT_LEN_RE(q->cell.nof_prb, SRSLTE_CP_NORM)];
if (srslte_ofdm_tx_set_prb(&q->ifft[i], q->cell.cp, q->cell.nof_prb)) { if (srslte_ofdm_tx_set_prb(&q->ifft[i], q->cell.cp, q->cell.nof_prb)) {
fprintf(stderr, "Error re-planning iFFT (%d)\n", i); fprintf(stderr, "Error re-planning iFFT (%d)\n", i);
return SRSLTE_ERROR; return SRSLTE_ERROR;

@ -579,7 +579,6 @@ int srslte_pbch_encode(srslte_pbch_t *q, uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_
frame_idx=frame_idx%4; frame_idx=frame_idx%4;
if (frame_idx == 0) {
memcpy(q->data, bch_payload, sizeof(uint8_t) * SRSLTE_BCH_PAYLOAD_LEN); memcpy(q->data, bch_payload, sizeof(uint8_t) * SRSLTE_BCH_PAYLOAD_LEN);
/* encode & modulate */ /* encode & modulate */
@ -589,7 +588,6 @@ int srslte_pbch_encode(srslte_pbch_t *q, uint8_t bch_payload[SRSLTE_BCH_PAYLOAD_
srslte_convcoder_encode(&q->encoder, q->data, q->data_enc, SRSLTE_BCH_PAYLOADCRC_LEN); srslte_convcoder_encode(&q->encoder, q->data, q->data_enc, SRSLTE_BCH_PAYLOADCRC_LEN);
srslte_rm_conv_tx(q->data_enc, SRSLTE_BCH_ENCODED_LEN, q->rm_b, 4 * nof_bits); srslte_rm_conv_tx(q->data_enc, SRSLTE_BCH_ENCODED_LEN, q->rm_b, 4 * nof_bits);
}
srslte_scrambling_b_offset(&q->seq, &q->rm_b[frame_idx * nof_bits], srslte_scrambling_b_offset(&q->seq, &q->rm_b[frame_idx * nof_bits],
frame_idx * nof_bits, nof_bits); frame_idx * nof_bits, nof_bits);

Loading…
Cancel
Save