diff --git a/device_simulator/bal_server.c b/device_simulator/bal_server.c
index 38f18ba..9d6402f 100644
--- a/device_simulator/bal_server.c
+++ b/device_simulator/bal_server.c
@@ -22,8 +22,8 @@
 static grpc_c_server_t *test_server;
 
 static void sigint_handler (int x) { 
-        grpc_c_server_destroy(test_server);
-        exit(0);
+	grpc_c_server_destroy(test_server);
+	exit(0);
 }
 
 /*
@@ -31,14 +31,15 @@
  */
 void bal__bal_cfg_get_cb(grpc_c_context_t *context)
 {
-        BalCfg *get_cfg;
+	BalCfg *get_cfg;
 
-        /*
-         * Read incoming message into get_cfg
-         */
-        if (context->gcc_payload) {
-                context->gcc_stream->read(context, (void **)&get_cfg, 0);
-        }
+	/*
+	 * Read incoming message into get_cfg
+	 */
+	if (context->gcc_payload) {
+		context->gcc_stream->read(context, (void **)&get_cfg, 0);
+	}
+
 }
 
 /*
@@ -46,88 +47,133 @@
  */
 void bal__bal_cfg_set_cb(grpc_c_context_t *context)
 {
-        BalCfg *set_cfg;
-        BalErr bal_err;
+	BalCfg *set_cfg;
+	BalErr bal_err;
 
-        /*
-         * Read incoming message into set_cfg
-         */
-        if (context->gcc_payload) {
-                context->gcc_stream->read(context, (void **)&set_cfg, 0);
-        }
+	/*
+	 * Read incoming message into set_cfg
+	 */
+	if (context->gcc_payload) {
+		context->gcc_stream->read(context, (void **)&set_cfg, 0);
+	}
 
-        /*
-         * send it to BAL
-         */
+	/*
+	 * send it to BAL
+	 */
 
-        bal_err__init(&bal_err);
+	bal_err__init(&bal_err);
 
-        bal_err.err= 0;
+	bal_err.err= 0;
 
-        /*
-         * Write reply back to the client
-         */
-        if (!context->gcc_stream->write(context, &bal_err, 0)) {
-        } else {
-                printf("Failed to write\n");
-                exit(1);
-        }
+	/*
+	 * Write reply back to the client
+	 */
+	if (!context->gcc_stream->write(context, &bal_err, 0)) {
+	} else {
+		printf("Failed to write\n");
+		exit(1);
+	}
 
-        grpc_c_status_t status;
-        status.gcs_code = 0;
+	grpc_c_status_t status;
+	status.gcs_code = 0;
 
-        /*
-         * Finish response for RPC
-         */
-        if (context->gcc_stream->finish(context, &status)) {
-                printf("Failed to write status\n");
-                exit(1);
-        }
+	/*
+	 * Finish response for RPC
+	 */
+	if (context->gcc_stream->finish(context, &status)) {
+		printf("Failed to write status\n");
+		exit(1);
+	}
 
 #ifdef BAL_STUB
-        pthread_mutex_lock(&lock);
-        if(set_cfg->hdr->has_obj_type)
-        {
-                enQueue(set_cfg->hdr->obj_type, BAL_ERRNO__BAL_ERR_OK);
-                switch(set_cfg->hdr->obj_type)
-                {
-                        case BAL_OBJ_ID__BAL_OBJ_ID_ACCESS_TERMINAL:
+	pthread_mutex_lock(&lock);
+
+	struct QNode *temp = newNode(set_cfg->hdr->obj_type, 
+			BAL_ERRNO__BAL_ERR_OK, 
+			set_cfg->device_id);
+
+	if(set_cfg->hdr->has_obj_type)
+	{
+
+		switch(set_cfg->hdr->obj_type)
+		{
+			case BAL_OBJ_ID__BAL_OBJ_ID_ACCESS_TERMINAL:
+				{
+					printf("\n***************************************************\n");  
+					printf("Received Access Terminal Configuration msg\n");
+					printf("***************************************************\n");  
+				}
+				break;
+			case BAL_OBJ_ID__BAL_OBJ_ID_INTERFACE:
+				{
+					printf("\n***************************************************\n");  
+					printf("Received PON Interface Configuration msg\n");
+					printf("***************************************************\n");  
+					temp->intf_id = set_cfg->interface->key->intf_id;
+					printf("Pon ID = %d\n", temp->intf_id);
+				}
+				break;
+			case BAL_OBJ_ID__BAL_OBJ_ID_SUBSCRIBER_TERMINAL:
+				{
+					printf("\n*****************************************************\n");  
+					printf("Received ONU Activation msg\n");
+					printf("*****************************************************\n");  
+					temp->intf_id = set_cfg->terminal->key->intf_id;
+					temp->onu_id = set_cfg->terminal->key->sub_term_id;
+				}
+				break;
+                        case BAL_OBJ_ID__BAL_OBJ_ID_PACKET:
                                 {
-                                        printf("\n***************************************************\n");  
-                                        printf("Received Access Terminal Configuration msg\n");
-                                        printf("***************************************************\n");  
+                                   switch(set_cfg->packet->key->packet_send_dest->type)
+                                   {
+					case BAL_DEST_TYPE__BAL_DEST_TYPE_ITU_OMCI_CHANNEL:
+				        {
+						printf("\n*****************************************************\n");  
+						printf("Received OMCI msg\n");
+						printf("*****************************************************\n");  
+						temp->intf_id = set_cfg->terminal->key->intf_id;
+						temp->onu_id = set_cfg->terminal->key->sub_term_id;
+					}
+					break;
+					default:
+					{
+						("\n*****************************************************\n");  
+						printf("Dest type invalid\n");
+						printf("*****************************************************\n");  
+					}
+					break;
+				   }
                                 }
                                 break;
-                        case BAL_OBJ_ID__BAL_OBJ_ID_INTERFACE:
-                                {
-                                        printf("\n***************************************************\n");  
-                                        printf("Received PON Interface Configuration msg\n");
-                                        printf("***************************************************\n");  
-                                }
-                                break;
-                        case BAL_OBJ_ID__BAL_OBJ_ID_SUBSCRIBER_TERMINAL:
-                                {
-                                        printf("\n*****************************************************\n");  
-                                        printf("Received ONU Activation msg\n");
-                                        printf("*****************************************************\n");  
-                                }
-                        default:
-                                break;
-                }
-        }
-        else
-        {
-                printf("BALSTUB:Cfg Set recevied without object type");
-        }
-        pthread_mutex_unlock(&lock);
-        sleep(2);   
-        pthread_cond_signal(&cv);
-        if(BAL_OBJ_ID__BAL_OBJ_ID_INTERFACE == set_cfg->hdr->obj_type)
-        {
-                sleep(5); 
-                enQueue(BAL_OBJ_ID__BAL_OBJ_ID_SUBSCRIBER_TERMINAL, BAL_ERRNO__BAL_ERR_OK);
-                pthread_cond_signal(&cv);
-        }
+			default:
+				{
+				("\n*****************************************************\n");  
+				printf("Received Invalid msg\n");
+				printf("*****************************************************\n");  
+				}
+				break;
+		}
+		enQueue(set_cfg->hdr->obj_type, temp);
+	}
+	else
+	{
+		printf("BALSTUB:Cfg Set recevied without object type");
+	}
+	pthread_mutex_unlock(&lock);
+	sleep(2);   
+	pthread_cond_signal(&cv);
+	if(BAL_OBJ_ID__BAL_OBJ_ID_INTERFACE == set_cfg->hdr->obj_type)
+	{
+		sleep(5); 
+		struct QNode *temp1 = newNode(BAL_OBJ_ID__BAL_OBJ_ID_SUBSCRIBER_TERMINAL, 
+				BAL_ERRNO__BAL_ERR_OK, 
+				set_cfg->device_id);
+		temp1->intf_id = set_cfg->interface->key->intf_id;
+		temp1->onu_id = 65535;
+		printf("sending _onu_discovery_indiaction\n");
+		enQueue(BAL_OBJ_ID__BAL_OBJ_ID_SUBSCRIBER_TERMINAL, temp1); 
+		pthread_cond_signal(&cv);
+	}
 #endif
 }
 
