Merge "[Bugfix][T106BUG][Network] for gsm csq to dbm, base should be -113, lower should be -110"
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-network/lynq_qser_network.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-network/lynq_qser_network.cpp
index e1d2ab4..5ca13fe 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-network/lynq_qser_network.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-network/lynq_qser_network.cpp
@@ -134,25 +134,43 @@
     {
         QSER_NW_SINGNAL_EVENT_IND_T msg_buf;
         msg_buf.gsm_sig_info_valid = signalstrength.gw_sig_valid;
-        msg_buf.gsm_sig_info.rssi = (signalstrength.rssi<<1)-110;
+        if(msg_buf.gsm_sig_info_valid)
+        {
+            msg_buf.gsm_sig_info.rssi = (signalstrength.rssi<<1)-113;
+            if(msg_buf.gsm_sig_info.rssi < -110)
+            {
+                msg_buf.gsm_sig_info.rssi=-110;
+            }
+        }
+        
         msg_buf.wcdma_sig_info_valid = signalstrength.wcdma_sig_valid;
-        msg_buf.wcdma_sig_info.rssi = (signalstrength.wcdma_signalstrength<<1)-113;
-        msg_buf.wcdma_sig_info.ecio = signalstrength.ecno/5;
+        if(msg_buf.wcdma_sig_info_valid)
+        {
+            msg_buf.wcdma_sig_info.rssi = (signalstrength.wcdma_signalstrength<<1)-113;
+            msg_buf.wcdma_sig_info.ecio = signalstrength.ecno/5;
+        }
         msg_buf.tdscdma_sig_info_valid = 0;
         msg_buf.lte_sig_info_valid = signalstrength.lte_sig_valid;
-        msg_buf.lte_sig_info.rssi = (signalstrength.lte_signalstrength<<1)-113;
-        msg_buf.lte_sig_info.rsrp = -signalstrength.rsrp;
-        msg_buf.lte_sig_info.rsrq = -signalstrength.rsrq;
-        msg_buf.lte_sig_info.snr = signalstrength.rssnr;
+        if(msg_buf.lte_sig_info_valid)
+        {
+            msg_buf.lte_sig_info.rssi = (signalstrength.lte_signalstrength<<1)-113;
+            msg_buf.lte_sig_info.rsrp = -signalstrength.rsrp;
+            msg_buf.lte_sig_info.rsrq = -signalstrength.rsrq;
+            msg_buf.lte_sig_info.snr = signalstrength.rssnr;    
+        }
         msg_buf.cdma_sig_info_valid = 0;
         msg_buf.hdr_sig_info_valid = 0;
         msg_buf.nr_sig_info_valid = signalstrength.nr_sig_valid;
-        msg_buf.nr_sig_info.ssRsrp = signalstrength.ssRsrp;
-        msg_buf.nr_sig_info.ssRsrq = signalstrength.ssRsrq;
-        msg_buf.nr_sig_info.ssSinr = signalstrength.ssSinr;
-        msg_buf.nr_sig_info.csiRsrp = signalstrength.csiRsrp;
-        msg_buf.nr_sig_info.csiRsrq = signalstrength.csiRsrq;
-        msg_buf.nr_sig_info.csiSinr = signalstrength.csiSinr;
+        if(msg_buf.nr_sig_info_valid)
+        {
+            msg_buf.nr_sig_info.ssRsrp = signalstrength.ssRsrp;
+            msg_buf.nr_sig_info.ssRsrq = signalstrength.ssRsrq;
+            msg_buf.nr_sig_info.ssSinr = signalstrength.ssSinr;
+            msg_buf.nr_sig_info.csiRsrp = signalstrength.csiRsrp;
+            msg_buf.nr_sig_info.csiRsrq = signalstrength.csiRsrq;
+            msg_buf.nr_sig_info.csiSinr = signalstrength.csiSinr;
+        }
+        
         void *ind_msg_buf= &msg_buf;
         if(s_handlerPtr!=NULL)
         {
@@ -736,25 +754,47 @@
         return RESULT_ERROR;
     }
     pt_info->gsm_sig_info_valid = lib_info.gw_sig_valid;
-    pt_info->gsm_sig_info.rssi = (lib_info.rssi<<1)-110;
+    if(pt_info->gsm_sig_info_valid)
+    {
+        pt_info->gsm_sig_info.rssi = (lib_info.rssi<<1)-113;
+        if(pt_info->gsm_sig_info.rssi < -110)
+        {
+            pt_info->gsm_sig_info.rssi=-110;
+        }
+    }
+    
     pt_info->wcdma_sig_info_valid = lib_info.wcdma_sig_valid;
-    pt_info->wcdma_sig_info.rssi = (lib_info.wcdma_signalstrength<<1)-113;
-    pt_info->wcdma_sig_info.ecio = lib_info.ecno/5;
+    if(pt_info->wcdma_sig_info_valid)
+    {
+        pt_info->wcdma_sig_info.rssi = (lib_info.wcdma_signalstrength<<1)-113;
+        pt_info->wcdma_sig_info.ecio = lib_info.ecno/5;
+    }
+    
     pt_info->tdscdma_sig_info_valid = 0;
+    
     pt_info->lte_sig_info_valid = lib_info.lte_sig_valid;
-    pt_info->lte_sig_info.rssi = (lib_info.lte_signalstrength<<1)-113;
-    pt_info->lte_sig_info.rsrp = -lib_info.rsrp;
-    pt_info->lte_sig_info.rsrq = -lib_info.rsrq;
-    pt_info->lte_sig_info.snr = lib_info.rssnr;
+    if(pt_info->lte_sig_info_valid)
+    {
+        pt_info->lte_sig_info.rssi = (lib_info.lte_signalstrength<<1)-113;
+        pt_info->lte_sig_info.rsrp = -lib_info.rsrp;
+        pt_info->lte_sig_info.rsrq = -lib_info.rsrq;
+        pt_info->lte_sig_info.snr = lib_info.rssnr;
+    }
+    
     pt_info->cdma_sig_info_valid = 0;
     pt_info->hdr_sig_info_valid = 0;
+    
     pt_info->nr_sig_info_valid = lib_info.nr_sig_valid;
-    pt_info->nr_sig_info.ssRsrp = lib_info.ssRsrp;
-    pt_info->nr_sig_info.ssRsrq = lib_info.ssRsrq;
-    pt_info->nr_sig_info.ssSinr = lib_info.ssSinr;
-    pt_info->nr_sig_info.csiRsrp = lib_info.csiRsrp;
-    pt_info->nr_sig_info.csiRsrq = lib_info.csiRsrq;
-    pt_info->nr_sig_info.csiSinr = lib_info.csiSinr;
+    if(pt_info->nr_sig_info_valid)
+    {
+        pt_info->nr_sig_info.ssRsrp = lib_info.ssRsrp;
+        pt_info->nr_sig_info.ssRsrq = lib_info.ssRsrq;
+        pt_info->nr_sig_info.ssSinr = lib_info.ssSinr;
+        pt_info->nr_sig_info.csiRsrp = lib_info.csiRsrp;
+        pt_info->nr_sig_info.csiRsrq = lib_info.csiRsrq;
+        pt_info->nr_sig_info.csiSinr = lib_info.csiSinr;
+    }
+    
     return RESULT_OK;
 }