diff --git a/lib/include/srslte/phy/common/phy_common.h b/lib/include/srslte/phy/common/phy_common.h index de7a122c7..856a37682 100644 --- a/lib/include/srslte/phy/common/phy_common.h +++ b/lib/include/srslte/phy/common/phy_common.h @@ -451,6 +451,13 @@ SRSLTE_API const char* srslte_ack_nack_feedback_mode_string(srslte_ack_nack_feed */ SRSLTE_API srslte_ack_nack_feedback_mode_t srslte_string_ack_nack_feedback_mode(const char* str); +/** + * Returns the number of bits for Rank Indicador reporting depending on the cell + * + * @param cell + */ +SRSLTE_API uint32_t srslte_ri_nof_bits(const srslte_cell_t* cell); + #ifdef __cplusplus } #endif diff --git a/lib/src/phy/common/phy_common.c b/lib/src/phy/common/phy_common.c index 741dc24f2..26542867c 100644 --- a/lib/src/phy/common/phy_common.c +++ b/lib/src/phy/common/phy_common.c @@ -854,4 +854,17 @@ srslte_ack_nack_feedback_mode_t srslte_string_ack_nack_feedback_mode(const char* // Otherwise Normal return SRSLTE_PUCCH_ACK_NACK_FEEDBACK_MODE_NORMAL; -} \ No newline at end of file +} + +uint32_t srslte_ri_nof_bits(const srslte_cell_t* cell) +{ + uint32_t ret = 0; + + if (cell->nof_ports == 2) { + ret = 1; + } else if (cell->nof_ports > 2) { + ret = 2; + } + + return ret; +}