Fixed DCI Format1A packing

This commit is contained in:
Ismael Gomez 2016-07-13 10:40:51 +02:00
parent c54481e0e1
commit 180aedb620
3 changed files with 10 additions and 6 deletions

View File

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

View File

@ -614,10 +614,14 @@ 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) {
*y++ = data->type2_alloc.n_gap;
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++; // bit reserved
*y++ = data->ndi;
}
// rv version

View File

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