@@ -137,14 +183,14 @@
  */
 void bal__bal_cfg_clear_cb(grpc_c_context_t *context)
 {
-        BalKey *clear_key;
+	BalKey *clear_key;
 
-        /*
-         * Read incoming message into clear_key 
-         */
-        if (context->gcc_payload) {
-                context->gcc_stream->read(context, (void **)&clear_key, 0);
-        }
+	/*
+	 * Read incoming message into clear_key 
+	 */
+	if (context->gcc_payload) {
+		context->gcc_stream->read(context, (void **)&clear_key, 0);
+	}
 
 }
 
@@ -154,14 +200,48 @@
  */
 void bal__bal_api_init_cb(grpc_c_context_t *context)
 {
-        BalInit *bal_init;
+	BalInit *bal_init;
+	BalErr bal_err;
 
-        /*
-         * Read incoming message into set_cfg
-         */
-        if (context->gcc_payload) {
-                context->gcc_stream->read(context, (void **)&bal_init, 0);
-        }
+	/*
+	 * Read incoming message into set_cfg
+	 */
+	if (context->gcc_payload) {
+		context->gcc_stream->read(context, (void **)&bal_init, 0);
+	}
+
+	/*
+	 * send it to BAL
+	 */
+
+
+	("\n*****************************************************\n");  
+	printf("Received API Init msg\n");
+	printf("*****************************************************\n");  
+
+	bal_err__init(&bal_err);
+
+	bal_err.err= 0;
+
+	/*
+	 * Write reply back to the client
+	 */
+	if (!context->gcc_stream->write(context, &bal_err, 0)) {
+	} else {
+		printf("Failed to write\n");
+		exit(1);
+	}
+
+	grpc_c_status_t status;
+	status.gcs_code = 0;
+
+	/*
+	 * Finish response for RPC
+	 */
+	if (context->gcc_stream->finish(context, &status)) {
+		printf("Failed to write status\n");
+		exit(1);
+	}
 
 }
 
