1.修复关闭gps时ntp获取

This commit is contained in:
payton 2023-08-11 23:17:09 +08:00
parent 1e82836e1c
commit 9c941d1a4c

View File

@ -1294,7 +1294,10 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) {
break; break;
#endif #endif
s32ret = sf_get_utc(); s32ret = sf_get_utc();
if ((s32ret == SF_SIM_ERROR_UTC) && (SF_ON != pCustomerParam->GpsSwitch)) {
SF_PARA_TIME_S current_time = { 0, 0, 0, 0, 0, 0};
s32ret = sf_get_ntp(s32ret, &current_time);
}
sf_4G_usb_net_apn_cfg(pfnParam); sf_4G_usb_net_apn_cfg(pfnParam);
sf_USB_net_init(); sf_USB_net_init();
if ((SF_ON == pCustomerParam->GpsSwitch)) { if ((SF_ON == pCustomerParam->GpsSwitch)) {
@ -1421,6 +1424,10 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) {
sf_USB_net_init(); sf_USB_net_init();
s32ret = sf_get_utc(); s32ret = sf_get_utc();
if ((s32ret == SF_SIM_ERROR_UTC) && (SF_ON != pCustomerParam->GpsSwitch)) {
SF_PARA_TIME_S current_time = { 0, 0, 0, 0, 0, 0};
s32ret = sf_get_ntp(s32ret, &current_time);
}
if ((SF_ON == pCustomerParam->GpsSwitch)) { if ((SF_ON == pCustomerParam->GpsSwitch)) {
open_gps(); open_gps();
} }
@ -1464,6 +1471,10 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) {
sf_USB_net_init(); sf_USB_net_init();
s32ret = sf_get_utc(); s32ret = sf_get_utc();
if ((s32ret == SF_SIM_ERROR_UTC) && (SF_ON != pCustomerParam->GpsSwitch)) {
SF_PARA_TIME_S current_time = { 0, 0, 0, 0, 0, 0};
s32ret = sf_get_ntp(s32ret, &current_time);
}
if ((SF_ON == pCustomerParam->GpsSwitch)) { if ((SF_ON == pCustomerParam->GpsSwitch)) {
open_gps(); open_gps();
} }