diff --git a/mbtk/mbtk_ril/src/main.c b/mbtk/mbtk_ril/src/main.c
index abb575e..4ed52ce 100755
--- a/mbtk/mbtk_ril/src/main.c
+++ b/mbtk/mbtk_ril/src/main.c
@@ -389,7 +389,7 @@
                     {
 
                     }
-                    
+
                     data_pdp = data[1] + 200;
                     urc_msg_distribute(false, INFO_URC_MSG_PDP_STATE, &data_pdp, sizeof(uint8));
                 }
@@ -412,9 +412,16 @@
         char* tmp_s = s + 7;
         while(*tmp_s && *tmp_s == ' ')
             tmp_s++;
-        uint8 data = (uint8)atoi(tmp_s); // Reg State.
+        uint8 data[2];
+        data[0] = (uint8)atoi(tmp_s); // Reg State.
 
-        urc_msg_distribute(true, INFO_URC_MSG_NET_PS_REG_STATE, &data, sizeof(uint8));
+        if(strStartsWith(s, "+CGREG:")) {
+            data[1] = 0;  // GMS/WCDMA
+        } else {
+            data[1] = 1;  // LTE
+        }
+
+        urc_msg_distribute(true, INFO_URC_MSG_NET_PS_REG_STATE, data, sizeof(data));
     }
     // +CREG: 1, "8010", "000060a5", 0, 2, 0
     // +CREG: 1, "8330", "06447347", 7, 2, 0
diff --git a/mbtk/mbtk_ril/src/mbtk_info_server.c b/mbtk/mbtk_ril/src/mbtk_info_server.c
index 2e06e3d..f731309 100755
--- a/mbtk/mbtk_ril/src/mbtk_info_server.c
+++ b/mbtk/mbtk_ril/src/mbtk_info_server.c
@@ -170,7 +170,7 @@
         req->mode = 1;
 
         req->oosPhase[0] = (uint8)tmp_str;
-        
+
         err = at_tok_nextstr(&line, &tmp_str);
         if (err < 0)
         {
@@ -4887,19 +4887,19 @@
                             int boot_conn = pack->data[3];
                             int timeout = pack->data[4];
                             data_call_bootconn_save(cid, boot_conn);
-                            
+
                             if(net_info.net_type != MBTK_RADIO_TECH_E_UTRAN)
                             {
                                 err = MBTK_INFO_ERR_NET_NO_INIT;
                                 break;
                             }
-                            
+
                             if(cid_active[cid] == 1)
                             {
                                 err = MBTK_INFO_ERR_CID_EXIST;
                                 break;
                             }
-                            
+
                             data_call_reconn:
                             //mbtk wyq for data_call_ex add end
                             cgact_wait.waitting = true;
@@ -5074,7 +5074,7 @@
                                 char dev[20] = {0};
                                 uint8 pdp_data = cid + 100;
                                 pack_rsp_send(cli_info->fd , MBTK_INFO_ID_IND_PDP_STATE_CHANGE, &pdp_data, sizeof(uint8));
-                                
+
                                 sprintf(dev, "ccinet%d", cid - 1);
 
                                 // Config network.
@@ -5256,7 +5256,7 @@
                         pack_rsp_send(cli_info->fd, MBTK_INFO_ID_OOS_STA_RSP, &oos_t, sizeof(mbtk_oos_info));
                     }
                 }
-                else     // Set OOS 
+                else     // Set OOS
                 {
                     char* state = pack->data;
                     if(req_oos_set(state, &cme_err) || cme_err != MBTK_INFO_ERR_CME_NON)
@@ -5659,7 +5659,7 @@
     int i = 0;
     int send_sum = 0;
     int bootconn = 0;
-    
+
     while(1)
     {
         if(server_ready_get() && send_sum == 0)
@@ -5667,13 +5667,13 @@
             server_state_send();
             send_sum = 1;
         }
-        
+
         if(net_info.sim_state == MBTK_SIM_READY && net_info.net_type == MBTK_RADIO_TECH_E_UTRAN && bootconn == 0)
         {
             //data_call_bootconn_exec();
             property_get("persist.mbtk.datacall.bootconn", cid_bootconn, "00000000");
             LOG("data_call_bootconn_exec cid_bootconn = %s", cid_bootconn);
-            
+
             for(i = MBTK_APN_CID_MIN; i < MBTK_APN_CID_MAX + 1; i++)
             {
                 if(cid_bootconn[i] == '1')
@@ -5686,7 +5686,7 @@
                         }
                         memset(info, 0, sizeof(sock_client_info_t));
                         info->fd = DATA_CALL_BOOTCONN_FD;
-                        
+
                         mbtk_info_pack_t* pack = mbtk_info_pack_creat(MBTK_INFO_ID_NET_DATA_CALL_REQ);
                         if(pack == NULL)
                         {
@@ -6057,9 +6057,10 @@
         }
         case INFO_URC_MSG_NET_PS_REG_STATE:
         {
-            uint8 net_data[3];
+            uint8 net_data[4];
             net_data[0] = (uint8)MBTK_NET_PS_STATE;
-            net_data[1] = data[0];
+            net_data[1] = data[0]; // act
+            net_data[3] = data[1]; // 0 - GSM/WCDMA; 1 - LTE
             mbtk_net_reg_state_enum state = (mbtk_net_reg_state_enum)data[0];
             if(state == MBTK_NET_REG_STATE_HOME
                 || state == MBTK_NET_REG_STATE_ROAMING) { // Registered, home network or roaming.
