Replace a string with a const char * in the rlc to_string.

master
faluco 4 years ago committed by faluco
parent 289559af82
commit 0afd59a5a0

@ -22,7 +22,7 @@
namespace srsran { namespace srsran {
enum class rlc_mode_t { tm, um, am, nulltype }; enum class rlc_mode_t { tm, um, am, nulltype };
inline std::string to_string(const rlc_mode_t& mode, bool long_txt = true) inline const char* to_string(const rlc_mode_t& mode, bool long_txt = true)
{ {
constexpr static const char* long_options[] = {"Transparent Mode", "Unacknowledged Mode", "Acknowledged Mode"}; constexpr static const char* long_options[] = {"Transparent Mode", "Unacknowledged Mode", "Acknowledged Mode"};
constexpr static const char* short_options[] = {"TM", "UM", "AM"}; constexpr static const char* short_options[] = {"TM", "UM", "AM"};

@ -462,8 +462,7 @@ void rlc::add_bearer(uint32_t lcid, const rlc_config_t& cnfg)
goto delete_and_exit; goto delete_and_exit;
} }
logger.info( logger.info("Added %s radio bearer with LCID %d in %s", to_string(cnfg.rat), lcid, to_string(cnfg.rlc_mode));
"Added %s radio bearer with LCID %d in %s", to_string(cnfg.rat), lcid, to_string(cnfg.rlc_mode).c_str());
rlc_entity = NULL; rlc_entity = NULL;
} }
@ -475,8 +474,7 @@ void rlc::add_bearer(uint32_t lcid, const rlc_config_t& cnfg)
} }
} }
logger.info( logger.info("Configured %s radio bearer with LCID %d in %s", to_string(cnfg.rat), lcid, to_string(cnfg.rlc_mode));
"Configured %s radio bearer with LCID %d in %s", to_string(cnfg.rat), lcid, to_string(cnfg.rlc_mode).c_str());
delete_and_exit: delete_and_exit:
if (rlc_entity) { if (rlc_entity) {

@ -152,7 +152,7 @@ int rlc_tm::read_pdu(uint8_t* payload, uint32_t nof_bytes)
pdu_size, pdu_size,
"%s Tx %s PDU, queue size=%d, bytes=%d", "%s Tx %s PDU, queue size=%d, bytes=%d",
rrc->get_rb_name(lcid), rrc->get_rb_name(lcid),
srsran::to_string(rlc_mode_t::tm).c_str(), srsran::to_string(rlc_mode_t::tm),
ul_queue.size(), ul_queue.size(),
ul_queue.size_bytes()); ul_queue.size_bytes());

@ -52,7 +52,7 @@ bool rlc_um_lte::configure(const rlc_config_t& cnfg_)
logger.info("%s configured in %s: t_reordering=%d ms, rx_sn_field_length=%u bits, tx_sn_field_length=%u bits", logger.info("%s configured in %s: t_reordering=%d ms, rx_sn_field_length=%u bits, tx_sn_field_length=%u bits",
rb_name.c_str(), rb_name.c_str(),
srsran::to_string(cnfg_.rlc_mode).c_str(), srsran::to_string(cnfg_.rlc_mode),
cfg.um.t_reordering, cfg.um.t_reordering,
srsran::to_number(cfg.um.rx_sn_field_length), srsran::to_number(cfg.um.rx_sn_field_length),
srsran::to_number(cfg.um.tx_sn_field_length)); srsran::to_number(cfg.um.tx_sn_field_length));

@ -51,7 +51,7 @@ bool rlc_um_nr::configure(const rlc_config_t& cnfg_)
logger.info("%s configured in %s: sn_field_length=%u bits", logger.info("%s configured in %s: sn_field_length=%u bits",
rb_name.c_str(), rb_name.c_str(),
srsran::to_string(cnfg_.rlc_mode).c_str(), srsran::to_string(cnfg_.rlc_mode),
srsran::to_number(cfg.um_nr.sn_field_length)); srsran::to_number(cfg.um_nr.sn_field_length));
rx_enabled = true; rx_enabled = true;

Loading…
Cancel
Save