Code Review
/
o-du
/
l2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
[ JIRA Id - ODUHIGH-606 ] Fixing null memory size allocation issue
[o-du/l2.git]
/
src
/
o1
/
O1App.cpp
diff --git
a/src/o1/O1App.cpp
b/src/o1/O1App.cpp
index
b4cfbde
..
0d2ba2e
100644
(file)
--- a/
src/o1/O1App.cpp
+++ b/
src/o1/O1App.cpp
@@
-24,9
+24,13
@@
#include "O1App.hpp"
#include "GlobalDefs.hpp"
#include "SessionHandler.hpp"
#include "O1App.hpp"
#include "GlobalDefs.hpp"
#include "SessionHandler.hpp"
-#include "C
onfig
Interface.h"
+#include "C
m
Interface.h"
#include <unistd.h>
#include <unistd.h>
+#include "VesUtils.hpp"
+#include "VesEventHandler.hpp"
+
+
/*******************************************************************
*
* @brief Constructor
/*******************************************************************
*
* @brief Constructor
@@
-69,7
+73,7
@@
O1App::~O1App()
/*******************************************************************
*
/*******************************************************************
*
- * @brief Runs the O1 modules as a thread
+ * @brief Runs the O1 modules as a thread
*
* @details
*
*
* @details
*
@@
-87,42
+91,48
@@
O1App::~O1App()
bool O1App::run()
{
bool O1App::run()
{
-
+ const int SLEEP_INTERVAL = 2;
+ const int DEFAUL_CELL_ID = 1;
SessionHandler sessHdlr;
SessionHandler sessHdlr;
+
+ /*setting default cell state disabled*/
+ setCellOpState(DEFAUL_CELL_ID, DISABLED, INACTIVE);
+
/* Start Netconf session and subscribe to yang modules */
try
{
if( !sessHdlr.init() )
{
/* 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;
}
}
return false;
}
}
- catch( const std::exception& e )
+ catch( const std::exception& e )
{
O1_LOG("\nO1 O1App : Exception : %s", e.what());
return false;
}
{
O1_LOG("\nO1 O1App : Exception : %s", e.what());
return false;
}
-
+
/* Start the Unix Socket Server to listen for alarm messages */
/* Start the Unix Socket Server to listen for alarm messages */
+ AlarmManager::instance().subscribe(&mUxSocketServer);
if( mUxSocketServer.start() )
if( mUxSocketServer.start() )
- {
-
+ {
+
if(mUxSocketServer.setAffinity(O1::CPU_CORE))
{
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();
}
mUxSocketServer.printAffinity();
}
-
- sleep(
2
);
- if( mUxSocketServer.isRunning() )
+
+ sleep(
SLEEP_INTERVAL
);
+ if( mUxSocketServer.isRunning() )
{
mStartupStatus = true;
{
mStartupStatus = true;
- O1_LOG("\nO1 O1App : Unix Socket server started
\n
");
+ O1_LOG("\nO1 O1App : Unix Socket server started");
}
else
{
}
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*/
return false;
}
/* Wait for the Unix Socket Server thread to end*/
@@
-130,7
+140,7
@@
bool O1App::run()
}
else
{
}
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;
return false;
}
return true;