Merge "[Feature][T106BUG-665]Modify the ephemeris injection interface and add the ephemeris file address parameter"
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/include/lynq_qser_gnss.h b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/include/lynq_qser_gnss.h
index 9eead07..ed70d21 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/include/lynq_qser_gnss.h
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/include/lynq_qser_gnss.h
@@ -128,6 +128,7 @@
 int qser_firmware_update(uint32_t h_gnss);
 int qser_Gnss_injectEphemeris(uint32_t h_gnss);
 int qser_Gnss_download_tle();
+int qser_Gnss_injectEphemeris_withpath(uint32_t h_gnss, char *path);
 #ifdef __cplusplus
 }
 #endif
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/include/mbtk_gnss_internal.h b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/include/mbtk_gnss_internal.h
index c6486d8..50cc58a 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/include/mbtk_gnss_internal.h
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/include/mbtk_gnss_internal.h
@@ -343,7 +343,7 @@
 int set_baudrate(int fd, int baudrate);
 int mopen_gnss_dev_reset(uint32 h_gnss, int type, int mode);
 int lynq_open_gps(int state);
-int lynq_gnss_Injection_ephemeris(uint32 h_gnss);
+int lynq_gnss_Injection_ephemeris(uint32 h_gnss, char *ephemeris_path);
 int exec_cmd(const char *cmd, char *result);
 int lynq_gnss_get_aidinfo(uint32 h_gnss);
 int lynq_gnss_get_device_info(uint32 h_gnss);
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 7360f71..4fe61db 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
@@ -129,7 +129,6 @@
         return -1;
     }
     struct mbtk_gnss_handle_t *gnss_handle = (struct mbtk_gnss_handle_t *)h_gnss;
-    printf("type in\n");
     switch(type)
     {
 
@@ -452,18 +451,34 @@
         return -1;
     }
 #if defined(HD_GNSS)
-        ret = hd_gnss_injects_aidpos(h_gnss);
-        if(ret < 0)
-        {
-            return -1;
-        }
+    ret = hd_gnss_injects_aidpos(h_gnss);
+    if(ret < 0)
+    {
+         return -1;
+    }
 #elif defined(HX_GNSS)
-        ret = mopen_gnss_injects_aidpos(h_gnss);
-        if(ret < 0)
-        {
-            return -1;
-        }
+    ret = mopen_gnss_injects_aidpos(h_gnss);
+    if(ret < 0)
+    {
+        return -1;
+    }
 #endif
+    return 0;
+}
+
+int qser_Gnss_injectEphemeris_withpath(uint32_t h_gnss, char *path)
+{
+    int ret;
+    if(!inited)
+    {
+        ALOGE("has not been initiated\n");
+        return -1;
+    }
+    ret = lynq_gnss_Injection_ephemeris(h_gnss,path);
+    if(ret < 0)
+    {
+        return -1;
+    }
 
     return 0;
 }
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/mbtk_gnss.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/mbtk_gnss.cpp
index ab4cf73..5087a82 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/mbtk_gnss.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/mbtk_gnss.cpp
@@ -1607,7 +1607,7 @@
 }
 
 /*Injection ephemeris AGNSS_TLE_FILE*/
-int lynq_gnss_Injection_ephemeris(uint32 h_gnss)
+int lynq_gnss_Injection_ephemeris(uint32 h_gnss, char *ephemeris_path)
 {
     int ret;
     int agnss_fd = 0;
@@ -1619,7 +1619,7 @@
         return -1;
     }
 
-    agnss_fd = open(AGNSS_TLE_FILE, O_RDWR);
+    agnss_fd = open(ephemeris_path, O_RDWR);
     if (agnss_fd <= 0)
     {
         printf("%s open file FAIL. errno:%d\n", __FUNCTION__, errno);