Merge "bal packet indication bug fix, heartbeat and reboot procedures"
diff --git a/src/README.md b/src/README.md
index 7d2a1fd..1992538 100644
--- a/src/README.md
+++ b/src/README.md
@@ -1,7 +1,7 @@
 GRPC_C DEVICE SIMULATOR
 
- This is a executable(voltha_bal_driver), which will recevie asfvolt16 adapter grpc-c messages and call respective device stub.
- It will send recevied responses/asynchronous indications from Device stub to Adapter.
+This is a executable(voltha_bal_driver), which will received asfvolt16 adapter grpc-c messages and call respective device stub.
+It will send recevied responses/asynchronous indications from Device stub to Adapter.
 
 GETTING STARTED
 
@@ -11,57 +11,90 @@
 
 INSTALLATION
 
+Open Network Linux
+This guide assumes that Open Network Linux (ONL) is available at ${HOME}/OpenNetworkLinux. All the below steps need to be executed in the ONL build docker context. Refer to ONL build instructions (https://wiki.opencord.org/download/attachments/2556712/ONL_Build_Environment_Installation_Guide.pdf?api=v2).
+
+    - Download ONL source code with Kernel 3.7.10.
+```
+    > git clone https://github.com/Lewis-Kang/OpenNetworkLinux.git -b kernel_3.7.10
+```
+
+    - Start ONL build docker workspace
+```
+    > cd OpenNetworkLinux
+    > docker/tools/onlbuilder -8   # enter the docker workspace
+```
+
+Clone asfvolt16-driver
+    - The guide assumes that the asfvolt16-driver gerrit repo is cloned under the ONL toplevel directory:
+    - git clone ssh://user@gerrit.opencord.org:29418/asfvolt16-driver ${HOME}/OpenNetworkLinux/asfvolt16-driver
+
 steps to install grpc
    - Download as zip "grpc", "grpc-c", "protobuf" and "protobuf-c" from "https://github.com/opennetworkinglab/asfvolt16-driver/tree/master/third_party"
-   - place downloaded protobuf folder at grpc/thirdparty
-   - place downloaded protobuf-c folder at grpc-c/thirdparty 
-   - cd grpc/thirdparty/protobuf
+   - extract grpc at ${HOME}/OpenNetworkLinux/grpc
+   - extract grpc-c at ${HOME}/OpenNetworkLinux/grpc-c
+   - extract protobuf at ${HOME}/OpenNetworkLinux/grpc/thirdparty/protobuf
+   - extract protobuf-c folder at ${HOME}/OpenNetworkLinux/grpc-c/third_party/protobuf-c
+   - cd ${HOME}/OpenNetworkLinux/grpc/thirdparty/protobuf
       - ./autogen.sh
       - ./configure
       - make
       - sudo make install
-   - cd grpc/
-     - make 
-     - sudo make install
-
-steps to install grpc-c 
-   - cd grpc-c/thirdparty/protobuf-c
-     - ./autogen.sh
-     - ./configure
-     - export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/protobuf 
+   - cd ${HOME}/OpenNetworkLinux/grpc
      - export LD_LIBRARY_PATH=/usr/local/lib
      - make
      - sudo make install
-   
-Apply grpc-c patch 
-   - cd grpc-c/ 
+
+steps to install grpc-c
+   - cd ${HOME}/OpenNetworkLinux/grpc-c/third_party/protobuf-c
+     - ./autogen.sh
+     - ./configure
+     - export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/protobuf
+     - make
+     - sudo make install
+
+Apply grpc-c patch
+   - cd ${HOME}/OpenNetworkLinux/grpc-c/
      Patch 1:
      Apply patch in following link for grpc-c/lib - "https://github.com/Juniper/grpc-c/commit/353b40cd920cd749ed6cf71f8df17f1d5cf2c89d"
      Note:
         (This patch is having very few changes in two files(grpc-c/lib/client.c, grpc-c/lib/service.c. 
          Download these two files from above link and replace at grpc-c/lib or merge these changes manually.)       
      Patch 2:
-     Apply patch in service.c.patch and client.c.patch 
-     - cp Makefile.am grpc-c/examples/
-     - cp voltha_bal_driver.c grpc-c/examples/
-     - cp bal_stub.c grpc-c/examples/
-     - cp bal_stub.h grpc-c/examples/
-         - Note: Update voltha adaptor IP in bal_stub.c
+     Apply patch in service.c.patch and client.c.patch
+
+     - cd ${HOME}/OpenNetworkLinux
+     - cp asfvolt16-driver/device_simulator/Makefile.am grpc-c/examples/
+     - cp asfvolt16-driver/device_simulator/voltha_bal_driver.c grpc-c/examples/
+     - cp asfvolt16-driver/device_simulator/bal_stub.c grpc-c/examples/
+     - cp asfvolt16-driver/device_simulator/bal_stub.h grpc-c/examples/
+         - Note: Update voltha adaptor IP in bal_stub.c (Is this required? Not clear which variable needs to be updated).
+
+     - cd ${HOME}/OpenNetworkLinux/grpc-c
      - autoreconf --install
      - mkdir build && cd build
      - ../configure
      - make
      - sudo make install
-   
-To obtain proto files - Have a repo sync of opencord code base:
-     - cp opencord/incubator/voltha/voltha/adapters/asfvolt16_olt/protos/* examples/
+ 
+To obtain proto files - Have a repo sync of opencord voltha code base:
+     - git clone https://github.com/opencord/voltha.git ${HOME}/voltha
+     - cd ${HOME}/OpenNetworkLinux/grpc-c/
+     - cp ${HOME}/voltha/voltha/adapters/asfvolt16_olt/protos/* examples/
 
 To autogenerate code from proto files:
+     - cd ${HOME}/OpenNetworkLinux/grpc-c/build/examples
      - make autogen
-       
+
 Build voltha_bal_driver:
+     - cd ${HOME}/OpenNetworkLinux/grpc-c/build/examples
      - Note: Remove "-O2" from Makefile
-     - make clean_all;make 
+     - Note: Set EDGECORE and BRCM_PATH in Makefile
+```
+       EDGECORE = ${HOME}/OpenNetworkLinux/asfvolt16-driver/src/
+       BRCM_PATH = ${HOME}/OpenNetworkLinux/bal_src_release/bal_release
+```
+     - make clean_all;make
 
 The ultimate executable voltha_bal_driver can be found under ~/grpc-c/build/examples/.libs/