@@ -172,14 +252,14 @@
 void bal__bal_api_finish_cb(grpc_c_context_t *context)
 {
 #if 0
-        void *finish_init;
+	void *finish_init;
 
-        /*
-         * Read incoming message into set_cfg
-         */
-        if (context->gcc_payload) {
-                context->gcc_stream->read(context, (void **)&finish_init);
-        }
+	/*
+	 * Read incoming message into set_cfg
+	 */
+	if (context->gcc_payload) {
+		context->gcc_stream->read(context, (void **)&finish_init);
+	}
 #endif
 }
 
@@ -190,85 +270,74 @@
 void bal_ind__bal_ind_info_cb(grpc_c_context_t *context)
 {
 #if 0
-        void *finish_init;
+	void *finish_init;
 
-        /*
-         * Read incoming message into set_cfg
-         */
-        if (context->gcc_payload) {
-                context->gcc_stream->read(context, (void **)&finish_init);
-        }
+	/*
+	 * Read incoming message into set_cfg
+	 */
+	if (context->gcc_payload) {
+		context->gcc_stream->read(context, (void **)&finish_init);
+	}
 #endif
 }
 
 
 /*
- * This functions gets invoked whenever bal RPC gets called
- */
-void bal__bal_omci_msg_cb(grpc_c_context_t *context)
-{
-        char *omci_msg;
-
-        /*
-         * Read incoming message into omci_msg
-         */
-        if (context->gcc_payload) {
-                context->gcc_stream->read(context, (void **)&omci_msg, 0);
-        }
-}
-
-/*
  * Takes socket path as argument
  */
 int main (int argc, char **argv) 
 {
-        int i = 0;
-        grpc_c_server_t *server = NULL;
+	int i = 0;
+	grpc_c_server_t *server = NULL;
 
-        printf("*************\n");
-        printf("BAL STUB\n");
-        printf("*************\n");
-        if (argc < 2) {
-                fprintf(stderr, "Missing socket path argument\n");
-                exit(1);
-        }
+	printf("*************\n");
+	printf("BAL STUB\n");
+	printf("*************\n");
+	if (argc < 2) {
+		fprintf(stderr, "Missing socket path argument\n");
+		exit(1);
+	}
 
-        signal(SIGINT, sigint_handler);
-        /*
-         * Initialize grpc-c library to be used with vanilla gRPC
-         */
-        grpc_c_init(GRPC_THREADS, NULL);
+	signal(SIGINT, sigint_handler);
+	/*
+	 * Initialize grpc-c library to be used with vanilla gRPC
+	 */
+	grpc_c_init(GRPC_THREADS, NULL);
 
-        /*
-         * Create server object
-         */
-        test_server = grpc_c_server_create(argv[1]); 
-        if (test_server == NULL) {
-                printf("Failed to create server\n");
-                exit(1);
-        }
+	/*
+	 * Create server object
+	 */
+	test_server = grpc_c_server_create(argv[1]);
 
-        /*
-         * Initialize greeter service
-         */
-        printf("\nCreating a test server\n");
-        bal__service_init(test_server);
+	if (test_server == NULL) {
+		printf("Failed to create server\n");
+		exit(1);
+	}
 
-        /*
-         * Start server
-         */
-        grpc_c_server_start(test_server);
+	/*
+	 * Initialize greeter service
+	 */
+	printf("\nCreating a test server\n");
+	bal__service_init(test_server);
+
+	/*
+	 * Start server
+	 */
+	grpc_c_server_start(test_server);
 
 #ifdef BAL_STUB
-        printf("\nCreating a stub thread\n");
-        create_stub_thread();
+	printf("\nCreating a stub thread\n");
+	create_stub_thread();
+#else
+	grpc_c_client_t *client = grpc_c_client_init("172.24.150.114:60001", "bal_client", NULL);
 #endif
 
-        /*
-         * Blocks server to wait to completion
-         */
-        grpc_c_server_wait(test_server);
+	/*
+	 * Blocks server to wait to completion
+	 */
+	grpc_c_server_wait(test_server);
 
-        bal__service_init(server);
+	/* code added for example Makefile to compile grpc-c along with edgecore driver */
+	bal__service_init(server);
 
 }
