X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fo1%2FO1Interface.cpp;h=c0c552a384bf5f1de42b847b2ac35fd73b88b87b;hb=refs%2Fchanges%2F35%2F6535%2F5;hp=c3135b53a54e6ab3e9394bd5d044db8c2b7a8381;hpb=2dc9d6735bc5ff973a761b7d6b3f71f97e95d60e;p=o-du%2Fl2.git diff --git a/src/o1/O1Interface.cpp b/src/o1/O1Interface.cpp index c3135b53a..c0c552a38 100644 --- a/src/o1/O1Interface.cpp +++ b/src/o1/O1Interface.cpp @@ -21,6 +21,8 @@ #include "O1Interface.h" #include "O1App.hpp" #include "GlobalDefs.hpp" +#include "PnfRegistrationThread.hpp" + #include #include @@ -43,7 +45,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 +57,7 @@ int static check_O1_module_status(void){ } else { - sleep(1); + sleep(RETRY_DELAY); } } @@ -80,18 +86,44 @@ int start_O1_module(void) { 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