VOL-1050 Delay stats collection after connection
Move the state of connectivity and activation to its own file (state)
It handles starting/stopping statistics collection and provides a hook for future actions
Change-Id: If6a7b4015824716ff45781e39f29ca7f06933702
diff --git a/src/indications.cc b/src/indications.cc
index cbde803..df60fcb 100644
--- a/src/indications.cc
+++ b/src/indications.cc
@@ -19,7 +19,10 @@
#include "utils.h"
#include "stats_collection.h"
#include "translation.h"
+#include "state.h"
+
#include <string>
+
extern "C"
{
#include <bcmos_system.h>
@@ -32,6 +35,7 @@
Queue<openolt::Indication> oltIndQ;
//Queue<openolt::Indication*> oltIndQ;
+
bool subscribed = false;
bcmos_errno OmciIndication(bcmbal_obj *obj);
@@ -44,10 +48,10 @@
bcmbal_access_terminal_oper_status_change *acc_term_ind = (bcmbal_access_terminal_oper_status_change *)obj;
if (acc_term_ind->data.new_oper_status == BCMBAL_STATUS_UP) {
olt_ind->set_oper_state("up");
- start_collecting_statistics();
+ state::activate();
} else {
olt_ind->set_oper_state("down");
- stop_collecting_statistics();
+ state::deactivate();
}
ind.set_allocated_olt_ind(olt_ind);
std::cout << "olt indication, oper_state:" << ind.olt_ind().oper_state() << std::endl;