[Bugfix][T106BUG-291]fix the AT's response code;add cgir prefix;fix cgps correct response

Only Configure:No
Affected branch:master
Affected module:AT
Is it affected on both ZXIC and MTK:only ZXIC,
Self-test:Yes,
Doc Update:NO.

Change-Id: Ib05a30e5872c3dc36dc0a63bdd979a437f5afa43
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-at-common/liblynq-at-common.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-at-common/liblynq-at-common.cpp
index cacdf2d..ccb8eaa 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-at-common/liblynq-at-common.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-at-common/liblynq-at-common.cpp
@@ -24,21 +24,21 @@
 
 void lynq_response_ok()
 {
-    char *str = "OK\n";
+    char *str = "OK\r\n";
     handle_output(str, strlen(str), Response);
 }
 
 void lynq_response_error(int error_code)
 {
     char str[32] = {0};
-    sprintf(str, "+CME ERROR: %d\n", error_code);
+    sprintf(str, "+CME ERROR: %d\r\n", error_code);
     handle_output(str, strlen(str), Response);
 }
 
 void lynq_handle_version()
 {
     char buf[64] = {0};
-    sprintf(buf,"%s\n",LYNQ_SW_INSIDE_VERSION);
+    sprintf(buf,"+CGIR:%s\r\n",LYNQ_SW_INSIDE_VERSION);
     handle_output(buf, strlen(buf), Response);
     lynq_response_ok();
     return;
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/lynq_qser_gnss.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/lynq_qser_gnss.cpp
index 8884a7a..a238919 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/lynq_qser_gnss.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/lynq_qser_gnss.cpp
@@ -487,14 +487,14 @@
     char cgpsnmea_at_res[64]={};
     if (at_type == 0)
     {
-        strncpy(cgpsnmea_at_res,"+CGPSNMEA:(0,1)\r\n",64);
+        sprintf(cgpsnmea_at_res,"+CGPSNMEA:(0,1)\r\n");
         atsvc_gnss_outcb(cgpsnmea_at_res,strlen(cgpsnmea_at_res),0);
         return 0;
     }
     else if(at_type == 1)
     {
         bzero(cgpsnmea_at_res,64);
-        sprintf(cgpsnmea_at_res,"+CGPSNMEA:<%d>",at_gpsnmea_status);
+        sprintf(cgpsnmea_at_res,"+CGPSNMEA:<%d>\r\n",at_gpsnmea_status);
         atsvc_gnss_outcb(cgpsnmea_at_res,strlen(cgpsnmea_at_res),0);
         return 0;
     }
@@ -507,7 +507,7 @@
         }
         else
         {
-            strncpy(cgpsnmea_at_res,"+CGPSNMEA: same status\r\n",64);
+            sprintf(cgpsnmea_at_res,"+CGPSNMEA: same status\r\n");
             atsvc_gnss_outcb(cgpsnmea_at_res,strlen(cgpsnmea_at_res),0);
             return -1;
         }
@@ -546,22 +546,21 @@
     int res = 0;
     int income_at_type = 0;
     int gnss_state_type = -1;
-    char at_cmd[128]={0};
+    //char at_cmd[128]={0};
     char gnss_at_cmd[64] = {0};
     char parse_atcmd[128] = {0}; 
     if(NULL == input)
     {
-        strncpy(gnss_at_cmd,"+CME ERROR: 100\r\n",64);
+        sprintf(gnss_at_cmd,"+CME ERROR: 100\r\n");
         atsvc_gnss_outcb(gnss_at_cmd,strlen(gnss_at_cmd),0);
         return;
     }
-    bzero(at_cmd,128);
-    strncpy(at_cmd,input,strlen(input));
-    res = gnss_at_cmd_parse(at_cmd,parse_atcmd,&gnss_state_type,&income_at_type);
+
+    res = gnss_at_cmd_parse(input,parse_atcmd,&gnss_state_type,&income_at_type);
     if (res != 0)
     {
         ALOGE("parse at cmd error");
-        strncpy(gnss_at_cmd,"+CME ERROR: 100\r\n",64);
+        sprintf(gnss_at_cmd,"+CME ERROR: 100\r\n");
         atsvc_gnss_outcb(gnss_at_cmd,strlen(gnss_at_cmd),0);
         return;
     }
@@ -571,7 +570,7 @@
         res = lynq_at_cgps(income_at_type,gnss_state_type);
         if (res != 0)
         {
-            strncpy(gnss_at_cmd,"+CME ERROR: 100\r\n",64);
+            sprintf(gnss_at_cmd,"+CME ERROR: 100\r\n");
             atsvc_gnss_outcb(gnss_at_cmd,strlen(gnss_at_cmd),0);
             return;
         }
@@ -581,12 +580,12 @@
         res = lynq_at_cgpsnmea(income_at_type,gnss_state_type);
         if (res != 0)
         {
-            strncpy(gnss_at_cmd,"+CME ERROR: 100\r\n",64);
+            sprintf(gnss_at_cmd,"+CME ERROR: 100\r\n");
             atsvc_gnss_outcb(gnss_at_cmd,strlen(gnss_at_cmd),0);
             return;
         }
     }
-    strncpy(gnss_at_cmd,"ok\r\n",64);
+    sprintf(gnss_at_cmd,"OK\r\n");
     atsvc_gnss_outcb(gnss_at_cmd,strlen(gnss_at_cmd),0);
     return;
 }