diff --git a/device_simulator/bal_stub.c b/device_simulator/bal_stub.c
index e6d7945..b169e50 100644
--- a/device_simulator/bal_stub.c
+++ b/device_simulator/bal_stub.c
@@ -15,195 +15,235 @@
 
 void *stub_thread(void *v) 
 {
-   int status;
-   grpc_c_client_t *client = grpc_c_client_init("172.24.150.114:60001", "bal_client", NULL);
-   pthread_mutex_lock(&lock);
-   pthread_cond_wait(&cv, &lock);
-   while(NULL != shared_queue->front)
-   {
-      BalObjId prevObjType;
-      struct QNode *front = deQueue(shared_queue);
-      /* prepare and send rpc response */
-      BalIndications balIndCfg;
-      memset(&balIndCfg, 0, sizeof(BalIndications));
-      bal_indications__init(&balIndCfg);
-      BalObjInd bal_obj_ind;
-      memset(&bal_obj_ind, 0, sizeof(BalObjInd));
-      bal_obj_ind__init(&bal_obj_ind);
-      balIndCfg.u_case = BAL_INDICATIONS__U_BAL_OBJ_INFO;
-      balIndCfg.balobjinfo = &bal_obj_ind;
-      balIndCfg.balobjinfo->has_objtype = 1;
-      balIndCfg.balobjinfo->objtype = front->obj_type;
-      balIndCfg.balobjinfo->has_status = 1;
-      balIndCfg.balobjinfo->status = front->status;
-      char keystr;
-      balIndCfg.balobjinfo->keystr = &keystr;
-      switch(front->obj_type)
-      {
-         case BAL_OBJ_ID__BAL_OBJ_ID_ACCESS_TERMINAL:
-            {
-               printf("***************************************************\n");
-               printf("Successful Indication sent for ACCESS_TERMINAL\n");
-               printf("***************************************************\n");
-               balIndCfg.balobjinfo->u_case = BAL_OBJ_IND__U__NOT_SET;
-               prevObjType = front->obj_type;
-            }
-            break;
-         case BAL_OBJ_ID__BAL_OBJ_ID_INTERFACE:
-            {
-               printf("***************************************************\n");
-               printf("Successful Indication sent for PON INTERFACE UP\n");
-               printf("***************************************************\n");
-               balIndCfg.balobjinfo->u_case = BAL_OBJ_IND__U__NOT_SET;
-               prevObjType = front->obj_type;
-            }
-            break;
-         case BAL_OBJ_ID__BAL_OBJ_ID_SUBSCRIBER_TERMINAL:
-            {
-               balIndCfg.balobjinfo->u_case = BAL_OBJ_IND__U_ONU_DISCOVERY_INFO;
-               BalSubscriberTerminalCfg onudiscoveryinfo;
-               memset(&onudiscoveryinfo, 0, sizeof(BalSubscriberTerminalCfg));
-               bal_subscriber_terminal_cfg__init(&onudiscoveryinfo);
-               balIndCfg.balobjinfo->onudiscoveryinfo = &onudiscoveryinfo;
+	int status;
+	grpc_c_client_t *client = grpc_c_client_init("172.24.150.167:60001", "bal_client", NULL);
+	pthread_mutex_lock(&lock);
+	pthread_cond_wait(&cv, &lock);
+	while(NULL != shared_queue->front)
+	{
+		BalObjId prevObjType;
+		char vendor_id[20];
+		char vendor_specific[20];
+		struct QNode *front = deQueue(shared_queue);
+		/* prepare and send rpc response */
+		BalIndications balIndCfg;
+		memset(&balIndCfg, 0, sizeof(BalIndications));
+		bal_indications__init(&balIndCfg);
+		balIndCfg.has_objtype = 1;
+		balIndCfg.objtype = front->obj_type;
+		balIndCfg.device_id = front->device_id;
+		printf("Device Id = %s\n", front->device_id);
+		switch(front->obj_type)
+		{
+			case BAL_OBJ_ID__BAL_OBJ_ID_ACCESS_TERMINAL:
+				{
+					printf("***************************************************\n");
+					printf("Successful Indication sent for ACCESS_TERMINAL\n");
+					printf("***************************************************\n");
+					balIndCfg.u_case = BAL_INDICATIONS__U_ACCESS_TERM_IND;
+					prevObjType = front->obj_type;
+				}
+				break;
+			case BAL_OBJ_ID__BAL_OBJ_ID_INTERFACE:
+				{
+					printf("***************************************************\n");
+					printf("Successful Indication sent for PON INTERFACE UP\n");
+					printf("***************************************************\n");
+					balIndCfg.u_case = BAL_INDICATIONS__U_INTERFACE_IND;
+					prevObjType = front->obj_type;
+				}
+				break;
+			case BAL_OBJ_ID__BAL_OBJ_ID_SUBSCRIBER_TERMINAL:
+				{
+					BalSubscriberTerminalKey subTermKey;
+					memset(&subTermKey, 0, sizeof(BalSubscriberTerminalKey));
+					bal_subscriber_terminal_key__init(&subTermKey);
 
-               BalSubscriberTerminalKey subTermKey;
-               memset(&subTermKey, 0, sizeof(BalSubscriberTerminalKey));
-               bal_subscriber_terminal_key__init(&subTermKey);
-               balIndCfg.balobjinfo->onudiscoveryinfo->key = &subTermKey;
-               balIndCfg.balobjinfo->onudiscoveryinfo->key->has_sub_term_id = 1;
-               balIndCfg.balobjinfo->onudiscoveryinfo->key->sub_term_id = 65535;
-               balIndCfg.balobjinfo->onudiscoveryinfo->key->has_intf_id = 1;
-               balIndCfg.balobjinfo->onudiscoveryinfo->key->intf_id = 0;
-               
-               BalSubscriberTerminalCfgData subTermCfgData;
-               memset(&subTermCfgData, 0, sizeof(BalSubscriberTerminalCfgData));
-               bal_subscriber_terminal_cfg_data__init(&subTermCfgData);
-               balIndCfg.balobjinfo->onudiscoveryinfo->data = &subTermCfgData;
-               if(BAL_OBJ_ID__BAL_OBJ_ID_INTERFACE == prevObjType)
-               {
-                  balIndCfg.balobjinfo->onudiscoveryinfo->data->has_admin_state = 1;
-                  balIndCfg.balobjinfo->onudiscoveryinfo->data->admin_state = BAL_STATE__BAL_STATE_DOWN;
-                  balIndCfg.balobjinfo->onudiscoveryinfo->data->has_oper_status = 1;
-                  balIndCfg.balobjinfo->onudiscoveryinfo->data->oper_status = BAL_STATUS__BAL_STATUS_DOWN;
-                  printf("\n***************************************************\n");
-                  printf("Sending ONU discovery message\n");
-                  printf("***************************************************\n");
-               }
-               else
-               {
-                  balIndCfg.balobjinfo->onudiscoveryinfo->data->has_admin_state = 1;
-                  balIndCfg.balobjinfo->onudiscoveryinfo->data->admin_state = BAL_STATE__BAL_STATE_UP;
-                  balIndCfg.balobjinfo->onudiscoveryinfo->data->has_oper_status = 1;
-                  balIndCfg.balobjinfo->onudiscoveryinfo->data->oper_status = BAL_STATUS__BAL_STATUS_UP;
-                  printf("***************************************************\n");
-                  printf("ONU Activation Successful\n");
-                  printf("***************************************************\n");
-               }
-               BalSerialNumber serial_number;
-               memset(&serial_number, 0, sizeof(BalSerialNumber));
-               bal_serial_number__init(&serial_number);
-               balIndCfg.balobjinfo->onudiscoveryinfo->data->serial_number = &serial_number;
-               char vendor_id[20];
-               memset(&vendor_id, 0, 20);
-               strcpy(vendor_id,"4252434D");
-               balIndCfg.balobjinfo->onudiscoveryinfo->data->serial_number->vendor_id = vendor_id;
-               char vendor_specific[20];
-               memset(&vendor_specific, 0, 20);
-               strcpy(vendor_specific,"12345678");
-               balIndCfg.balobjinfo->onudiscoveryinfo->data->serial_number->vendor_specific = vendor_specific;
+					BalSerialNumber serial_number;
+					memset(&serial_number, 0, sizeof(BalSerialNumber));
+					bal_serial_number__init(&serial_number);
 
-               prevObjType = front->obj_type;
-            }
-            break;
-         case BAL_OBJ_ID__BAL_OBJ_ID_PACKET:
-            {
-               balIndCfg.balobjinfo->u_case = BAL_OBJ_IND__U_PKT_DATA;
-            }
-            break;
-         default:
-            {
-               balIndCfg.balobjinfo->u_case = BAL_OBJ_IND__U__NOT_SET;
-               prevObjType = front->obj_type;
-            }
-            break;
-      }
-      BalErr *output;
-      status = bal_ind__bal_ind_info(client, NULL, &balIndCfg, &output, NULL, 0);
-      free(front);
-      pthread_mutex_unlock(&lock);
-      pthread_mutex_lock(&lock);
-      pthread_cond_wait(&cv, &lock);
-   }
-   return NULL;
+					char vendor_id[20];
+					memset(&vendor_id, 0, 20);
+					strcpy(vendor_id,"4252434D");
+					char vendor_specific[20];
+					memset(&vendor_specific, 0, 20);
+					strcpy(vendor_specific,"12345678");
+
+					if(BAL_OBJ_ID__BAL_OBJ_ID_INTERFACE == prevObjType)
+					{
+						balIndCfg.u_case = BAL_INDICATIONS__U_TERMINAL_DISC;
+						BalSubscriberTerminalSubTermDisc terminal_disc;
+						memset(&terminal_disc, 0, sizeof(BalSubscriberTerminalSubTermDisc));
+						bal_subscriber_terminal_sub_term_disc__init(&terminal_disc);
+						balIndCfg.terminal_disc = &terminal_disc;
+
+						balIndCfg.terminal_disc->key = &subTermKey;
+						balIndCfg.terminal_disc->key->has_sub_term_id = 1;
+						balIndCfg.terminal_disc->key->sub_term_id = front->onu_id;
+						balIndCfg.terminal_disc->key->has_intf_id = 1;
+						balIndCfg.terminal_disc->key->intf_id = front->intf_id;
+
+						BalSubscriberTerminalSubTermDiscData subTermCfgData;
+						memset(&subTermCfgData, 0, sizeof(BalSubscriberTerminalSubTermDiscData));
+						bal_subscriber_terminal_sub_term_disc_data__init(&subTermCfgData);
+						balIndCfg.terminal_disc->data = &subTermCfgData;
+						balIndCfg.terminal_disc->data->serial_number = &serial_number;
+						balIndCfg.terminal_disc->data->serial_number->vendor_id = vendor_id;
+						printf("\n***************************************************\n");
+						printf("Sending ONU discovery message\n");
+						printf("***************************************************\n");
+					}
+					else
+					{
+						balIndCfg.u_case = BAL_INDICATIONS__U_TERMINAL_IND;
+						BalSubscriberTerminalInd terminal_ind;
+						memset(&terminal_ind, 0, sizeof(BalSubscriberTerminalInd));
+						bal_subscriber_terminal_ind__init(&terminal_ind);
+						balIndCfg.terminal_ind = &terminal_ind;
+
+						balIndCfg.terminal_ind->key = &subTermKey;
+						balIndCfg.terminal_ind->key->has_sub_term_id = 1;
+						balIndCfg.terminal_ind->key->sub_term_id = front->onu_id;
+						balIndCfg.terminal_ind->key->has_intf_id = 1;
+						balIndCfg.terminal_ind->key->intf_id = front->intf_id;
+
+						BalSubscriberTerminalIndData subTermCfgData;
+						memset(&subTermCfgData, 0, sizeof(BalSubscriberTerminalIndData));
+						bal_subscriber_terminal_ind_data__init(&subTermCfgData);
+						balIndCfg.terminal_ind->data = &subTermCfgData;
+						balIndCfg.terminal_ind->data->has_admin_state = 1;
+						balIndCfg.terminal_ind->data->admin_state = BAL_STATE__BAL_STATE_UP;
+						balIndCfg.terminal_ind->data->has_oper_status = 1;
+						balIndCfg.terminal_ind->data->oper_status = BAL_STATUS__BAL_STATUS_UP;
+						balIndCfg.terminal_ind->data->serial_number = &serial_number;
+						balIndCfg.terminal_ind->data->serial_number->vendor_id = vendor_id;
+						balIndCfg.terminal_ind->data->serial_number->vendor_specific = vendor_specific;
+						printf("***************************************************\n");
+						printf("ONU Activation Successful\n");
+						printf("***************************************************\n");
+					}
+					prevObjType = front->obj_type;
+				}
+				break;
+			case BAL_OBJ_ID__BAL_OBJ_ID_PACKET:
+				{
+					balIndCfg.u_case = BAL_INDICATIONS__U_BAL_OMCI_RESP;
+                                        BalPacketItuOmciChannelRx balomciresp;
+			                memset(&balomciresp, 0, sizeof(BalPacketItuOmciChannelRx));
+                                        bal_packet_itu_omci_channel_rx__init(&balomciresp);
+                                              
+                                        BalPacketKey balomcirespkey;
+			                memset(&balomcirespkey, 0, sizeof(BalPacketKey));
+                                        bal_packet_key__init(&balomcirespkey); 
+                                        balomciresp.key = &balomcirespkey;
+
+                                        BalDest balomcirespkeydest;
+			                memset(&balomcirespkeydest, 0, sizeof(BalDest));
+                                        bal_dest__init(&balomcirespkeydest);
+                                        balomciresp.key->packet_send_dest = &balomcirespkeydest;
+                                        balomciresp.key->packet_send_dest->has_type = 1;
+                                        balomciresp.key->packet_send_dest->type = BAL_DEST_TYPE__BAL_DEST_TYPE_ITU_OMCI_CHANNEL;
+                                        balomciresp.key->packet_send_dest->u_case = BAL_DEST__U_ITU_OMCI_CHANNEL;
+                                
+                                        BalItuOmciChannel itu_omci_channel;
+			                memset(&itu_omci_channel, 0, sizeof(BalItuOmciChannel));
+                                        bal_itu_omci_channel__init(&itu_omci_channel);
+                                        balomciresp.key->packet_send_dest->itu_omci_channel = &itu_omci_channel;
+                                        balomciresp.key->packet_send_dest->itu_omci_channel->has_sub_term_id = 1;
+                                        balomciresp.key->packet_send_dest->itu_omci_channel->sub_term_id = front->onu_id;
+                                        balomciresp.key->packet_send_dest->itu_omci_channel->has_int_id = 1;
+                                        balomciresp.key->packet_send_dest->itu_omci_channel->int_id = front->intf_id;
+				}
+				break;
+			default:
+				{
+					balIndCfg.u_case = BAL_INDICATIONS__U__NOT_SET;
+					prevObjType = front->obj_type;
+				}
+				break;
+		}
+		BalErr *output;
+		status = bal_ind__bal_ind_info(client, NULL, &balIndCfg, &output, NULL, 0);
+		free(front);
+		pthread_mutex_unlock(&lock);
+		pthread_mutex_lock(&lock);
+		pthread_cond_wait(&cv, &lock);
+	}
+	return NULL;
 }
 
 void create_stub_thread() 
 {
-   pthread_t threadId = 0;
+	pthread_t threadId = 0;
 
-   /* create shared queue */
-   shared_queue = createQueue();
+	/* create shared queue */
+	shared_queue = createQueue();
 
-   pthread_create(&threadId, NULL, stub_thread, NULL);      
+	pthread_create(&threadId, NULL, stub_thread, NULL);      
 
 }
 
 /* A utility function to create an empty queue */
 bal_queue *createQueue()
 {
-   shared_queue = (struct Queue*)malloc(sizeof(struct Queue));
-   shared_queue->front = shared_queue->rear = NULL;
-   return shared_queue;
+	shared_queue = (struct Queue*)malloc(sizeof(struct Queue));
+	shared_queue->front = shared_queue->rear = NULL;
+	return shared_queue;
 }
 
 /* A utility function to create a new linked list node */
