Added PUCCH dedocder to slot worker

master
Xavier Arteaga 4 years ago committed by Xavier Arteaga
parent e3afd945bc
commit 3fe9176750

@ -248,8 +248,9 @@ public:
};
struct pucch_t {
srsran_uci_cfg_nr_t uci_cfg;
srsran_pucch_nr_resource_t resource;
srsran_uci_cfg_nr_t uci_cfg; ///< UCI configuration
srsran_pucch_nr_common_cfg_t pucch_cfg; ///< UE dedicated PUCCH configuration
srsran_pucch_nr_resource_t resource; ///< PUCCH resource
};
struct ul_sched_t {

@ -59,4 +59,10 @@ SRSRAN_API int srsran_gnb_ul_get_pucch(srsran_gnb_ul_t* q,
const srsran_uci_cfg_nr_t* uci_cfg,
srsran_uci_value_nr_t* uci_value);
SRSRAN_API uint32_t srsran_gnb_ul_pucch_info(srsran_gnb_ul_t* q,
const srsran_pucch_nr_resource_t* resource,
const srsran_uci_data_nr_t* uci_data,
char* str,
uint32_t str_len);
#endif // SRSRAN_GNB_UL_H

@ -239,9 +239,9 @@ SRSRAN_API int srsran_pucch_nr_format_2_3_4_decode(srsran_pucch_nr_t*
cf_t* slot_symbols,
srsran_uci_value_nr_t* uci_value);
SRSRAN_API uint32_t srsran_pucch_nr_tx_info(const srsran_pucch_nr_resource_t* resource,
const srsran_uci_data_nr_t* uci_data,
char* str,
uint32_t str_len);
SRSRAN_API uint32_t srsran_pucch_nr_info(const srsran_pucch_nr_resource_t* resource,
const srsran_uci_data_nr_t* uci_data,
char* str,
uint32_t str_len);
#endif // SRSRAN_PUCCH_NR_H

@ -261,4 +261,24 @@ int srsran_gnb_ul_get_pucch(srsran_gnb_ul_t* q,
}
return SRSRAN_ERROR;
}
uint32_t srsran_gnb_ul_pucch_info(srsran_gnb_ul_t* q,
const srsran_pucch_nr_resource_t* resource,
const srsran_uci_data_nr_t* uci_data,
char* str,
uint32_t str_len)
{
if (q == NULL || uci_data == NULL) {
return 0;
}
uint32_t len = 0;
len += srsran_pucch_nr_info(resource, uci_data, str, str_len - len);
len = srsran_print_check(
str, str_len, len, "snr=%+.1f valid=%c", q->chest_pucch.snr_db, uci_data->value.valid ? 'y' : 'n');
return len;
}

@ -762,10 +762,10 @@ static uint32_t pucch_nr_resource_info(const srsran_pucch_nr_resource_t* r, char
return len;
}
uint32_t srsran_pucch_nr_tx_info(const srsran_pucch_nr_resource_t* resource,
const srsran_uci_data_nr_t* uci_data,
char* str,
uint32_t str_len)
uint32_t srsran_pucch_nr_info(const srsran_pucch_nr_resource_t* resource,
const srsran_uci_data_nr_t* uci_data,
char* str,
uint32_t str_len)
{
uint32_t len = 0;

@ -260,7 +260,7 @@ int srsran_ue_ul_nr_pucch_info(const srsran_pucch_nr_resource_t* resource,
int len = 0;
// Append PDSCH info
len += srsran_pucch_nr_tx_info(resource, uci_data, &str[len], str_len - len);
len += srsran_pucch_nr_info(resource, uci_data, &str[len], str_len - len);
return len;
}

@ -150,9 +150,26 @@ bool slot_worker::work_ul()
return false;
}
// Demodulate
if (srsran_gnb_ul_fft(&gnb_ul) < SRSRAN_SUCCESS) {
logger.error("Error in demodulation");
return false;
}
// Decode PUCCH
for (stack_interface_phy_nr::pucch_t& pucch : ul_sched.pucch) {
// ...
srsran_uci_value_nr_t uci_value;
if (srsran_gnb_ul_get_pucch(&gnb_ul, &ul_slot_cfg, &pucch.pucch_cfg, &pucch.resource, &pucch.uci_cfg, &uci_value) <
SRSRAN_SUCCESS) {
logger.error("Error getting PUCCH");
return false;
}
if (logger.info.enabled()) {
std::array<char, 512> str;
srsran_uci_data_nr_t uci_data = {.cfg = pucch.uci_cfg, .value = uci_value};
srsran_gnb_ul_pucch_info(&gnb_ul, &pucch.resource, &uci_data, str.data(), (uint32_t)str.size());
}
}
// Decode PUSCH

Loading…
Cancel
Save