do a loop in rrc::tti_clock() to process all pending events

master
Francisco Paisana 5 years ago committed by Francisco Paisana
parent 54a99d3f66
commit 40da4495ce

@ -960,50 +960,49 @@ void rrc::enable_encryption(uint16_t rnti, uint32_t lcid)
void rrc::tti_clock() void rrc::tti_clock()
{ {
// pop cmd from queue // pop cmds from queue
rrc_pdu p; rrc_pdu p;
if (not rx_pdu_queue.try_pop(&p)) { while (rx_pdu_queue.try_pop(&p)) {
return; // print Rx PDU
} if (p.pdu != nullptr) {
// print Rx PDU rrc_log->info_hex(p.pdu->msg, p.pdu->N_bytes, "Rx %s PDU", rb_id_text[p.lcid]);
if (p.pdu != nullptr) { }
rrc_log->info_hex(p.pdu->msg, p.pdu->N_bytes, "Rx %s PDU", rb_id_text[p.lcid]);
}
// check if user exists // check if user exists
auto user_it = users.find(p.rnti); auto user_it = users.find(p.rnti);
if (user_it == users.end()) { if (user_it == users.end()) {
rrc_log->warning("Discarding PDU for removed rnti=0x%x\n", p.rnti); rrc_log->warning("Discarding PDU for removed rnti=0x%x\n", p.rnti);
return; continue;
} }
// handle queue cmd // handle queue cmd
switch (p.lcid) { switch (p.lcid) {
case RB_ID_SRB0: case RB_ID_SRB0:
parse_ul_ccch(p.rnti, std::move(p.pdu)); parse_ul_ccch(p.rnti, std::move(p.pdu));
break; break;
case RB_ID_SRB1: case RB_ID_SRB1:
case RB_ID_SRB2: case RB_ID_SRB2:
parse_ul_dcch(p.rnti, p.lcid, std::move(p.pdu)); parse_ul_dcch(p.rnti, p.lcid, std::move(p.pdu));
break; break;
case LCID_REM_USER: case LCID_REM_USER:
rem_user(p.rnti); rem_user(p.rnti);
break; break;
case LCID_REL_USER: case LCID_REL_USER:
process_release_complete(p.rnti); process_release_complete(p.rnti);
break; break;
case LCID_RLF_USER: case LCID_RLF_USER:
process_rl_failure(p.rnti); process_rl_failure(p.rnti);
break; break;
case LCID_ACT_USER: case LCID_ACT_USER:
user_it->second->set_activity(); user_it->second->set_activity();
break; break;
case LCID_EXIT: case LCID_EXIT:
rrc_log->info("Exiting thread\n"); rrc_log->info("Exiting thread\n");
break; break;
default: default:
rrc_log->error("Rx PDU with invalid bearer id: %d", p.lcid); rrc_log->error("Rx PDU with invalid bearer id: %d", p.lcid);
break; break;
}
} }
} }

Loading…
Cancel
Save