From 5eeb48c8587e69b89b490b988d75ea41498fbc59 Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Mon, 1 Sep 2025 15:44:20 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96gps=E5=86=B7=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../peripheral/config/include/ConfigModelC.h | 2 + .../peripheral/config/src/ConfigModel.cpp | 6 + .../gnss/sample/pgnss_sample/pgnss_encode.c | 34 +- .../gnss/sample/pgnss_sample/pgnss_encode.h | 10 +- .../gnss/sample/pgnss_sample/pgnss_sample.c | 336 +++++++++++++++--- 5 files changed, 319 insertions(+), 69 deletions(-) diff --git a/code/sdk/drivers/peripheral/config/include/ConfigModelC.h b/code/sdk/drivers/peripheral/config/include/ConfigModelC.h index f991cdf5e..1543a7586 100644 --- a/code/sdk/drivers/peripheral/config/include/ConfigModelC.h +++ b/code/sdk/drivers/peripheral/config/include/ConfigModelC.h @@ -150,6 +150,8 @@ int set_dev_id(char *buf); int get_dev_id(char *buf); +bool cm_getisFirstTimeStart(void); + #ifdef __cplusplus #if __cplusplus diff --git a/code/sdk/drivers/peripheral/config/src/ConfigModel.cpp b/code/sdk/drivers/peripheral/config/src/ConfigModel.cpp index d6f1c4c8e..74e7e8185 100644 --- a/code/sdk/drivers/peripheral/config/src/ConfigModel.cpp +++ b/code/sdk/drivers/peripheral/config/src/ConfigModel.cpp @@ -1334,6 +1334,12 @@ void cm_sync_all_config_to_disk(void) } +bool cm_getisFirstTimeStart(void) +{ + return OHOS::ConfigModel::GetInstance()->GetisFirstTimeStart(); +} + + void cm_initScreenBrightness(void) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "cm_initScreenBrightness"); diff --git a/code/sdk/drivers/peripheral/gnss/sample/pgnss_sample/pgnss_encode.c b/code/sdk/drivers/peripheral/gnss/sample/pgnss_sample/pgnss_encode.c index 5d677d42a..a8d47def8 100644 --- a/code/sdk/drivers/peripheral/gnss/sample/pgnss_sample/pgnss_encode.c +++ b/code/sdk/drivers/peripheral/gnss/sample/pgnss_sample/pgnss_encode.c @@ -1,9 +1,9 @@ /* - * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2024-2024. All rights reserved. - * Description: pgnss encode - * Author: - * Create: - */ +* Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2024-2024. All rights reserved. +* Description: pgnss encode +* Author: +* Create: +*/ #include "pgnss_encode.h" #include #include @@ -535,19 +535,20 @@ void PgnssSendGloEph(tiot_handle handle, const char *fileName, int32_t ts) free(buff); } -void PgnssInjectAllEphLessFiles(tiot_handle handle, uint32_t ts) +int32_t PgnssInjectAllEphLessFiles(tiot_handle handle, uint32_t ts) { char fileName[FILE_PATH_LEN] = {0}; if (GetNonGloEphFileName(ts, fileName) == 0) { printf("\nerror: GetNonGloEphFileName failed\r\n"); - return; + return 0; // 返回失败状态 } PgnssSendNonGloEph(handle, fileName); if (GetGloEphFileName(ts, fileName) == 0) { printf("\nerror: GetGloEphFileName failed\r\n"); - return; + return 0; // 返回失败状态 } PgnssSendGloEph(handle, fileName, ts); + return 1; // 返回成功状态 } void PgnssSendOtherAssistInfo(tiot_handle handle, const char *fileName) @@ -589,15 +590,24 @@ void PgnssSendOtherAssistInfo(tiot_handle handle, const char *fileName) free(buff); } -void PgnssInjectOtherAssistLessFiles(tiot_handle handle) +int32_t PgnssInjectOtherAssistLessFiles(tiot_handle handle) { PgnssSendOtherAssistInfo(handle, "/user/userdata/gnss/AssistInfo.dat"); + return 1; // 返回成功状态 } // 注入PGNSS解析数据合并输出接口生成的星历文件 -void PgnssInjectLessFiles(tiot_handle handle, uint32_t ts) +int32_t PgnssInjectLessFiles(tiot_handle handle, uint32_t ts) { // 注入Pgnss辅助数据 - PgnssInjectAllEphLessFiles(handle, ts); - PgnssInjectOtherAssistLessFiles(handle); + int32_t ephRet = PgnssInjectAllEphLessFiles(handle, ts); + int32_t assistRet = PgnssInjectOtherAssistLessFiles(handle); + + // 如果星历注入失败,返回失败状态 + if (ephRet == 0) { + printf("PGNSS ephemeris injection failed\r\n"); + return 0; + } + + return 1; // 返回成功状态 } \ No newline at end of file diff --git a/code/sdk/drivers/peripheral/gnss/sample/pgnss_sample/pgnss_encode.h b/code/sdk/drivers/peripheral/gnss/sample/pgnss_sample/pgnss_encode.h index a666edc91..10c65ec7f 100644 --- a/code/sdk/drivers/peripheral/gnss/sample/pgnss_sample/pgnss_encode.h +++ b/code/sdk/drivers/peripheral/gnss/sample/pgnss_sample/pgnss_encode.h @@ -1,3 +1,11 @@ +/* + * @Author: penglei 1624952103@qq.com + * @Date: 2025-07-11 16:41:59 + * @LastEditors: penglei 1624952103@qq.com + * @LastEditTime: 2025-09-01 15:37:36 + * @FilePath: /FD230/code/sdk/drivers/peripheral/gnss/sample/pgnss_sample/pgnss_encode.h + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ /* * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2024-2024. All rights reserved. * Description: pgnss encode @@ -12,5 +20,5 @@ int32_t PgnssInjectUtcTime(tiot_handle handle, GnssUtcTime *utcTime, uint32_t* ts); void PgnssInject(tiot_handle handle, uint32_t ts); -void PgnssInjectLessFiles(tiot_handle handle, uint32_t ts); +int32_t PgnssInjectLessFiles(tiot_handle handle, uint32_t ts); #endif \ No newline at end of file diff --git a/code/sdk/drivers/peripheral/gnss/sample/pgnss_sample/pgnss_sample.c b/code/sdk/drivers/peripheral/gnss/sample/pgnss_sample/pgnss_sample.c index 7a28b97ef..ad761479b 100644 --- a/code/sdk/drivers/peripheral/gnss/sample/pgnss_sample/pgnss_sample.c +++ b/code/sdk/drivers/peripheral/gnss/sample/pgnss_sample/pgnss_sample.c @@ -1,11 +1,15 @@ /* - * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2024-2024. All rights reserved. - * Description: pgnss sample - * Author: - * Create: - */ +* Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2024-2024. All rights reserved. +* Description: pgnss sample +* Author: +* Create: +*/ #include "pgnss_sample.h" #include +#include +#include +#include +#include #include "securec.h" #include "tiot_service_interface.h" #include "pm_definition.h" @@ -15,10 +19,10 @@ #include "sys/time.h" #include "time.h" #include "gnss_ctl.h" -#ifdef SUPPORT_CYWEE_SERVICE -#include "cywee_service.h" -#endif -#include "uart_porting.h" +#include "custom_runtime.h" +#include "los_base.h" +#include "ConfigModelC.h" +// #include "gnss_sample.h" #define PGNSS_FIXMODEALL_NMEADEF_SAMPLE 0 #define PGNSS_LESS_FILES_FIXMODEALL_NMEADEF_SAMPLE 0 @@ -47,6 +51,9 @@ static gps_data_t g_global_gpsData={0}; static int g_is_pgnss_poweron=0; static int g_is_pgnss_logon=0; static int g_pgnss_stopflag=0; +static int g_cold_start_pgnss_stopflag = 0; + +static char *pgnss_log = NULL; static int32_t QryVersion(tiot_handle handle) { @@ -73,10 +80,6 @@ static int decode_nmea(char c) memcpy_s(&g_global_gpsData,sizeof(gps_data_t),&(g_nmeadata.gpsData),sizeof(gps_data_t)); ret = 1; memset(&g_nmeadata,0,sizeof(g_nmeadata)); -#ifdef SUPPORT_CYWEE_SERVICE - if(uapi_dev_runtime_get_train_status()) - do_cywee_service_check_msg(CYWEE_SERVICE_CMD_GNSS_UPDATE,NULL); -#endif } } @@ -89,55 +92,66 @@ gps_data_t * getPGPSGlobaldata(void) } -// 注入PGNSS,使用默认配置启动 -int32_t InjectPgnssCfgAutoStartFixModeAndNmeaDefault(tiot_handle handle) -{ - const uint8_t cfgLogLevelInfo[] = {0x03, 0x00, 0x15, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x10, 0x01, 0x00, 0x03}; +// 添加普通GNSS冷启动配置函数的声明和实现 +// 从gnss_sample.c中复制冷启动相关的命令定义 - // 配置log级别:info级别。 - int32_t ret = tiot_service_write(handle, cfgLogLevelInfo, sizeof(cfgLogLevelInfo)); +// 函数声明 +void PGnssServerStartColdStart(void); +const uint8_t cfgColdStartCmd[] = {0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01}; +const uint8_t cfgFixModeAllCmd[] = {0x03, 0x00, 0x23, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x1f, 0x00, 0x00, 0x00}; +const uint8_t cfgNmeaAllCmd[] = {0x03, 0x00, 0x04, 0x01, 0x00, 0x00, 0x06, 0x00, 0x03, 0x00, 0x02, 0x00, 0xff, 0x00}; +const uint8_t CFG_TRK_LPW_DISABLE[] = {0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00}; +const uint8_t CFG_ACQ_LPW_DISABLE[] = {0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x04, 0x00, 0x02, 0x00, 0x00, 0x00}; +const uint8_t CFG_ANTIJAM_ENABLE[] = {0x03, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x08, 0x00, 0x06, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00}; + +// 普通GNSS冷启动配置函数实现 +int32_t CfgColdStartFixModeGpsNmeaAll(tiot_handle handle) +{ + // 配置启动模式:冷启动模式 + int32_t ret = tiot_service_write(handle, cfgColdStartCmd, sizeof(cfgColdStartCmd)); if (ret < 0) { - printf("\nerror: cfgLogLevelInfo error: %d\r\n", ret); + printf("\nerror: cfgColdStartCmd error: %d\r\n", ret); return 0; } - // 注入UTC时间, 注入Pgnss辅助数据前必须先注入参考时间 - GnssUtcTime utcTime = {2024, 2, 26, 6, 0, 0, 0, 1}; // 需要用当前的UTC时间替换 - - time_t rawtime; - struct tm* timeinfo; - - time(&rawtime); // 获取UTC时间戳 - timeinfo = gmtime(&rawtime); // 转换为UTC时间(无时区偏移) - - utcTime.year = timeinfo->tm_year + 1900; - utcTime.month = timeinfo->tm_mon + 1; - utcTime.day = timeinfo->tm_mday; - utcTime.hour = timeinfo->tm_hour; - utcTime.minute = timeinfo->tm_min; - utcTime.second = timeinfo->tm_sec; + // 配置使能的GNSS星座:GPS + ret = tiot_service_write(handle, cfgFixModeAllCmd, sizeof(cfgFixModeAllCmd)); + if (ret < 0) { + printf("\nerror: cfgFixModeAllCmd error: %d\r\n", ret); + return 0; + } - printf("year[%d], mon[%d], day[%d], hour[%d], min[%d], sec[%d] \r\n", - utcTime.year,utcTime.month,utcTime.day, - utcTime.hour,utcTime.minute,utcTime.second); + // 配置上报NMEA类型:PNT/ZDA/VTG/RMC/GSV/GSA/GLL/GGA + ret = tiot_service_write(handle, cfgNmeaAllCmd, sizeof(cfgNmeaAllCmd)); + if (ret < 0) { + printf("\nerror: cfgNmeaAllCmd error: %d\r\n", ret); + return 0; + } - uint32_t ts = 0; - ret = PgnssInjectUtcTime(handle, &utcTime, &ts); - if (ret == 0) { - printf("\nerror: PgnssInjectUtcTime failed!\r\n"); + ret = tiot_service_write(handle, CFG_TRK_LPW_DISABLE, sizeof(CFG_TRK_LPW_DISABLE)); + if (ret < 0) { + printf("\nerror: CFG_TRK_LPW_DISABLE error: %d\r\n", ret); return 0; } - printf("\nPgnssInjectUtcTime success!\r\n"); - // PGNSS注入 - // 注意,默认PGNSS星历文件存放在/user/xgnss/目录中,如修改目录,请全局搜索替换 - PgnssInject(handle, ts); + ret = tiot_service_write(handle, CFG_ACQ_LPW_DISABLE, sizeof(CFG_ACQ_LPW_DISABLE)); + if (ret < 0) { + printf("\nerror: CFG_ACQ_LPW_DISABLE error: %d\r\n", ret); + return 0; + } + ret = tiot_service_write(handle, CFG_ANTIJAM_ENABLE, sizeof(CFG_ANTIJAM_ENABLE)); + if (ret < 0) { + printf("\nerror: CFG_ANTIJAM_ENABLE error: %d\r\n", ret); + return 0; + } + + printf("Cold start mode configured successfully\r\n"); return 1; } -// 注入PGNSS,使用默认配置启动 -int32_t InjectPgnssLessFilesCfgAutoStartFixModeAndNmeaDefault(tiot_handle handle) +// 修改后的PGNSS配置函数,支持降级到普通GNSS +int32_t InjectPgnssWithFallbackToColdStart(tiot_handle handle) { const uint8_t cfgLogLevelInfo[] = {0x03, 0x00, 0x15, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x10, 0x01, 0x00, 0x03}; @@ -149,7 +163,7 @@ int32_t InjectPgnssLessFilesCfgAutoStartFixModeAndNmeaDefault(tiot_handle handle } // 注入UTC时间, 注入Pgnss辅助数据前必须先注入参考时间 - GnssUtcTime utcTime = {2024, 3, 14, 12, 0, 0, 0, 1}; // 需要用当前的UTC时间替换 + GnssUtcTime utcTime = {2024, 2, 26, 6, 0, 0, 0, 1}; // 需要用当前的UTC时间替换 time_t rawtime; struct tm* timeinfo; @@ -168,7 +182,6 @@ int32_t InjectPgnssLessFilesCfgAutoStartFixModeAndNmeaDefault(tiot_handle handle utcTime.year,utcTime.month,utcTime.day, utcTime.hour,utcTime.minute,utcTime.second); - uint32_t ts = 0; ret = PgnssInjectUtcTime(handle, &utcTime, &ts); if (ret == 0) { @@ -179,11 +192,35 @@ int32_t InjectPgnssLessFilesCfgAutoStartFixModeAndNmeaDefault(tiot_handle handle // PGNSS注入 // 注意,默认PGNSS星历文件存放在/user/xgnss/目录中,如修改目录,请全局搜索替换 - PgnssInjectLessFiles(handle, ts); + int32_t injectRet = PgnssInjectLessFiles(handle, ts); + if (injectRet == 0) { + // PGNSS注入失败,设置停止标志并重新启动 + printf("PGNSS injection failed, restarting with cold start mode\r\n"); + // if(uapi_dev_runtime_get_cat1_powerstat()) + // { + + // } + // else + // { + // 设置停止标志 + g_cold_start_pgnss_stopflag = 1; + // } + + return 0; // 返回0表示需要重新启动 + } + printf("PGNSS injection completed successfully\r\n"); return 1; } + +// 注入PGNSS,使用默认配置启动 +int32_t InjectPgnssLessFilesCfgAutoStartFixModeAndNmeaDefault(tiot_handle handle) +{ + // 调用新的带降级功能的函数 + return InjectPgnssWithFallbackToColdStart(handle); +} + static const GnssSamplesCfgTable g_gnssSamplesCfg[] = { // {PGNSS_FIXMODEALL_NMEADEF_SAMPLE, InjectPgnssCfgAutoStartFixModeAndNmeaDefault}, {PGNSS_LESS_FILES_FIXMODEALL_NMEADEF_SAMPLE, InjectPgnssLessFilesCfgAutoStartFixModeAndNmeaDefault} @@ -246,6 +283,18 @@ static void ListenGnssData(tiot_handle handle) if (decode_nmea(pbuf[index])==1) { // dump_location_data(&g_global_gpsData); + char temp_buf[512]; + dump_location_data_to_buf(&g_global_gpsData, temp_buf, sizeof(temp_buf)); + + // 追加到pgnss_log中 + if (pgnss_log != NULL) { + int current_len = strlen(pgnss_log); + int data_len = strlen(temp_buf); + if (current_len + data_len < 2047) { // 留1字节给字符串结束符 + snprintf(pgnss_log + current_len, 2048 - current_len, "%s", temp_buf); + } + } + printf("decode_nmea done\r\n"); } } @@ -281,13 +330,161 @@ int PGnssLogEnable(bool enable) return g_is_pgnss_logon; } +// 直接启动冷启动模式的函数 +void PGnssServerStartColdStart(void) +{ + printf("\nenter cold start mode\r\n"); + + if (pgnss_log == NULL) + { + pgnss_log = (char *)malloc(2048); + if (pgnss_log == NULL) { + printf("error: malloc pgnss_log failed!\n"); + return; + } + memset(pgnss_log, 0, 2048); + } + + uapi_pm_add_sleep_veto(PM_ID_SYS); + + #ifdef DOWNLOAD_GNSS_SWITCH + download_gnss_switch(SWITCH_TO_GNSS); + #endif + g_is_pgnss_poweron = 1; + g_pgnss_stopflag = 0; + g_cold_start_pgnss_stopflag = 0; + sw_debug_uart_deinit(); + + // Step1: init + int32_t ret = tiot_service_init(); + if (ret != 0) { + printf("tiot service init fail\r\n"); + g_is_pgnss_poweron = 0; + g_pgnss_stopflag = 1; + if (pgnss_log != NULL) { + free(pgnss_log); + pgnss_log = NULL; + } + return; + } + + // 打开日志文件 + if (g_is_pgnss_logon) + { + g_gnssLogFp = fopen("/user/log/gnss.log", "w"); + if (g_gnssLogFp == NULL) { + printf("error: open log file error\n"); + if (pgnss_log != NULL) { + free(pgnss_log); + pgnss_log = NULL; + } + return; + } + } + printf("before open tiot service for cold start\n"); + + // Step2: power on gnss + tiot_handle handle = tiot_service_open("gn71", NULL); + if (handle == 0) { + printf("open tiot service fail\r\n"); + g_is_pgnss_poweron = 0; + g_pgnss_stopflag = 1; + if (pgnss_log != NULL) { + free(pgnss_log); + pgnss_log = NULL; + } + return; + } + printf("open tiot service success for cold start\n"); + + // 直接配置为冷启动模式 + printf("Configuring cold start mode...\r\n"); + int32_t cfgRet = CfgColdStartFixModeGpsNmeaAll(handle); + if (cfgRet == 0) { + printf("Cold start configuration failed\r\n"); + tiot_service_close(handle); + return; + } + printf("Cold start mode configured successfully\r\n"); + + QryVersion(handle); + + // Step4: start gnss + if (StartGnss(handle) == 0) { + printf("Start GNSS failed\r\n"); + tiot_service_close(handle); + return; + } + + // Step5: listening gnss data + ListenGnssData(handle); + + // Step6: stop gnss + if (StopGnss(handle) == 0) { + printf("Stop GNSS failed\r\n"); + } + + // Step7: power off gnss + tiot_service_close(handle); + + // 关日志文件 + if (g_is_pgnss_logon) + { + fclose(g_gnssLogFp); + g_gnssLogFp = NULL; + } + + // Step8: deinit + tiot_service_deinit(); + + #ifdef DOWNLOAD_GNSS_SWITCH + download_gnss_switch(SWITCH_TO_DOWNLOAD); + #endif + uapi_pm_remove_sleep_veto(PM_ID_SYS); + + g_is_pgnss_poweron = 0; + sw_debug_uart_deinit(); + uart_config_init(); + printf("finish cold start mode\r\n"); + + printf("gnss_log: %s\r\n", pgnss_log); + // 释放pgnss_log内存 + if (pgnss_log != NULL) { + free(pgnss_log); + pgnss_log = NULL; + } +} + void PGnssServerStart(void) { + //未绑定直接冷启动 + if(cm_getisFirstTimeStart()) + { + printf("PGnssServerStartColdStart \n"); + PGnssServerStartColdStart(); + return; + } + printf("\nenter gnss samples\r\n"); + + if (pgnss_log == NULL) + { + pgnss_log = (char *)malloc(2048); + if (pgnss_log == NULL) { + printf("error: malloc pgnss_log failed!\n"); + return; + } + memset(pgnss_log, 0, 2048); + } + if(g_is_pgnss_poweron == 1) { printf("gnss already on\r\n"); + if (pgnss_log != NULL) { + free(pgnss_log); + pgnss_log = NULL; + } return ; } uapi_pm_add_sleep_veto(PM_ID_SYS); @@ -297,16 +494,19 @@ void PGnssServerStart(void) #endif g_is_pgnss_poweron = 1; g_pgnss_stopflag = 0; - + g_cold_start_pgnss_stopflag = 0; sw_debug_uart_deinit(); - // uart_config_init(); - // Step1: init int32_t ret = tiot_service_init(); if (ret != 0) { printf("tiot service init fail\r\n"); g_is_pgnss_poweron = 0; g_pgnss_stopflag = 1; + if (pgnss_log != NULL) { + free(pgnss_log); + pgnss_log = NULL; + } + return; } // 打开日志文件 @@ -315,6 +515,10 @@ void PGnssServerStart(void) g_gnssLogFp = fopen("/user/log/gnss.log", "w"); if (g_gnssLogFp == NULL) { printf("error: open log file error\n"); + if (pgnss_log != NULL) { + free(pgnss_log); + pgnss_log = NULL; + } return; } } @@ -326,6 +530,11 @@ void PGnssServerStart(void) printf("open tiot service fail\r\n"); g_is_pgnss_poweron = 0; g_pgnss_stopflag = 1; + g_cold_start_pgnss_stopflag = 1; + if (pgnss_log != NULL) { + free(pgnss_log); + pgnss_log = NULL; + } return; } printf("open tiot service success\r\n"); @@ -340,7 +549,8 @@ void PGnssServerStart(void) cfgRet = g_gnssSamplesCfg[i].cfgHandle(handle); } if (cfgRet == 0) { - continue; + // continue; + break; } printf("cfg sample id:%u\r\n", g_gnssSamplesCfg[i].sampleId); QryVersion(handle); @@ -373,8 +583,22 @@ void PGnssServerStart(void) download_gnss_switch(SWITCH_TO_DOWNLOAD); #endif uapi_pm_remove_sleep_veto(PM_ID_SYS); - g_is_pgnss_poweron=0; + if(!g_cold_start_pgnss_stopflag) + g_is_pgnss_poweron = 0; sw_debug_uart_deinit(); uart_config_init(); printf("finish gnss samples\r\n"); + + printf("pgnss_log: %s\r\n", pgnss_log); + // 释放pgnss_log内存 + if (pgnss_log != NULL) { + free(pgnss_log); + pgnss_log = NULL; + } + if(g_cold_start_pgnss_stopflag == 1) + { + // GnssServerStart(); + PGnssServerStartColdStart(); + } + } -- 2.17.1