enb: improve error message when RAR cannot be sent

master
Andre Puschmann 5 years ago
parent 1f73e6ae69
commit a1d64c1efe

@ -133,6 +133,7 @@ private:
std::deque<sf_sched::pending_rar_t> pending_rars; std::deque<sf_sched::pending_rar_t> pending_rars;
uint32_t rar_aggr_level = 2; uint32_t rar_aggr_level = 2;
static const uint32_t PRACH_RAR_OFFSET = 3; // TS 36.321 Sec. 5.1.4
}; };
} // namespace srsenb } // namespace srsenb

@ -154,16 +154,20 @@ void ra_sched::dl_sched(sf_sched* tti_sched)
uint32_t prach_tti = rar.prach_tti; uint32_t prach_tti = rar.prach_tti;
// Discard all RARs out of the window. The first one inside the window is scheduled, if we can't we exit // Discard all RARs out of the window. The first one inside the window is scheduled, if we can't we exit
if (not sched_utils::is_in_tti_interval(tti_tx_dl, prach_tti + 3, prach_tti + 3 + cc_cfg->cfg.prach_rar_window)) { if (not sched_utils::is_in_tti_interval(
if (tti_tx_dl >= prach_tti + 3 + cc_cfg->cfg.prach_rar_window) { tti_tx_dl, prach_tti + PRACH_RAR_OFFSET, prach_tti + PRACH_RAR_OFFSET + cc_cfg->cfg.prach_rar_window)) {
log_h->console("SCHED: Could not transmit RAR within the window (RA TTI=%d, Window=%d, Now=%d)\n", if (tti_tx_dl >= prach_tti + PRACH_RAR_OFFSET + cc_cfg->cfg.prach_rar_window) {
char error_msg[128];
int len = snprintf(error_msg,
sizeof(error_msg),
"SCHED: Could not transmit RAR within the window (RA=%d, Window=[%d..%d], RAR=%d)\n",
prach_tti, prach_tti,
cc_cfg->cfg.prach_rar_window, prach_tti + PRACH_RAR_OFFSET,
tti_tx_dl); prach_tti + PRACH_RAR_OFFSET + cc_cfg->cfg.prach_rar_window,
log_h->error("SCHED: Could not transmit RAR within the window (RA TTI=%d, Window=%d, Now=%d)\n",
prach_tti,
cc_cfg->cfg.prach_rar_window,
tti_tx_dl); tti_tx_dl);
error_msg[len] = '\0';
log_h->console("%s", error_msg);
log_h->error("%s", error_msg);
// Remove from pending queue and get next one if window has passed already // Remove from pending queue and get next one if window has passed already
pending_rars.pop_front(); pending_rars.pop_front();
continue; continue;

Loading…
Cancel
Save