Fixed DCI Format1A packing

master
Ismael Gomez 9 years ago
parent c54481e0e1
commit 180aedb620

@ -234,12 +234,12 @@ int srslte_enb_dl_put_pdcch_dl(srslte_enb_dl_t *q, srslte_ra_dl_dci_t *grant,
uint16_t rnti = srslte_pdsch_get_rnti_multi(&q->pdsch, rnti_idx);
bool rnti_is_user = true;
if (rnti == SRSLTE_SIRNTI || rnti == SRSLTE_PRNTI || rnti == SRSLTE_MRNTI) {
if (rnti == SRSLTE_SIRNTI || rnti == SRSLTE_PRNTI || (rnti >= SRSLTE_RARNTI_START && rnti <= SRSLTE_RARNTI_END)) {
rnti_is_user = false;
}
//srslte_ra_pdsch_fprint(stdout, grant, q->cell.nof_prb);
srslte_dci_msg_pack_pdsch(grant, &dci_msg, format, q->cell.nof_prb, rnti_is_user);
//srslte_vec_fprint_hex(stdout, dci_msg.data, dci_msg.nof_bits);
if (srslte_pdcch_encode(&q->pdcch, &dci_msg, location, rnti, q->sf_symbols, sf_idx, q->cfi)) {
fprintf(stderr, "Error encoding DCI message\n");
return SRSLTE_ERROR;

@ -614,11 +614,15 @@ int dci_format1As_pack(srslte_ra_dl_dci_t *data, srslte_dci_msg_t *msg, uint32_t
srslte_bit_unpack(data->harq_process, &y, 3);
if (!crc_is_crnti && nof_prb >= 50 && data->type2_alloc.mode == SRSLTE_RA_TYPE2_DIST) {
if (crc_is_crnti) {
if (nof_prb >= 50 && data->type2_alloc.mode == SRSLTE_RA_TYPE2_DIST) {
*y++ = data->type2_alloc.n_gap;
} else {
y++; // bit reserved
}
} else {
*y++ = data->ndi;
}
// rv version
srslte_bit_unpack(data->rv_idx, &y, 2);

@ -423,7 +423,7 @@ void srslte_vec_fprint_hex(FILE *stream, uint8_t *x, uint32_t len) {
fprintf(stream, "%02x ", byte);
}
if (len%8) {
byte = (uint8_t) srslte_bit_pack(&x, len%8);
byte = (uint8_t) srslte_bit_pack(&x, len%8)<<(8-(len%8));
fprintf(stream, "%02x ", byte);
}
fprintf(stream, "];\n");

Loading…
Cancel
Save