[VOL-3548] Differentiate between OLT gRPC channel disconnect and device reboot

- Return the previously_connected state flag in response to GetDeviceInfo to VOLTHA

Change-Id: I3a39eccdda386658226c6379a4815900b808795d
diff --git a/BUILDING.md b/BUILDING.md
index e0a5dfd..d8599c6 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -158,7 +158,7 @@
 make OPENOLTDEVICE=asfvolt16 OPENOLT_PROTO_VER=master
 ```
 
-By default, the `OPENOLT_PROTO_VER` defaults to git tag *v4.0.14* of the
+By default, the `OPENOLT_PROTO_VER` defaults to git tag *v4.0.15* of the
 [voltha-protos](https://gerrit.opencord.org/gitweb?p=voltha-protos.git;a=summary)
 repo.
 
diff --git a/Makefile b/Makefile
index a689a37..ecd0b52 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@
 
 ## Variables
 OPENOLTDEVICE     ?= asfvolt16
-OPENOLT_PROTO_VER ?= v4.0.14
+OPENOLT_PROTO_VER ?= v4.0.15
 
 DOCKER                     ?= docker
 DOCKER_REGISTRY            ?=
diff --git a/agent/Makefile.in b/agent/Makefile.in
index 5ccea59..50636d7 100644
--- a/agent/Makefile.in
+++ b/agent/Makefile.in
@@ -42,7 +42,7 @@
 # This specifies the GIT tag in https://github.com/opencord/voltha-protos
 # repo that we need to refer to, to pick the right version of
 # openolt.proto and tech_profile.proto
-OPENOLT_PROTO_VER ?= v4.0.14
+OPENOLT_PROTO_VER ?= v4.0.15
 
 # Variables used for Inband build
 INBAND = "n"
diff --git a/agent/common/server.cc b/agent/common/server.cc
index e04a9ba..2b7a915 100644
--- a/agent/common/server.cc
+++ b/agent/common/server.cc
@@ -147,7 +147,7 @@
         std::cout << "Connection to Voltha established. Indications enabled"
         << std::endl;
 
-        if (state.previsouly_connected()) {
+        if (state.previously_connected()) {
             // Reconciliation / recovery case
             std::cout << "Reconciliation / Recovery case" << std::endl;
             if (state.is_activated()){
diff --git a/agent/common/state.h b/agent/common/state.h
index 6092aa8..b554abf 100644
--- a/agent/common/state.h
+++ b/agent/common/state.h
@@ -28,7 +28,7 @@
         return activated;
     }
 
-    bool previsouly_connected() {
+    bool previously_connected() {
         return connected_once;
     }
 
diff --git a/agent/src/core_api_handler.cc b/agent/src/core_api_handler.cc
index 3d8bd93..95a3a67 100644
--- a/agent/src/core_api_handler.cc
+++ b/agent/src/core_api_handler.cc
@@ -214,6 +214,7 @@
     openolt_read_sysinfo("Serial Number", serial_number);
     OPENOLT_LOG(INFO, openolt_log_id, "Fetched device serial number %s\n", serial_number);
     device_info->set_device_serial_number(serial_number);
+    device_info->set_previously_connected(state.previously_connected());
 
     char device_id[OPENOLT_FIELD_LEN];
     memset(device_id, '\0', OPENOLT_FIELD_LEN);
diff --git a/agent/test/Makefile b/agent/test/Makefile
index df93b7c..5f545e4 100644
--- a/agent/test/Makefile
+++ b/agent/test/Makefile
@@ -21,7 +21,7 @@
 TOP_DIR=`pwd`
 OPENOLTDEVICE ?= asfvolt16
 
-OPENOLT_PROTO_VER ?= v4.0.14
+OPENOLT_PROTO_VER ?= v4.0.15
 
 ########################################################################
 ##
diff --git a/protos/Makefile b/protos/Makefile
index 8b28160..84d0b0b 100644
--- a/protos/Makefile
+++ b/protos/Makefile
@@ -19,7 +19,7 @@
 # This specifies the GIT tag in https://github.com/opencord/voltha-protos
 # repo that we need to refer to, to pick the right version of
 # openolt.proto, ext_config.proto and tech_profile.proto
-OPENOLT_PROTO_VER ?= v4.0.14
+OPENOLT_PROTO_VER ?= v4.0.15
 
 CXX ?= g++
 CPPFLAGS += `pkg-config --cflags protobuf grpc` -I googleapis/gens -I./