-struct QNode* newNode(int objKey, int status)
+struct QNode* newNode(int objKey, int status, char *device_id)
 {
-   struct QNode *temp = (struct QNode*)malloc(sizeof(struct QNode));
-   temp->obj_type = objKey;
-   temp->status = status;
-   temp->next = NULL;
-   return temp; 
+	struct QNode *temp = (struct QNode*)malloc(sizeof(struct QNode));
+	temp->obj_type = objKey;
+	temp->status = status;
+	if(device_id != NULL)
+	{
+		memset(temp->device_id, 0, BAL_DEVICE_STR_LEN);
+		memcpy(temp->device_id, device_id, strlen(device_id));
+	}
+	temp->next = NULL;
+	return temp; 
 }
 
 /* The function to add data to shared_queue - Add end of the queue */
-void enQueue(int objKey, int status)
+void enQueue(int objKey, struct QNode *temp)
 {
-   /* Create a new LL node */
-   struct QNode *temp = newNode(objKey, status);
+	/* Create a new LL node */
 
-   /* If queue is empty, then new node is front and rear both */
-   if (shared_queue->rear == NULL)
-   {
-      shared_queue->front = shared_queue->rear = temp;
-      return;
-   }
+	/* If queue is empty, then new node is front and rear both */
+	if (shared_queue->rear == NULL)
+	{
+		shared_queue->front = shared_queue->rear = temp;
+		return;
+	}
 
-   /* Add the new node at the end of queue and change rear */
-   shared_queue->rear->next = temp;
-   shared_queue->rear = temp;
+	/* Add the new node at the end of queue and change rear */
+	shared_queue->rear->next = temp;
+	shared_queue->rear = temp;
 }
 
 /* Function to remove data from shared_queue - FIFO */
 struct QNode *deQueue()
 {
-   /* If queue is empty, return NULL */
-   if (shared_queue->front == NULL)
-   {
-      return NULL;
-   }
+	/* If queue is empty, return NULL */
+	if (shared_queue->front == NULL)
+	{
+		return NULL;
+	}
 
-   /* Store previous front and move front one node ahead */
-   struct QNode *temp = shared_queue->front;
-   shared_queue->front = shared_queue->front->next;
+	/* Store previous front and move front one node ahead */
+	struct QNode *temp = shared_queue->front;
+	shared_queue->front = shared_queue->front->next;
 
-   /* If front becomes NULL, then change rear also as NULL */
-   if (shared_queue->front == NULL)
-   {
-      shared_queue->rear = NULL;
-   }
+	/* If front becomes NULL, then change rear also as NULL */
+	if (shared_queue->front == NULL)
+	{
+		shared_queue->rear = NULL;
+	}
 
-   return temp;
+	return temp;
 }
 
 #endif
