X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fo1%2FO1Interface.cpp;h=b1fdeff124294572201616b47c7aff8c4c0acba6;hb=0c4403cc2355cc38d01c6645b1dad36dd4c1daa7;hp=c3135b53a54e6ab3e9394bd5d044db8c2b7a8381;hpb=b92944068f8a7b643b333515e424517db4192b61;p=o-du%2Fl2.git diff --git a/src/o1/O1Interface.cpp b/src/o1/O1Interface.cpp index c3135b53a..b1fdeff12 100644 --- a/src/o1/O1Interface.cpp +++ b/src/o1/O1Interface.cpp @@ -21,6 +21,9 @@ #include "O1Interface.h" #include "O1App.hpp" #include "GlobalDefs.hpp" +#include "PnfRegistrationThread.hpp" +#include "ConfigLoader.hpp" + #include #include @@ -43,7 +46,11 @@ ******************************************************************/ int static check_O1_module_status(void){ - for( int i = 0; i < 5 ; i++) + + const int N_RETRY = 5; + const int RETRY_DELAY = 1; + + for( int i = 0; i < N_RETRY; i++) { if( O1App::instance().getStartupStatus() == true) { @@ -51,7 +58,7 @@ int static check_O1_module_status(void){ } else { - sleep(1); + sleep(RETRY_DELAY); } } @@ -79,19 +86,48 @@ int static check_O1_module_status(void){ int start_O1_module(void) { + if( !ConfigLoader::instance().loadConfigurations() ) + return O1::FAILURE; + if(O1App::instance().start() == false){ - O1_LOG("\nO1 O1Interface : Failed to start"); + O1_LOG("\nO1 O1Interface : Failed to start"); return O1::FAILURE; } if(O1App::instance().setAffinity(O1::CPU_CORE)) { - O1_LOG("\nO1 O1Interface : CPU affinity set " ); + O1_LOG("\nO1 O1Interface : CPU affinity set for O1App thread to" ); O1App::instance().printAffinity(); } return check_O1_module_status(); } +/******************************************************************* + * + * @brief Send VES PNF Registration Request + * + * @details + * + * Function : sendPnfRegistration + * + * Functionality: + * - Create a thread and send VES PNF Registration Request + * + * + * @params[in] void + * @return void + ******************************************************************/ + +void sendPnfRegistration(void) +{ + PnfRegistrationThread::instance().start(); + if(PnfRegistrationThread::instance().setAffinity(O1::CPU_CORE)) + { + O1_LOG("\nO1 O1Interface : CPU affinity set for PnfRegistration thread to " ); + PnfRegistrationThread::instance().printAffinity(); + } +} + /********************************************************************** End of file