From bfb7f12298b3c159e1814f1aa92efe1769d96d9a Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Fri, 20 Oct 2017 14:16:19 +0100 Subject: [PATCH] Fixed small bug with sleep. --- srsepc/hdr/mme/s1ap.h | 15 +++------------ srsepc/src/main.cc | 2 +- srsepc/src/mme/mme.cc | 6 ------ srsepc/src/mme/s1ap.cc | 26 ++++++++++++++------------ 4 files changed, 18 insertions(+), 31 deletions(-) diff --git a/srsepc/hdr/mme/s1ap.h b/srsepc/hdr/mme/s1ap.h index d8e347661..6052ba3a1 100644 --- a/srsepc/hdr/mme/s1ap.h +++ b/srsepc/hdr/mme/s1ap.h @@ -36,7 +36,7 @@ #include #include #include - +#include #include "mme/s1ap_common.h" #include "mme/s1ap_mngmt_proc.h" @@ -71,20 +71,11 @@ private: s1ap_args_t m_s1ap_args; uint32_t m_plmn; - /* - uint8_t m_mme_code; - uint16_t m_mme_group; - uint16_t m_tac; // 16-bit tac - uint16_t m_mcc; // BCD-coded with 0xF filler - uint16_t m_mnc; // BCD-coded with 0xF filler - uint32_t m_plmn; - - std::string m_mme_bind_addr; - std::string m_mme_name; - */ srslte::log *m_s1ap_log; int m_s1mme; + std::map m_active_enbs; + s1ap_mngmt_proc m_s1ap_mngmt_proc; }; diff --git a/srsepc/src/main.cc b/srsepc/src/main.cc index 4920519dc..078a2c7c7 100644 --- a/srsepc/src/main.cc +++ b/srsepc/src/main.cc @@ -149,7 +149,7 @@ main (int argc,char * argv[] ) mme->start(); while(running) { - sleep(0.5); + sleep(1); } mme->stop(); diff --git a/srsepc/src/mme/mme.cc b/srsepc/src/mme/mme.cc index cdea2f170..6e3a23238 100644 --- a/srsepc/src/mme/mme.cc +++ b/srsepc/src/mme/mme.cc @@ -106,12 +106,6 @@ mme::stop() return; } -int -mme::get_s1_mme() -{ - return m_s1ap.get_s1_mme(); -} - void mme::run_thread() { diff --git a/srsepc/src/mme/s1ap.cc b/srsepc/src/mme/s1ap.cc index 765a0646e..51e7412cd 100644 --- a/srsepc/src/mme/s1ap.cc +++ b/srsepc/src/mme/s1ap.cc @@ -24,8 +24,6 @@ * */ -#include //TODO Remove - #include "srslte/common/bcd_helpers.h" #include "mme/s1ap.h" @@ -43,15 +41,7 @@ s1ap::~s1ap() int s1ap::init(s1ap_args_t s1ap_args, srslte::log *s1ap_log) { - /* - m_mme_code = s1ap_args.mme_code ; - m_mme_group = s1ap_args.mme_group; - m_tac = s1ap_args.tac; - m_mcc = s1ap_args.mcc; - m_mnc = s1ap_args.mnc; - m_mme_bind_addr = s1ap_args.mme_bind_addr; - m_mme_name = std::string("srsmme0"); - */ + m_s1ap_args = s1ap_args; srslte::s1ap_mccmnc_to_plmn(s1ap_args.mcc, s1ap_args.mnc, &m_plmn); @@ -194,9 +184,21 @@ s1ap::handle_s1_setup_request(LIBLTE_S1AP_MESSAGE_S1SETUPREQUEST_STRUCT *msg, st m_s1ap_mngmt_proc.pack_s1_setup_failure(LIBLTE_S1AP_CAUSEMISC_UNKNOWN_PLMN,&reply_msg); } else{ + /* + if(m_active_enbs.find(enb_ctx.enb_id)) + { + //eNB already registered + } + else + { + //new eNB + + } + */ + m_active_enbs.insert(std::pair(enb_ctx.enb_id,enb_ctx)); + m_s1ap_mngmt_proc.pack_s1_setup_response(m_s1ap_args, &reply_msg); m_s1ap_log->console("S1 Setup Response\n"); m_s1ap_log->info("S1 Setup Response\n"); - m_s1ap_mngmt_proc.pack_s1_setup_response(m_s1ap_args, &reply_msg); } //Send Reply to eNB