X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fo1%2FO1App.cpp;h=0d2ba2e1bde713f3beb7a46fff2fb4de3c27a938;hb=6dc8a4c17da24847b3a3aee91b37151f77a8a5bc;hp=05bdf7ed9c2384d67088cbfe7867f7608b1cff52;hpb=ef723e2e773fc6a6dcff43005569e509201df198;p=o-du%2Fl2.git diff --git a/src/o1/O1App.cpp b/src/o1/O1App.cpp index 05bdf7ed9..0d2ba2e1b 100644 --- a/src/o1/O1App.cpp +++ b/src/o1/O1App.cpp @@ -24,11 +24,13 @@ #include "O1App.hpp" #include "GlobalDefs.hpp" #include "SessionHandler.hpp" -#include "ConfigInterface.h" +#include "CmInterface.h" #include #include "VesUtils.hpp" #include "VesEventHandler.hpp" + + /******************************************************************* * * @brief Constructor @@ -71,7 +73,7 @@ O1App::~O1App() /******************************************************************* * - * @brief Runs the O1 modules as a thread + * @brief Runs the O1 modules as a thread * * @details * @@ -89,51 +91,48 @@ O1App::~O1App() bool O1App::run() { - + const int SLEEP_INTERVAL = 2; + const int DEFAUL_CELL_ID = 1; SessionHandler sessHdlr; - /*send ves PNF registration request*/ - VesEventHandler vesEvtHdr; - O1_LOG("\nO1 O1App : Sending VES Event"); - if(!vesEvtHdr.send(VesEventType::PNF_REGISTRATION)) - { - O1_LOG("\nO1 O1App : Could not send VES Request"); - return false; - } + + /*setting default cell state disabled*/ + setCellOpState(DEFAUL_CELL_ID, DISABLED, INACTIVE); /* Start Netconf session and subscribe to yang modules */ try { if( !sessHdlr.init() ) { - O1_LOG("\nO1 O1App : SessionHandler initialization failed "); + O1_LOG("\nO1 O1App : SessionHandler initialization failed "); return false; } } - catch( const std::exception& e ) + catch( const std::exception& e ) { O1_LOG("\nO1 O1App : Exception : %s", e.what()); return false; } - + /* Start the Unix Socket Server to listen for alarm messages */ + AlarmManager::instance().subscribe(&mUxSocketServer); if( mUxSocketServer.start() ) - { - + { + if(mUxSocketServer.setAffinity(O1::CPU_CORE)) { - O1_LOG("\nO1 O1App : CPU affinity set " ); + O1_LOG("\nO1 O1App : CPU affinity set for UnixSocketServer thread to " ); mUxSocketServer.printAffinity(); } - - sleep(2); - if( mUxSocketServer.isRunning() ) + + sleep(SLEEP_INTERVAL); + if( mUxSocketServer.isRunning() ) { mStartupStatus = true; - O1_LOG("\nO1 O1App : Unix Socket server started\n"); + O1_LOG("\nO1 O1App : Unix Socket server started"); } else { - O1_LOG("\nO1 O1App : Unix Socket server failed to start\n"); + O1_LOG("\nO1 O1App : Unix Socket server failed to start"); return false; } /* Wait for the Unix Socket Server thread to end*/ @@ -141,7 +140,7 @@ bool O1App::run() } else { - O1_LOG("\nO1 O1App : Unix Socket server failed to start\n"); + O1_LOG("\nO1 O1App : Unix Socket server failed to start"); return false; } return true;