diff --git a/device_simulator/bal_stub.h b/device_simulator/bal_stub.h
index 0bd30de..8108d6d 100644
--- a/device_simulator/bal_stub.h
+++ b/device_simulator/bal_stub.h
@@ -7,21 +7,25 @@
 #define IND_USR_DAT_VAL  "brcmOLT"
 #define BALCLIENT        "bal_client"
 #define BALSERVER        "bal_server"
+#define BAL_DEVICE_STR_LEN 20
 
 /* A linked list (LL) node to store a queue entry */
 struct QNode
 {
-   int obj_type;
-   int status;
-   struct QNode *next;
+	int obj_type;
+	char device_id[BAL_DEVICE_STR_LEN];
+	int status;
+	int intf_id;
+	int onu_id;
+	struct QNode *next;
 };
 
- 
+
 /* The queue, front stores the front node of LL and rear stores ths
-  last node of LL */
+   last node of LL */
 typedef struct Queue
 {
-   struct QNode *front, *rear;
+	struct QNode *front, *rear;
 }bal_queue;
 
 /* shared queue */
@@ -29,6 +33,6 @@
 
 void create_stub_thread(); 
 bal_queue *createQueue();
-struct QNode* newNode(int objKey, int status);
-void enQueue(int objKey, int status);
+struct QNode* newNode(int objKey, int status, char *device_id);
+void enQueue(int objKey, struct QNode *temp);
 struct QNode *deQueue();
