@ -117,27 +117,18 @@ void rrc::ue::activity_timer_expired(activity_timeout_type_t type)
if ( parent - > s1ap - > user_exists ( rnti ) ) {
if ( parent - > s1ap - > user_exists ( rnti ) ) {
if ( type = = UE_INACTIVITY_TIMEOUT ) {
if ( type = = UE_INACTIVITY_TIMEOUT ) {
parent - > s1ap - > user_release ( rnti , asn1 : : s1ap : : cause_radio_network_opts : : user_inactivity ) ;
parent - > s1ap - > user_release ( rnti , asn1 : : s1ap : : cause_radio_network_opts : : user_inactivity ) ;
event_logger : : get ( ) . log_rrc_disconnect ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
con_release_result = procedure_result_code : : activity_timeout ;
static_cast < unsigned > ( rrc_idle_transition_cause : : timeout ) ,
rnti ) ;
} else if ( type = = UE_REESTABLISH_TIMEOUT ) {
} else if ( type = = UE_REESTABLISH_TIMEOUT ) {
parent - > s1ap - > user_release ( rnti , asn1 : : s1ap : : cause_radio_network_opts : : radio_conn_with_ue_lost ) ;
parent - > s1ap - > user_release ( rnti , asn1 : : s1ap : : cause_radio_network_opts : : radio_conn_with_ue_lost ) ;
event_logger : : get ( ) . log_rrc_disconnect (
con_release_result = procedure_result_code : : radio_conn_with_ue_lost ;
ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
static_cast < unsigned > ( rrc_idle_transition_cause : : radio_conn_with_ue_lost ) ,
rnti ) ;
} else if ( type = = MSG3_RX_TIMEOUT ) {
} else if ( type = = MSG3_RX_TIMEOUT ) {
// MSG3 timeout, no need to notify S1AP, just remove UE
// MSG3 timeout, no need to notify S1AP, just remove UE
parent - > rem_user_thread ( rnti ) ;
parent - > rem_user_thread ( rnti ) ;
event_logger : : get ( ) . log_rrc_disconnect ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
con_release_result = procedure_result_code : : msg3_timeout ;
static_cast < unsigned > ( rrc_idle_transition_cause : : msg3_timeout ) ,
rnti ) ;
} else {
} else {
// Unhandled activity timeout, just remove UE and log an error
// Unhandled activity timeout, just remove UE and log an error
parent - > rem_user_thread ( rnti ) ;
parent - > rem_user_thread ( rnti ) ;
event_logger : : get ( ) . log_rrc_disconnect ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
con_release_result = procedure_result_code : : activity_timeout ;
static_cast < unsigned > ( rrc_idle_transition_cause : : msg3_timeout ) ,
rnti ) ;
parent - > logger . error (
parent - > logger . error (
" Unhandled reason for activity timer expiration. rnti=0x%x, cause %d " , rnti , static_cast < unsigned > ( type ) ) ;
" Unhandled reason for activity timer expiration. rnti=0x%x, cause %d " , rnti , static_cast < unsigned > ( type ) ) ;
}
}
@ -232,9 +223,11 @@ void rrc::ue::parse_ul_dcch(uint32_t lcid, srsran::unique_byte_buffer_t pdu)
switch ( ul_dcch_msg . msg . c1 ( ) . type ( ) ) {
switch ( ul_dcch_msg . msg . c1 ( ) . type ( ) ) {
case ul_dcch_msg_type_c : : c1_c_ : : types : : rrc_conn_setup_complete :
case ul_dcch_msg_type_c : : c1_c_ : : types : : rrc_conn_setup_complete :
save_ul_message ( std : : move ( original_pdu ) ) ;
handle_rrc_con_setup_complete ( & ul_dcch_msg . msg . c1 ( ) . rrc_conn_setup_complete ( ) , std : : move ( pdu ) ) ;
handle_rrc_con_setup_complete ( & ul_dcch_msg . msg . c1 ( ) . rrc_conn_setup_complete ( ) , std : : move ( pdu ) ) ;
break ;
break ;
case ul_dcch_msg_type_c : : c1_c_ : : types : : rrc_conn_reest_complete :
case ul_dcch_msg_type_c : : c1_c_ : : types : : rrc_conn_reest_complete :
save_ul_message ( std : : move ( original_pdu ) ) ;
handle_rrc_con_reest_complete ( & ul_dcch_msg . msg . c1 ( ) . rrc_conn_reest_complete ( ) , std : : move ( pdu ) ) ;
handle_rrc_con_reest_complete ( & ul_dcch_msg . msg . c1 ( ) . rrc_conn_reest_complete ( ) , std : : move ( pdu ) ) ;
break ;
break ;
case ul_dcch_msg_type_c : : c1_c_ : : types : : ul_info_transfer :
case ul_dcch_msg_type_c : : c1_c_ : : types : : ul_info_transfer :
@ -255,6 +248,7 @@ void rrc::ue::parse_ul_dcch(uint32_t lcid, srsran::unique_byte_buffer_t pdu)
parent - > s1ap - > write_pdu ( rnti , std : : move ( pdu ) ) ;
parent - > s1ap - > write_pdu ( rnti , std : : move ( pdu ) ) ;
break ;
break ;
case ul_dcch_msg_type_c : : c1_c_ : : types : : rrc_conn_recfg_complete :
case ul_dcch_msg_type_c : : c1_c_ : : types : : rrc_conn_recfg_complete :
save_ul_message ( std : : move ( original_pdu ) ) ;
handle_rrc_reconf_complete ( & ul_dcch_msg . msg . c1 ( ) . rrc_conn_recfg_complete ( ) , std : : move ( pdu ) ) ;
handle_rrc_reconf_complete ( & ul_dcch_msg . msg . c1 ( ) . rrc_conn_recfg_complete ( ) , std : : move ( pdu ) ) ;
srsran : : console ( " User 0x%x connected \n " , rnti ) ;
srsran : : console ( " User 0x%x connected \n " , rnti ) ;
state = RRC_STATE_REGISTERED ;
state = RRC_STATE_REGISTERED ;
@ -274,7 +268,7 @@ void rrc::ue::parse_ul_dcch(uint32_t lcid, srsran::unique_byte_buffer_t pdu)
send_connection_reconf ( std : : move ( pdu ) ) ;
send_connection_reconf ( std : : move ( pdu ) ) ;
state = RRC_STATE_WAIT_FOR_CON_RECONF_COMPLETE ;
state = RRC_STATE_WAIT_FOR_CON_RECONF_COMPLETE ;
} else {
} else {
send_connection_reject ( ) ;
send_connection_reject ( procedure_result_code : : none ) ;
state = RRC_STATE_IDLE ;
state = RRC_STATE_IDLE ;
}
}
break ;
break ;
@ -305,13 +299,16 @@ std::string rrc::ue::to_string(const activity_timeout_type_t& type)
*/
*/
void rrc : : ue : : handle_rrc_con_req ( rrc_conn_request_s * msg )
void rrc : : ue : : handle_rrc_con_req ( rrc_conn_request_s * msg )
{
{
// Log event.
event_logger : : get ( ) . log_rrc_event ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
asn1 : : octstring_to_string ( last_ul_msg - > msg , last_ul_msg - > N_bytes ) ,
static_cast < unsigned > ( rrc_event_type : : con_request ) ,
static_cast < unsigned > ( procedure_result_code : : none ) ,
rnti ) ;
if ( not parent - > s1ap - > is_mme_connected ( ) ) {
if ( not parent - > s1ap - > is_mme_connected ( ) ) {
parent - > logger . error ( " MME isn't connected. Sending Connection Reject " ) ;
parent - > logger . error ( " MME isn't connected. Sending Connection Reject " ) ;
event_logger : : get ( ) . log_rrc_connected ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
send_connection_reject ( procedure_result_code : : error_mme_not_connected ) ;
asn1 : : octstring_to_string ( last_ul_msg - > msg , last_ul_msg - > N_bytes ) ,
static_cast < unsigned > ( conn_request_result_t : : error_mme_not_connected ) ,
rnti ) ;
send_connection_reject ( ) ;
return ;
return ;
}
}
@ -365,13 +362,28 @@ void rrc::ue::send_connection_setup()
// Configure PHY layer
// Configure PHY layer
apply_setup_phy_config_dedicated ( rr_cfg . phys_cfg_ded ) ; // It assumes SCell has not been set before
apply_setup_phy_config_dedicated ( rr_cfg . phys_cfg_ded ) ; // It assumes SCell has not been set before
send_dl_ccch ( & dl_ccch_msg ) ;
std : : string octet_str ;
send_dl_ccch ( & dl_ccch_msg , & octet_str ) ;
// Log event.
event_logger : : get ( ) . log_rrc_event ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
octet_str ,
static_cast < unsigned > ( rrc_event_type : : con_setup ) ,
static_cast < unsigned > ( procedure_result_code : : none ) ,
rnti ) ;
apply_rr_cfg_ded_diff ( current_ue_cfg . rr_cfg , rr_cfg ) ;
apply_rr_cfg_ded_diff ( current_ue_cfg . rr_cfg , rr_cfg ) ;
}
}
void rrc : : ue : : handle_rrc_con_setup_complete ( rrc_conn_setup_complete_s * msg , srsran : : unique_byte_buffer_t pdu )
void rrc : : ue : : handle_rrc_con_setup_complete ( rrc_conn_setup_complete_s * msg , srsran : : unique_byte_buffer_t pdu )
{
{
// Log event.
event_logger : : get ( ) . log_rrc_event ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
asn1 : : octstring_to_string ( last_ul_msg - > msg , last_ul_msg - > N_bytes ) ,
static_cast < unsigned > ( rrc_event_type : : con_setup_complete ) ,
static_cast < unsigned > ( procedure_result_code : : none ) ,
rnti ) ;
// Inform PHY about the configuration completion
// Inform PHY about the configuration completion
parent - > phy - > complete_config ( rnti ) ;
parent - > phy - > complete_config ( rnti ) ;
@ -398,12 +410,6 @@ void rrc::ue::handle_rrc_con_setup_complete(rrc_conn_setup_complete_s* msg, srsr
}
}
state = RRC_STATE_WAIT_FOR_CON_RECONF_COMPLETE ;
state = RRC_STATE_WAIT_FOR_CON_RECONF_COMPLETE ;
// Log event.
event_logger : : get ( ) . log_rrc_connected ( enb_cc_idx ,
asn1 : : octstring_to_string ( last_ul_msg - > msg , last_ul_msg - > N_bytes ) ,
static_cast < unsigned > ( conn_request_result_t : : success ) ,
rnti ) ;
// 2> if the UE has radio link failure or handover failure information available
// 2> if the UE has radio link failure or handover failure information available
if ( msg - > crit_exts . type ( ) . value = = c1_or_crit_ext_opts : : c1 and
if ( msg - > crit_exts . type ( ) . value = = c1_or_crit_ext_opts : : c1 and
msg - > crit_exts . c1 ( ) . type ( ) . value = =
msg - > crit_exts . c1 ( ) . type ( ) . value = =
@ -415,13 +421,22 @@ void rrc::ue::handle_rrc_con_setup_complete(rrc_conn_setup_complete_s* msg, srsr
}
}
}
}
void rrc : : ue : : send_connection_reject ( )
void rrc : : ue : : send_connection_reject ( procedure_result_code cause )
{
{
mac_ctrl . handle_con_reject ( ) ;
mac_ctrl . handle_con_reject ( ) ;
dl_ccch_msg_s dl_ccch_msg ;
dl_ccch_msg_s dl_ccch_msg ;
dl_ccch_msg . msg . set_c1 ( ) . set_rrc_conn_reject ( ) . crit_exts . set_c1 ( ) . set_rrc_conn_reject_r8 ( ) . wait_time = 10 ;
dl_ccch_msg . msg . set_c1 ( ) . set_rrc_conn_reject ( ) . crit_exts . set_c1 ( ) . set_rrc_conn_reject_r8 ( ) . wait_time = 10 ;
send_dl_ccch ( & dl_ccch_msg ) ;
std : : string octet_str ;
send_dl_ccch ( & dl_ccch_msg , & octet_str ) ;
// Log event.
event_logger : : get ( ) . log_rrc_event ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
octet_str ,
static_cast < unsigned > ( rrc_event_type : : con_reject ) ,
static_cast < unsigned > ( cause ) ,
rnti ) ;
}
}
/*
/*
@ -429,13 +444,16 @@ void rrc::ue::send_connection_reject()
*/
*/
void rrc : : ue : : handle_rrc_con_reest_req ( rrc_conn_reest_request_s * msg )
void rrc : : ue : : handle_rrc_con_reest_req ( rrc_conn_reest_request_s * msg )
{
{
// Log event.
event_logger : : get ( ) . log_rrc_event ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
asn1 : : octstring_to_string ( last_ul_msg - > msg , last_ul_msg - > N_bytes ) ,
static_cast < unsigned > ( rrc_event_type : : con_reest_req ) ,
static_cast < unsigned > ( procedure_result_code : : none ) ,
rnti ) ;
if ( not parent - > s1ap - > is_mme_connected ( ) ) {
if ( not parent - > s1ap - > is_mme_connected ( ) ) {
parent - > logger . error ( " MME isn't connected. Sending Connection Reject " ) ;
parent - > logger . error ( " MME isn't connected. Sending Connection Reject " ) ;
event_logger : : get ( ) . log_rrc_connected ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
send_connection_reject ( procedure_result_code : : error_mme_not_connected ) ;
asn1 : : octstring_to_string ( last_ul_msg - > msg , last_ul_msg - > N_bytes ) ,
static_cast < unsigned > ( conn_request_result_t : : error_mme_not_connected ) ,
rnti ) ;
send_connection_reject ( ) ;
return ;
return ;
}
}
parent - > logger . debug ( " rnti=0x%x, phyid=0x%x, smac=0x%x, cause=%s " ,
parent - > logger . debug ( " rnti=0x%x, phyid=0x%x, smac=0x%x, cause=%s " ,
@ -496,11 +514,7 @@ void rrc::ue::handle_rrc_con_reest_req(rrc_conn_reest_request_s* msg)
set_activity_timeout ( UE_INACTIVITY_TIMEOUT ) ;
set_activity_timeout ( UE_INACTIVITY_TIMEOUT ) ;
} else {
} else {
parent - > logger . error ( " Received ConnectionReestablishment for rnti=0x%x without context " , old_rnti ) ;
parent - > logger . error ( " Received ConnectionReestablishment for rnti=0x%x without context " , old_rnti ) ;
event_logger : : get ( ) . log_rrc_connected ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
send_connection_reest_rej ( procedure_result_code : : error_unknown_rnti ) ;
asn1 : : octstring_to_string ( last_ul_msg - > msg , last_ul_msg - > N_bytes ) ,
static_cast < unsigned > ( conn_request_result_t : : error_unknown_rnti ) ,
rnti ) ;
send_connection_reest_rej ( ) ;
}
}
} else {
} else {
parent - > logger . error ( " Received ReestablishmentRequest from an rnti=0x%x not in IDLE " , rnti ) ;
parent - > logger . error ( " Received ReestablishmentRequest from an rnti=0x%x not in IDLE " , rnti ) ;
@ -532,13 +546,28 @@ void rrc::ue::send_connection_reest(uint8_t ncc)
// Configure PHY layer
// Configure PHY layer
apply_setup_phy_config_dedicated ( rr_cfg . phys_cfg_ded ) ; // It assumes SCell has not been set before
apply_setup_phy_config_dedicated ( rr_cfg . phys_cfg_ded ) ; // It assumes SCell has not been set before
send_dl_ccch ( & dl_ccch_msg ) ;
std : : string octet_str ;
send_dl_ccch ( & dl_ccch_msg , & octet_str ) ;
apply_rr_cfg_ded_diff ( current_ue_cfg . rr_cfg , rr_cfg ) ;
apply_rr_cfg_ded_diff ( current_ue_cfg . rr_cfg , rr_cfg ) ;
// Log event.
event_logger : : get ( ) . log_rrc_event ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
octet_str ,
static_cast < unsigned > ( rrc_event_type : : con_reest ) ,
static_cast < unsigned > ( procedure_result_code : : none ) ,
rnti ) ;
}
}
void rrc : : ue : : handle_rrc_con_reest_complete ( rrc_conn_reest_complete_s * msg , srsran : : unique_byte_buffer_t pdu )
void rrc : : ue : : handle_rrc_con_reest_complete ( rrc_conn_reest_complete_s * msg , srsran : : unique_byte_buffer_t pdu )
{
{
// Log event.
event_logger : : get ( ) . log_rrc_event ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
asn1 : : octstring_to_string ( last_ul_msg - > msg , last_ul_msg - > N_bytes ) ,
static_cast < unsigned > ( rrc_event_type : : con_reest_complete ) ,
static_cast < unsigned > ( procedure_result_code : : none ) ,
rnti ) ;
// Inform PHY about the configuration completion
// Inform PHY about the configuration completion
parent - > phy - > complete_config ( rnti ) ;
parent - > phy - > complete_config ( rnti ) ;
@ -567,11 +596,6 @@ void rrc::ue::handle_rrc_con_reest_complete(rrc_conn_reest_complete_s* msg, srsr
state = RRC_STATE_REESTABLISHMENT_COMPLETE ;
state = RRC_STATE_REESTABLISHMENT_COMPLETE ;
event_logger : : get ( ) . log_rrc_connected ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
asn1 : : octstring_to_string ( last_ul_msg - > msg , last_ul_msg - > N_bytes ) ,
0 ,
rnti ) ;
// 2> if the UE has radio link failure or handover failure information available
// 2> if the UE has radio link failure or handover failure information available
if ( msg - > crit_exts . type ( ) . value = = rrc_conn_reest_complete_s : : crit_exts_c_ : : types_opts : : rrc_conn_reest_complete_r8 ) {
if ( msg - > crit_exts . type ( ) . value = = rrc_conn_reest_complete_s : : crit_exts_c_ : : types_opts : : rrc_conn_reest_complete_r8 ) {
const auto & complete_r8 = msg - > crit_exts . rrc_conn_reest_complete_r8 ( ) ;
const auto & complete_r8 = msg - > crit_exts . rrc_conn_reest_complete_r8 ( ) ;
@ -583,13 +607,22 @@ void rrc::ue::handle_rrc_con_reest_complete(rrc_conn_reest_complete_s* msg, srsr
send_connection_reconf ( std : : move ( pdu ) ) ;
send_connection_reconf ( std : : move ( pdu ) ) ;
}
}
void rrc : : ue : : send_connection_reest_rej ( )
void rrc : : ue : : send_connection_reest_rej ( procedure_result_code cause )
{
{
mac_ctrl . handle_con_reject ( ) ;
mac_ctrl . handle_con_reject ( ) ;
dl_ccch_msg_s dl_ccch_msg ;
dl_ccch_msg_s dl_ccch_msg ;
dl_ccch_msg . msg . set_c1 ( ) . set_rrc_conn_reest_reject ( ) . crit_exts . set_rrc_conn_reest_reject_r8 ( ) ;
dl_ccch_msg . msg . set_c1 ( ) . set_rrc_conn_reest_reject ( ) . crit_exts . set_rrc_conn_reest_reject_r8 ( ) ;
send_dl_ccch ( & dl_ccch_msg ) ;
std : : string octet_str ;
send_dl_ccch ( & dl_ccch_msg , & octet_str ) ;
// Log event.
event_logger : : get ( ) . log_rrc_event ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
octet_str ,
static_cast < unsigned > ( rrc_event_type : : con_reest_reject ) ,
static_cast < unsigned > ( cause ) ,
rnti ) ;
}
}
/*
/*
@ -653,7 +686,15 @@ void rrc::ue::send_connection_reconf(srsran::unique_byte_buffer_t pdu,
}
}
// send DL-DCCH message to lower layers
// send DL-DCCH message to lower layers
send_dl_dcch ( & dl_dcch_msg , std : : move ( pdu ) ) ;
std : : string octet_str ;
send_dl_dcch ( & dl_dcch_msg , std : : move ( pdu ) , & octet_str ) ;
// Log event.
event_logger : : get ( ) . log_rrc_event ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
octet_str ,
static_cast < unsigned > ( rrc_event_type : : con_reconf ) ,
static_cast < unsigned > ( procedure_result_code : : none ) ,
rnti ) ;
state = RRC_STATE_WAIT_FOR_CON_RECONF_COMPLETE ;
state = RRC_STATE_WAIT_FOR_CON_RECONF_COMPLETE ;
}
}
@ -669,6 +710,13 @@ void rrc::ue::handle_rrc_reconf_complete(rrc_conn_recfg_complete_s* msg, srsran:
return ;
return ;
}
}
// Log event.
event_logger : : get ( ) . log_rrc_event ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
asn1 : : octstring_to_string ( last_ul_msg - > msg , last_ul_msg - > N_bytes ) ,
static_cast < unsigned > ( rrc_event_type : : con_reconf_complete ) ,
static_cast < unsigned > ( procedure_result_code : : none ) ,
rnti ) ;
// Activate SCells and bearers in the MAC scheduler that were advertised in the RRC Reconf message
// Activate SCells and bearers in the MAC scheduler that were advertised in the RRC Reconf message
mac_ctrl . handle_con_reconf_complete ( ) ;
mac_ctrl . handle_con_reconf_complete ( ) ;
@ -825,12 +873,15 @@ void rrc::ue::send_connection_release()
}
}
}
}
send_dl_dcch ( & dl_dcch_msg ) ;
std : : string octet_str ;
send_dl_dcch ( & dl_dcch_msg , nullptr , & octet_str ) ;
// Log rrc release event.
// Log rrc release event.
event_logger : : get ( ) . log_rrc_disconnect ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
event_logger : : get ( ) . log_rrc_event ( ue_cell_list . get_ue_cc_idx ( UE_PCELL_CC_IDX ) - > cell_common - > enb_cc_idx ,
static_cast < unsigned > ( rrc_idle_transition_cause : : release ) ,
octet_str ,
rnti ) ;
static_cast < unsigned > ( rrc_event_type : : con_release ) ,
static_cast < unsigned > ( con_release_result ) ,
rnti ) ;
}
}
/*
/*
@ -1099,7 +1150,7 @@ void rrc::ue::update_scells()
/********************** HELPERS ***************************/
/********************** HELPERS ***************************/
void rrc : : ue : : send_dl_ccch ( dl_ccch_msg_s * dl_ccch_msg )
void rrc : : ue : : send_dl_ccch ( dl_ccch_msg_s * dl_ccch_msg , std : : string * octet_str )
{
{
// Allocate a new PDU buffer, pack the message and send to PDCP
// Allocate a new PDU buffer, pack the message and send to PDCP
srsran : : unique_byte_buffer_t pdu = srsran : : make_byte_buffer ( ) ;
srsran : : unique_byte_buffer_t pdu = srsran : : make_byte_buffer ( ) ;
@ -1114,13 +1165,19 @@ void rrc::ue::send_dl_ccch(dl_ccch_msg_s* dl_ccch_msg)
char buf [ 32 ] = { } ;
char buf [ 32 ] = { } ;
sprintf ( buf , " SRB0 - rnti=0x%x " , rnti ) ;
sprintf ( buf , " SRB0 - rnti=0x%x " , rnti ) ;
parent - > log_rrc_message ( buf , Tx , pdu . get ( ) , * dl_ccch_msg , dl_ccch_msg - > msg . c1 ( ) . type ( ) . to_string ( ) ) ;
parent - > log_rrc_message ( buf , Tx , pdu . get ( ) , * dl_ccch_msg , dl_ccch_msg - > msg . c1 ( ) . type ( ) . to_string ( ) ) ;
// Encode the pdu as an octet string if the user passed a valid pointer.
if ( octet_str ) {
* octet_str = asn1 : : octstring_to_string ( pdu - > msg , pdu - > N_bytes ) ;
}
parent - > rlc - > write_sdu ( rnti , RB_ID_SRB0 , std : : move ( pdu ) ) ;
parent - > rlc - > write_sdu ( rnti , RB_ID_SRB0 , std : : move ( pdu ) ) ;
} else {
} else {
parent - > logger . error ( " Allocating pdu " ) ;
parent - > logger . error ( " Allocating pdu " ) ;
}
}
}
}
bool rrc : : ue : : send_dl_dcch ( const dl_dcch_msg_s * dl_dcch_msg , srsran : : unique_byte_buffer_t pdu )
bool rrc : : ue : : send_dl_dcch ( const dl_dcch_msg_s * dl_dcch_msg , srsran : : unique_byte_buffer_t pdu , std : : string * octet_str )
{
{
if ( ! pdu ) {
if ( ! pdu ) {
pdu = srsran : : make_byte_buffer ( ) ;
pdu = srsran : : make_byte_buffer ( ) ;
@ -1143,6 +1200,11 @@ bool rrc::ue::send_dl_dcch(const dl_dcch_msg_s* dl_dcch_msg, srsran::unique_byte
sprintf ( buf , " SRB%d - rnti=0x%x " , lcid , rnti ) ;
sprintf ( buf , " SRB%d - rnti=0x%x " , lcid , rnti ) ;
parent - > log_rrc_message ( buf , Tx , pdu . get ( ) , * dl_dcch_msg , dl_dcch_msg - > msg . c1 ( ) . type ( ) . to_string ( ) ) ;
parent - > log_rrc_message ( buf , Tx , pdu . get ( ) , * dl_dcch_msg , dl_dcch_msg - > msg . c1 ( ) . type ( ) . to_string ( ) ) ;
// Encode the pdu as an octet string if the user passed a valid pointer.
if ( octet_str ) {
* octet_str = asn1 : : octstring_to_string ( pdu - > msg , pdu - > N_bytes ) ;
}
parent - > pdcp - > write_sdu ( rnti , lcid , std : : move ( pdu ) ) ;
parent - > pdcp - > write_sdu ( rnti , lcid , std : : move ( pdu ) ) ;
} else {
} else {
parent - > logger . error ( " Allocating pdu " ) ;
parent - > logger . error ( " Allocating pdu " ) ;