refactoring TA command structure in UE

This commit is contained in:
yagoda 2019-12-20 14:57:14 +00:00 committed by Andre Puschmann
parent 2db90c5dd3
commit fc1c506d1f
2 changed files with 24 additions and 19 deletions

View File

@ -77,6 +77,7 @@ private:
void process_mch_pdu(srslte::mch_pdu* pdu);
bool process_ce(srslte::sch_subh* subheader);
void parse_ta_cmd(srslte::sch_subh *subh);
bool is_uecrid_successful;

View File

@ -100,17 +100,19 @@ void demux::push_pdu_temp_crnti(uint8_t* buff, uint32_t nof_bytes)
// Look for Contention Resolution UE ID and TA commands
is_uecrid_successful = false;
while (pending_mac_msg.next()) {
if (pending_mac_msg.get()->ce_type() == srslte::sch_subh::CON_RES_ID) {
Debug("Found Contention Resolution ID CE\n");
is_uecrid_successful = mac->contention_resolution_id_rcv(pending_mac_msg.get()->get_con_res_id());
} else if (pending_mac_msg.get()->ce_type() == srslte::sch_subh::TA_CMD) {
phy_h->set_timeadv(pending_mac_msg.get()->get_ta_cmd());
Info("Received TA=%d (%d/%d) \n", pending_mac_msg.get()->get_ta_cmd(),
time_alignment_timer->value(), time_alignment_timer->duration());
// Start or restart timeAlignmentTimer only if set
if (time_alignment_timer->is_set()) {
time_alignment_timer->run();
switch (pending_mac_msg.get()->ce_type()) {
case srslte::sch_subh::CON_RES_ID:
if (!is_uecrid_successful) {
Debug("Found Contention Resolution ID CE\n");
is_uecrid_successful = mac->contention_resolution_id_rcv(
pending_mac_msg.get()->get_con_res_id());
}
break;
case srslte::sch_subh::TA_CMD:
parse_ta_cmd(pending_mac_msg.get());
break;
default:
break;
}
}
pending_mac_msg.reset();
@ -285,15 +287,7 @@ bool demux::process_ce(srslte::sch_subh* subh)
// Do nothing
break;
case srslte::sch_subh::TA_CMD:
phy_h->set_timeadv(subh->get_ta_cmd());
Info("Received TA=%d (%d/%d) \n",
subh->get_ta_cmd(),
time_alignment_timer->value(),
time_alignment_timer->duration());
// Start or restart timeAlignmentTimer only if set
if (time_alignment_timer->is_set()) {
time_alignment_timer->run();
}
parse_ta_cmd(subh);
break;
case srslte::sch_subh::SCELL_ACTIVATION:
cc_idx = (uint32_t)subh->get_activation_deactivation_cmd();
@ -309,4 +303,14 @@ bool demux::process_ce(srslte::sch_subh* subh)
return true;
}
void demux::parse_ta_cmd(srslte::sch_subh *subh) {
phy_h->set_timeadv(subh->get_ta_cmd());
Info("Received TA=%d (%d/%d) \n", subh->get_ta_cmd(),
time_alignment_timer->value(), time_alignment_timer->duration());
// Start or restart timeAlignmentTimer only if set
if (time_alignment_timer->is_set()) {
time_alignment_timer->run();
}
}
} // namespace srsue