[Bugfix][T106BUG-308]when firmware update, it will be Segmentation fault
Only Configure:No
Affected branch:master
Affected module:GNSS
Is it affected on both ZXIC and MTK:only ZXIC,
Self-test:Yes,
Doc Update:Yes
Change-Id: Ifdacd1df0a286312ca18da295548b3c6cb0bd9c3
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 1fe5ab3..e02832b 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
@@ -114,7 +114,7 @@
int qser_Gnss_Stop(uint32_t h_gnss);
int qser_Gnss_Delete_Aiding_Data(uint32_t h_gnss,DELETE_AIDING_DATA_TYPE_T flags);
int qser_Gnss_InjectTime(uint32_t h_gnss,LYNQ_INJECT_TIME_INTO_T *time_info);
-int qser_firmware_update(uint32_t* ph_gnss);
+int qser_firmware_update(uint32_t h_gnss);
int qser_Gnss_injectEphemeris(uint32_t h_gnss);
int qser_Gnss_download_tle();
#ifdef __cplusplus
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 1c4f1bc..c66aafd 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
@@ -242,10 +242,10 @@
return 0;
}
-int qser_firmware_update(uint32_t* ph_gnss)
+int qser_firmware_update(uint32_t h_gnss)
{
int ret;
- mopen_gnss_firmware_update(*ph_gnss);
+ mopen_gnss_firmware_update(h_gnss);
if(ret < 0)
{
return -1;
@@ -466,7 +466,6 @@
return -1;
}
lynq_open_gps(1);
-
if(gpio21_value == 1)
{
ret = set_baudrate(tty_fd, B115200);
@@ -539,7 +538,7 @@
}
else if(at_gpsnmea_status == 1)
{
- ALOGD("gpsnmea_status = %d\n",at_gpsnmea_status);
+ ALOGE("gpsnmea_status = %d\n",at_gpsnmea_status);
pthread_create(&thread, NULL, read_gps_data, NULL);
}
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 a9a0b67..6cc38c0 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
@@ -1543,21 +1543,14 @@
*/
int exec_cmd(const char *cmd, char *result)
{
- FILE *pipe = popen(cmd, "r");
- if(!pipe)
- return -1;
-
- char buffer[256] = {0};
- while(!feof(pipe))
+ /*result is not used temporarily*/
+ int ret = -1;
+ ret = system(cmd);
+ if(ret == -1)
{
- if(fgets(buffer, 256, pipe))
- {
- result[0] = buffer[0];
- memset(buffer, 0, sizeof(buffer));
- }
+ ALOGE("cmd system error\n");
+ return ret;
}
-
- pclose(pipe);
return 0;
}