diff --git a/lib/src/upper/pdcp.cc b/lib/src/upper/pdcp.cc index 93ac0cf15..0fce441ad 100644 --- a/lib/src/upper/pdcp.cc +++ b/lib/src/upper/pdcp.cc @@ -93,10 +93,10 @@ void pdcp::reset() { // destroy all bearers pthread_rwlock_wrlock(&rwlock); - for (pdcp_map_t::iterator it = pdcp_array.begin(); it != pdcp_array.end(); ++it) { + for (pdcp_map_t::iterator it = pdcp_array.begin(); it != pdcp_array.end(); /* post increment in erase */ ) { it->second->reset(); delete(it->second); - pdcp_array.erase(it); + pdcp_array.erase(it++); } pthread_rwlock_unlock(&rwlock); diff --git a/srsenb/src/main.cc b/srsenb/src/main.cc index 32ab65ced..8cb3e1550 100644 --- a/srsenb/src/main.cc +++ b/srsenb/src/main.cc @@ -77,7 +77,7 @@ void parse_args(all_args_t *args, int argc, char* argv[]) { ("enb.tac", bpo::value(&tac)->default_value("0x0"), "Tracking Area Code") ("enb.mcc", bpo::value(&mcc)->default_value("001"), "Mobile Country Code") ("enb.mnc", bpo::value(&mnc)->default_value("01"), "Mobile Network Code") - ("enb.mme_addr", bpo::value(&args->enb.s1ap.mme_addr)->default_value("127.0.0.1"),"IP address of MME for S1 connnection") + ("enb.mme_addr", bpo::value(&args->enb.s1ap.mme_addr)->default_value("127.0.0.1"),"IP address of MME for S1 connection") ("enb.gtp_bind_addr", bpo::value(&args->enb.s1ap.gtp_bind_addr)->default_value("192.168.3.1"), "Local IP address to bind for GTP connection") ("enb.s1c_bind_addr", bpo::value(&args->enb.s1ap.s1c_bind_addr)->default_value("192.168.3.1"), "Local IP address to bind for S1AP connection") ("enb.phy_cell_id", bpo::value(&args->enb.pci)->default_value(0), "Physical Cell Identity (PCI)") diff --git a/srsenb/src/phy/txrx.cc b/srsenb/src/phy/txrx.cc index da92ad921..b1455936e 100644 --- a/srsenb/src/phy/txrx.cc +++ b/srsenb/src/phy/txrx.cc @@ -125,7 +125,7 @@ void txrx::run_thread() srslte_timestamp_copy(&tx_time, &rx_time); srslte_timestamp_add(&tx_time, 0, HARQ_DELAY_MS*1e-3); - Debug("Settting TTI=%d, tx_mutex=%d, tx_time=%ld:%f to worker %d\n", + Debug("Setting TTI=%d, tx_mutex=%d, tx_time=%ld:%f to worker %d\n", tti, tx_worker_cnt, tx_time.full_secs, tx_time.frac_secs, worker->get_id()); diff --git a/srsenb/src/upper/rrc.cc b/srsenb/src/upper/rrc.cc index 5c00e94f8..c7297cb37 100644 --- a/srsenb/src/upper/rrc.cc +++ b/srsenb/src/upper/rrc.cc @@ -552,7 +552,7 @@ void rrc::parse_ul_dcch(uint16_t rnti, uint32_t lcid, byte_buffer_t *pdu) if (users.count(rnti)) { users[rnti].parse_ul_dcch(lcid, pdu); } else { - rrc_log->error("Processing %s: Unkown rnti=0x%x\n", rb_id_text[lcid], rnti); + rrc_log->error("Processing %s: Unknown rnti=0x%x\n", rb_id_text[lcid], rnti); } } } @@ -576,7 +576,7 @@ void rrc::process_rl_failure(uint16_t rnti) rrc_log->info("%d Radio-Link failure detected rnti=0x%x\n", n_rfl, rnti); } } else { - rrc_log->error("Radio-Link failure detected for uknown rnti=0x%x\n", rnti); + rrc_log->error("Radio-Link failure detected for unknown rnti=0x%x\n", rnti); } } diff --git a/srsenb/src/upper/s1ap.cc b/srsenb/src/upper/s1ap.cc index 6fa1ccd56..b7d34d01e 100644 --- a/srsenb/src/upper/s1ap.cc +++ b/srsenb/src/upper/s1ap.cc @@ -288,7 +288,10 @@ bool s1ap::connect_mme() s1ap_log->error("Error converting IP address (%s) to sockaddr_in structure\n", args.s1c_bind_addr.c_str()); return false; } - bind(socket_fd, (struct sockaddr *)&local_addr, sizeof(local_addr)); + if (bind(socket_fd, (struct sockaddr *)&local_addr, sizeof(local_addr)) != 0) { + s1ap_log->error("Failed to bind on S1-C address %s: %s errno %d\n", args.s1c_bind_addr.c_str(), strerror(errno), errno); + return false; + } // Connect to the MME address memset(&mme_addr, 0, sizeof(struct sockaddr_in)); @@ -1043,7 +1046,7 @@ std::string s1ap::get_cause(LIBLTE_S1AP_CAUSE_STRUCT *c) cause += liblte_s1ap_causemisc_text[c->choice.misc.e]; break; default: - cause += "unkown"; + cause += "unknown"; break; } return cause; diff --git a/srsepc/src/main.cc b/srsepc/src/main.cc index 697cfe178..d1df58ffc 100644 --- a/srsepc/src/main.cc +++ b/srsepc/src/main.cc @@ -112,7 +112,7 @@ parse_args(all_args_t *args, int argc, char* argv[]) { ("mme.tac", bpo::value(&tac)->default_value("0x0"), "Tracking Area Code") ("mme.mcc", bpo::value(&mcc)->default_value("001"), "Mobile Country Code") ("mme.mnc", bpo::value(&mnc)->default_value("01"), "Mobile Network Code") - ("mme.mme_bind_addr", bpo::value(&mme_bind_addr)->default_value("127.0.0.1"), "IP address of MME for S1 connnection") + ("mme.mme_bind_addr", bpo::value(&mme_bind_addr)->default_value("127.0.0.1"), "IP address of MME for S1 connection") ("mme.dns_addr", bpo::value(&dns_addr)->default_value("8.8.8.8"), "IP address of the DNS server for the UEs") ("mme.apn", bpo::value(&mme_apn)->default_value(""), "Set Access Point Name (APN) for data services") ("hss.db_file", bpo::value(&hss_db_file)->default_value("ue_db.csv"), ".csv file that stores UE's keys") diff --git a/srsepc/src/mbms-gw/mbms-gw.cc b/srsepc/src/mbms-gw/mbms-gw.cc index bec61596b..bb7f18957 100644 --- a/srsepc/src/mbms-gw/mbms-gw.cc +++ b/srsepc/src/mbms-gw/mbms-gw.cc @@ -319,7 +319,7 @@ mbms_gw::handle_sgi_md_pdu(srslte::byte_buffer_t *msg) int n = sendto(m_m1u, msg->msg, msg->N_bytes, 0, (sockaddr *) &m_m1u_multi_addr, sizeof(struct sockaddr)); if(n<0){ - m_mbms_gw_log->console("Error writting to M1-U socket.\n"); + m_mbms_gw_log->console("Error writing to M1-U socket.\n"); } else{ m_mbms_gw_log->debug("Sent %d Bytes\n", msg->N_bytes); diff --git a/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc b/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc index e6be98649..bf610abc7 100644 --- a/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc +++ b/srsepc/src/mme/s1ap_ctx_mngmt_proc.cc @@ -179,7 +179,7 @@ s1ap_ctx_mngmt_proc::send_initial_context_setup_request(nas *nas_ctx, uint16_t e struct in_addr addr; addr.s_addr = htonl(sgw_s1u_ip); - m_s1ap_log->info("Sent Intial Context Setup Request. E-RAB id %d \n",erab_ctx_req->e_RAB_ID.E_RAB_ID); + m_s1ap_log->info("Sent Initial Context Setup Request. E-RAB id %d \n",erab_ctx_req->e_RAB_ID.E_RAB_ID); m_s1ap_log->info("Initial Context -- S1-U TEID 0x%x. IP %s \n", sgw_s1u_teid,inet_ntoa(addr)); m_s1ap_log->console("Initial Context Setup Request -- eNB UE S1AP Id %d, MME UE S1AP Id %d\n",in_ctxt_req->eNB_UE_S1AP_ID.ENB_UE_S1AP_ID, in_ctxt_req->MME_UE_S1AP_ID.MME_UE_S1AP_ID); m_s1ap_log->console("Initial Context Setup Request -- E-RAB id %d\n",erab_ctx_req->e_RAB_ID.E_RAB_ID); diff --git a/srsepc/src/mme/s1ap_mngmt_proc.cc b/srsepc/src/mme/s1ap_mngmt_proc.cc index 079eca100..dbd45cdd9 100644 --- a/srsepc/src/mme/s1ap_mngmt_proc.cc +++ b/srsepc/src/mme/s1ap_mngmt_proc.cc @@ -94,8 +94,8 @@ s1ap_mngmt_proc::handle_s1_setup_request(LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRU //Check matching PLMNs if(enb_ctx.plmn!=m_s1ap->get_plmn()){ - m_s1ap_log->console("Sending S1 Setup Failure - Unkown PLMN\n"); - m_s1ap_log->warning("Sending S1 Setup Failure - Unkown PLMN\n"); + m_s1ap_log->console("Sending S1 Setup Failure - Unknown PLMN\n"); + m_s1ap_log->warning("Sending S1 Setup Failure - Unknown PLMN\n"); pack_s1_setup_failure(LIBLTE_S1AP_CAUSEMISC_UNKNOWN_PLMN,reply_buffer); } else{ diff --git a/srsepc/src/mme/s1ap_nas_transport.cc b/srsepc/src/mme/s1ap_nas_transport.cc index e42fa3d29..fd798ac7f 100644 --- a/srsepc/src/mme/s1ap_nas_transport.cc +++ b/srsepc/src/mme/s1ap_nas_transport.cc @@ -343,5 +343,4 @@ s1ap_nas_transport::send_downlink_nas_transport(uint32_t enb_ue_s1ap_id, uint32_ return true; } - } //namespace srsepc diff --git a/srsue/src/mac/demux.cc b/srsue/src/mac/demux.cc index 28e17d5b0..3c656161d 100644 --- a/srsue/src/mac/demux.cc +++ b/srsue/src/mac/demux.cc @@ -245,10 +245,11 @@ bool demux::process_ce(srslte::sch_subh *subh) { case srslte::sch_subh::TA_CMD: phy_h->set_timeadv(subh->get_ta_cmd()); Info("Received TA=%d\n", subh->get_ta_cmd()); - - // Start or restart timeAlignmentTimer - time_alignment_timer->reset(); - time_alignment_timer->run(); + // Start or restart timeAlignmentTimer only if running + if (time_alignment_timer->is_running()) { + time_alignment_timer->reset(); + time_alignment_timer->run(); + } break; case srslte::sch_subh::PADDING: break; diff --git a/srsue/src/mac/mac.cc b/srsue/src/mac/mac.cc index 964e394e9..516d1d97f 100644 --- a/srsue/src/mac/mac.cc +++ b/srsue/src/mac/mac.cc @@ -64,6 +64,10 @@ bool mac::init(phy_interface_mac *phy, rlc_interface_mac *rlc, rrc_interface_mac timer_alignment = timers.get_unique_id(); contention_resolution_timer = timers.get_unique_id(); + log_h->debug("Timer Timing Alignment ID 0x%x\n", timer_alignment); + log_h->debug("Timer Contention Resolution ID 0x%x\n", + contention_resolution_timer); + bsr_procedure.init( rlc_h, log_h, &config, &timers); phr_procedure.init(phy_h, log_h, &config, &timers); mux_unit.init ( rlc_h, log_h, &bsr_procedure, &phr_procedure); @@ -364,9 +368,14 @@ void mac::setup_timers() // stop currently running time alignment timer if (timers.get(timer_alignment)->is_running()) { timers.get(timer_alignment)->stop(); + log_h->debug("Stop running MAC Time Alignment Timer with ID 0x%x\n", + timer_alignment); } - int value = liblte_rrc_time_alignment_timer_num[config.main.time_alignment_timer]; + int value = + liblte_rrc_time_alignment_timer_num[config.main.time_alignment_timer]; + log_h->info("Set MAC Time Alignment Timer (0x%x) to: %d value: %d \n", + timer_alignment, config.main.time_alignment_timer, value); if (value > 0) { timers.get(timer_alignment)->set(this, value); } @@ -382,9 +391,11 @@ void mac::timer_expired(uint32_t timer_id) } /* Function called on expiry of TimeAlignmentTimer */ -void mac::timer_alignment_expire() -{ - printf("TimeAlignment timer has expired value=%d ms\n", timers.get(timer_alignment)->get_timeout()); +void mac::timer_alignment_expire() { + log_h->console("TimeAlignment timer has expired value=%d ms\n", + timers.get(timer_alignment)->get_timeout()); + log_h->warning("TimeAlignment timer has expired value=%d ms\n", + timers.get(timer_alignment)->get_timeout()); rrc_h->release_pucch_srs(); dl_harq.reset(); ul_harq.reset(); diff --git a/srsue/src/mac/proc_bsr.cc b/srsue/src/mac/proc_bsr.cc index dcd2d6353..9b29c9128 100644 --- a/srsue/src/mac/proc_bsr.cc +++ b/srsue/src/mac/proc_bsr.cc @@ -308,7 +308,7 @@ bool bsr_proc::need_to_send_bsr_on_ul_grant(uint32_t grant_size, bsr_t *bsr) generate_bsr(bsr, 0); bsr_sz = bsr->format==LONG_BSR?3:1; if (total_data <= (int)grant_size && total_data + 1 + bsr_sz > grant_size) { - Debug("Grant is not enough to accomodate the BSR MAC CE\n"); + Debug("Grant is not enough to accommodate the BSR MAC CE\n"); } else { Debug("BSR: Including Regular BSR: grant_size=%d, total_data=%d, bsr_sz=%d\n", grant_size, total_data, bsr_sz); diff --git a/srsue/src/mac/proc_ra.cc b/srsue/src/mac/proc_ra.cc index 11e53195c..8710c9e1e 100644 --- a/srsue/src/mac/proc_ra.cc +++ b/srsue/src/mac/proc_ra.cc @@ -179,8 +179,11 @@ void ra_proc::process_timeadv_cmd(uint32_t ta) { if (preambleIndex == 0) { // Preamble not selected by UE MAC phy_h->set_timeadv_rar(ta); - time_alignment_timer->reset(); - time_alignment_timer->run(); + // Only if timer is running reset the timer + if (time_alignment_timer->is_running()) { + time_alignment_timer->reset(); + time_alignment_timer->run(); + } Debug("Applying RAR TA CMD %d\n", ta); } else { // Preamble selected by UE MAC diff --git a/srsue/src/main.cc b/srsue/src/main.cc index 1ecdca78b..07d884197 100644 --- a/srsue/src/main.cc +++ b/srsue/src/main.cc @@ -136,7 +136,7 @@ void parse_args(all_args_t *args, int argc, char *argv[]) { ("usim.imei", bpo::value(&args->usim.imei), "USIM IMEI") ("usim.k", bpo::value(&args->usim.k), "USIM K") ("usim.pin", bpo::value(&args->usim.pin), "PIN in case real SIM card is used") - ("usim.reader", bpo::value(&args->usim.reader)->default_value(""), "Force specifiy PCSC reader. Default: Try all available readers.") + ("usim.reader", bpo::value(&args->usim.reader)->default_value(""), "Force specific PCSC reader. Default: Try all available readers.") /* Expert section */ ("expert.ip_netmask", diff --git a/srsue/src/phy/phch_recv.cc b/srsue/src/phy/phch_recv.cc index f809503c2..b544b3b1f 100644 --- a/srsue/src/phy/phch_recv.cc +++ b/srsue/src/phy/phch_recv.cc @@ -1617,7 +1617,7 @@ void phch_recv::intra_measure::write(uint32_t tti, cf_t *data, uint32_t nsamples } if (receiving == true) { if (srslte_ringbuffer_write(&ring_buffer, data, nsamples*sizeof(cf_t)) < (int) (nsamples*sizeof(cf_t))) { - Warning("Error writting to ringbuffer\n"); + Warning("Error writing to ringbuffer\n"); receiving = false; } else { receive_cnt++;