1.发送流程增加sd卡检查

This commit is contained in:
payton 2023-09-01 10:07:34 +08:00
parent 6f867bde34
commit 45303b42cc
2 changed files with 267 additions and 254 deletions

View File

@ -1265,14 +1265,18 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) {
// SF_PDT_PARAM_CFG_S *pCustomerParam = pfnParam->pstParam;
// SF_PDT_PARAM_STATISTICS_S *pStaticParam = pfnParam->pstaticParam;
UIMenuStoreInfo *pCustomerParam = sf_app_ui_para_get();
SF_STARTUP_TYPE_E startup = sf_poweron_type_get();
sf_log_Level_set(SF_LOG_LEVEL_DEBUG);
if (sf_usb_IsInsert())
if (sf_usb_IsInsert() ||
((0 == sf_in_card_exist()) && (SF_MCU_STARTUP_ONKEY != startup))) {
return SF_SUCCESS;
}
sf_4G_status_set(SF_4G_SEARCHING);
switch (sf_poweron_type_get()) {
switch (startup) {
case SF_MCU_STARTUP_OFF:
break;
@ -1301,8 +1305,8 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) {
SF_APPCOMM_CHECK_RETURN(s32ret, s32ret);
// sf_sys_software_version_get(version);
// s32ret = sf_qrcode_create(pStaticParam->IMEI,pStaticParam->SimID
//,version);
// s32ret =
//sf_qrcode_create(pStaticParam->IMEI,pStaticParam->SimID ,version);
s32ret = sf_4G_register_net_manual(pfnParam);
// sf_share_mem_customer_down(1);
@ -1317,7 +1321,8 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) {
break;
#endif
s32ret = sf_get_utc();
if ((s32ret == SF_SIM_ERROR_UTC) && (SF_ON != pCustomerParam->GpsSwitch)) {
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);
}
@ -1331,9 +1336,11 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) {
if (sf_get_signal_ready()) {
if (SUCCESS != sf_connect_ftps_server()) {
printf("[%s:%d]open ftps fail, reconnect\n", __FUNCTION__, __LINE__);
printf("[%s:%d]open ftps fail, reconnect\n", __FUNCTION__,
__LINE__);
if (SUCCESS != sf_connect_ftps_server()) {
printf("[%s:%d]re open ftps fail, reconnect\n", __FUNCTION__, __LINE__);
printf("[%s:%d]re open ftps fail, reconnect\n", __FUNCTION__,
__LINE__);
}
}
}
@ -1373,11 +1380,9 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) {
SF_APPCOMM_CHECK_RETURN(s32ret, SF_APP_ERROR_REQUEST);
if (sf_get_pic()) {
s32ret = sf_app_to_cardv_capture();
}
else if(sf_get_send_hd()){
} else if (sf_get_send_hd()) {
s32ret = sf_app_to_cardv_hd_ture();
}
else if(sf_get_send_video()){
} else if (sf_get_send_video()) {
s32ret = sf_video_ftp_send();
}
break;
@ -1448,7 +1453,8 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) {
}
if (1 == pCustomerParam->NeedTimeSyncStartUp) {
printf("[%s:%d]8 between A and B,no reg net again,no reset time sync.\n",
printf("[%s:%d]8 between A and B,no reg net again,no reset time "
"sync.\n",
__FUNCTION__, __LINE__);
sf_set_dr_reset_time_sys_flag(1);
}
@ -1457,7 +1463,8 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) {
pCustomerParam->NeedTimeSyncStartUp = 1;
}
if (pCustomerParam->DailyReportSwitch) {
pCustomerParam->GpsSendFlag = 1; // indicate need send dp file in b power on.
pCustomerParam->GpsSendFlag =
1; // indicate need send dp file in b power on.
}
SF_APPCOMM_CHECK_RETURN(s32ret, SF_APP_ERROR_REQUEST);
@ -1466,7 +1473,8 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) {
sf_USB_net_init();
s32ret = sf_get_utc();
if ((s32ret == SF_SIM_ERROR_UTC) && (SF_ON != pCustomerParam->GpsSwitch)) {
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);
}
@ -1509,7 +1517,8 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) {
sf_USB_net_init();
s32ret = sf_get_utc();
if ((s32ret == SF_SIM_ERROR_UTC) && (SF_ON != pCustomerParam->GpsSwitch)) {
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);
}
@ -1519,9 +1528,11 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) {
if (0 != sf_get_cq_signal()) {
if (SUCCESS != sf_connect_ftps_server()) {
printf("[%s:%d]open ftps fail, reconnect\n", __FUNCTION__, __LINE__);
printf("[%s:%d]open ftps fail, reconnect\n", __FUNCTION__,
__LINE__);
if (SUCCESS != sf_connect_ftps_server()) {
printf("[%s:%d]re open ftps fail, reconnect\n", __FUNCTION__, __LINE__);
printf("[%s:%d]re open ftps fail, reconnect\n", __FUNCTION__,
__LINE__);
}
}
}
@ -1566,14 +1577,11 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) {
s32ret = sf_file_send_auto();
SF_APPCOMM_CHECK_RETURN(s32ret, SF_APP_ERROR_REQUEST);
if (sf_get_pic()) {
s32ret = sf_app_to_cardv_capture();
}
else if(sf_get_send_hd()){
} else if (sf_get_send_hd()) {
s32ret = sf_app_to_cardv_hd_ture();
}
else if(sf_get_send_video()){
} else if (sf_get_send_video()) {
s32ret = sf_video_ftp_send();
}
// sf_share_mem_customer_down(1);
@ -1913,7 +1921,8 @@ int sf_check_sd(void)
ret = sf_sd_status_get();
if (SF_SD_OK == ret) {
ret = SF_SUCCESS;
MLOGI("usb net ip up\r\n");
MLOGI("SD\r\n");
sf_statistics_param_load(sf_statistics_param_get());
break;
} else {
sleep(1);

View File

@ -897,6 +897,10 @@ void sf_power_off(void)
SF_MESSAGE_BUF_S stMessageBuf = {0};
UINT8 PowerOnMode = sf_poweron_type_get();
printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
if(SF_FAILURE == sf_check_sd())
{
MLOGE("ERROR sf_check_sd\n");
}
//UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
SF_PDT_PARAM_STATISTICS_S *psfPara = sf_statistics_param_get();