[feature]at+cgir(only for factory test:get inside version)

Change-Id: Ie99a04abceca77a06c5a934594d5b8b4b81bbe67
diff --git a/framework/lynq-ril-service/src/ril.cpp b/framework/lynq-ril-service/src/ril.cpp
index c593c6a..12801dd 100755
--- a/framework/lynq-ril-service/src/ril.cpp
+++ b/framework/lynq-ril-service/src/ril.cpp
@@ -3855,6 +3855,50 @@
     return 0;
 }
 
+static int lynq_get_inside_version(){
+    FILE *fp;
+    char buf[128] = {0};
+    char cgmr[128] = {0};
+    sprintf(buf, "uci get lynq_uci_ro.lynq_version.LYNQ_SW_INSIDE_VERSION 2>&1");
+    fp=popen(buf, "r");
+    int n;
+    while(fgets(buf, sizeof(buf), fp) != NULL)
+    {
+    }
+    //parse_version_buf(buf);
+    sprintf(cgmr, "%s %s", "+CGIR:", buf);
+    n = write(ttyGS3_fd,cgmr,strlen(cgmr));
+    if(n<0)
+    {
+        perror("lynq resp write:");
+    }
+    pclose(fp);
+    return 0;
+}
+
+/**
+ * @brief cgmr ---> cgir
+ * 
+ * @param response 
+ */
+static void parse_inside_version(void *response)
+{
+    char *p = (char *)response;
+    while (*p != 0)
+    {
+        if(*p == 'M')
+        {
+            *p = 'I';
+            break;
+        }
+        else
+        {
+            *p ++;
+        }
+    }
+    return;
+}
+
 extern "C" void
 RIL_onRequestComplete(RIL_Token t, RIL_Errno e, void *response, size_t responselen) {
     RequestInfo *pRI;
@@ -4101,6 +4145,22 @@
                         }
                         printf("n = %d\n",n);
                    }
+                   /*lei add only for factory test 2022/5/19*/
+                   if(pRI->lynqEvent==3)
+                   {
+                       /*lei add for at+cgir*/
+                        if(strstr((const char*)response,"+CGMR")){
+                            lynq_get_inside_version();
+                        }
+                        /*lei add for at+cgir*/
+                        parse_inside_version(response);
+                        int n = write(ttyGS3_fd,response,responselen);
+                        if(n<0)
+                        {
+                            perror("lynq resp write:");
+                        }
+                        printf("n = %d\n",n);
+                   }
                }
                default:
                    break;