1.sd卡警告功能调整
This commit is contained in:
parent
f0d685f14d
commit
1c818be9ed
|
@ -2364,6 +2364,7 @@ void sf_power_on_para_check_init(void)
|
|||
}
|
||||
puiPara->FristSendDailyAndGps = 1;
|
||||
puiPara->GpsSendFlag = 0;
|
||||
puiPara->SdFileSwitch = 0;
|
||||
memset(puiPara->SimIccid,'\0',sizeof(puiPara->SimIccid));
|
||||
memset(puiPara->ServiceProvider,'\0',sizeof(puiPara->ServiceProvider));
|
||||
}
|
||||
|
@ -2379,7 +2380,7 @@ void sf_power_on_para_check_init(void)
|
|||
}
|
||||
else if(PowerOnMode == PWR_ON_DAILY_REPORT)
|
||||
{
|
||||
|
||||
puiPara->SdFileSwitch = 0;
|
||||
}
|
||||
|
||||
printf("PowerOnMode=%d NeedTimeSyncStartUp=%d NetWorkNeedSearch:%d\n", PowerOnMode, puiPara->NeedTimeSyncStartUp, puiPara->NetWorkNeedSearch);
|
||||
|
|
|
@ -581,6 +581,8 @@ typedef struct _UIMenuUIMenuStoreInfo {
|
|||
CHAR SimIccidA[21];
|
||||
UINT32 SdFailCount;
|
||||
CHAR LiBatteryType;/*Alkaline/NI-MH/LI*/
|
||||
UINT8 SdFileSwitch;
|
||||
|
||||
UINT32 x1;
|
||||
UINT32 x2;
|
||||
UINT32 x3;
|
||||
|
|
|
@ -257,6 +257,7 @@ SINT32 sf_power_off_check_para(void);
|
|||
SINT32 sf_power_off_check_retset_para(void);
|
||||
SINT32 sf_power_off_check_format_sd(void);
|
||||
SINT32 sf_power_off_check_sd(void);
|
||||
SINT32 sf_power_off_check_sd_fail(void);
|
||||
SINT32 sf_power_off_check_gprs(void);
|
||||
SINT32 sf_power_off_check_fw_update(void);
|
||||
SINT32 sf_power_off_check_module_sleep(void);
|
||||
|
|
|
@ -2678,6 +2678,7 @@ SINT32 sf_power_off_check_sd(void)
|
|||
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
|
||||
SF_STORE_ATTR_S storeattrs = {0};
|
||||
SF_STORE_ATTR_S SDstoreattrs = {0};
|
||||
SF_STARTUP_TYPE_E startup = sf_poweron_type_get();
|
||||
|
||||
/******************** SD cycle *************************/
|
||||
if((0 == sf_check_sd()) || (sf_get_mode_flag() == 1))
|
||||
|
@ -2709,7 +2710,13 @@ SINT32 sf_power_off_check_sd(void)
|
|||
if((SDstoreattrs.SDFree < 30) && (storeattrs.SDFree < 30)) /* 30MB */
|
||||
{
|
||||
sf_set_card_full(1);
|
||||
puiPara->SdFailCount++;
|
||||
if((startup == SF_MCU_STARTUP_TIMELAPSE) || (startup == SF_MCU_STARTUP_PIR) || (startup == SF_MCU_STARTUP_BATCH_SEND))
|
||||
{
|
||||
puiPara->SdFailCount++;
|
||||
}
|
||||
else {
|
||||
puiPara->SdFailCount = 0;
|
||||
}
|
||||
sf_sleep_ms(100);
|
||||
printf("card is FULL!\n");
|
||||
}
|
||||
|
@ -2726,20 +2733,55 @@ SINT32 sf_power_off_check_sd(void)
|
|||
}
|
||||
else if((!sf_in_card_exist()) && (!sf_in_emmc_exist()) && (0 != puiPara->SendType))
|
||||
{
|
||||
puiPara->SdFailCount++;
|
||||
if((startup == SF_MCU_STARTUP_TIMELAPSE) || (startup == SF_MCU_STARTUP_PIR) || (startup == SF_MCU_STARTUP_BATCH_SEND))
|
||||
{
|
||||
puiPara->SdFailCount++;
|
||||
}
|
||||
else{
|
||||
puiPara->SdFailCount = 0;
|
||||
}
|
||||
sf_set_card_full(1);
|
||||
SYS_SLOGI("SdFailCount:%d\n",puiPara->SdFailCount);
|
||||
sf_sleep_ms(100);
|
||||
}
|
||||
else if(!sf_in_card_exist())
|
||||
{
|
||||
puiPara->SdFailCount++;
|
||||
if((startup == SF_MCU_STARTUP_TIMELAPSE) || (startup == SF_MCU_STARTUP_PIR) || (startup == SF_MCU_STARTUP_BATCH_SEND))
|
||||
{
|
||||
puiPara->SdFailCount++;
|
||||
}
|
||||
else {
|
||||
puiPara->SdFailCount = 0;
|
||||
}
|
||||
SYS_SLOGI("SdFailCount:%d\n",puiPara->SdFailCount);
|
||||
sf_sleep_ms(100);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************
|
||||
Function: sf_power_off_check_sd_fail
|
||||
Description: sf power off .
|
||||
Input: N/A
|
||||
Output: N/A
|
||||
Return: 0:SUCCESS, errcode:FAIL
|
||||
Others: N/A
|
||||
*************************************************/
|
||||
SINT32 sf_power_off_check_sd_fail(void)
|
||||
{
|
||||
SINT32 ret = 1;
|
||||
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
|
||||
SF_STARTUP_TYPE_E startup = sf_poweron_type_get();
|
||||
if((!puiPara->SdFileSwitch) && (3 == puiPara->SdFailCount) && ((startup == SF_MCU_STARTUP_TIMELAPSE) || (startup == SF_MCU_STARTUP_PIR) || (startup == SF_MCU_STARTUP_BATCH_SEND)))
|
||||
{
|
||||
if((!sf_get_signal_ready_flag()) && (sf_get_sim_insert()) && (sf_app_while_flag()) && (puiPara->GprsSwitch))
|
||||
{
|
||||
puiPara->SdFileSwitch = 1;
|
||||
ret = sf_card_log_send_ftp();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
SINT32 sf_power_off_check_gprs(void)
|
||||
{
|
||||
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
|
||||
|
|
|
@ -1336,7 +1336,7 @@ SINT32 sf_file_send_auto(void) {
|
|||
SINT32 s32ret = 0;
|
||||
SF_FN_PARAM_S stpfncallback = {0};
|
||||
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
|
||||
SINT8 Isfull = 0;
|
||||
// SINT8 Isfull = 0;
|
||||
|
||||
if(SF_FAILURE == sf_check_sd())
|
||||
{
|
||||
|
@ -1348,22 +1348,22 @@ SINT32 sf_file_send_auto(void) {
|
|||
return s32ret;
|
||||
}
|
||||
#endif
|
||||
if(2 == puiPara->SdFailCount)
|
||||
{
|
||||
s32ret = sf_card_log_send_ftp();
|
||||
return s32ret;
|
||||
}
|
||||
// if(2 == puiPara->SdFailCount)
|
||||
// {
|
||||
// s32ret = sf_card_log_send_ftp();
|
||||
// return s32ret;
|
||||
// }
|
||||
return SF_FAILURE;
|
||||
}
|
||||
else if(2 == puiPara->SdFailCount)
|
||||
{
|
||||
sleep(1);
|
||||
s32ret = sf_sd_isfull(&Isfull);
|
||||
if(Isfull)
|
||||
{
|
||||
s32ret = sf_card_log_send_ftp();
|
||||
}
|
||||
}
|
||||
// else if(2 == puiPara->SdFailCount)
|
||||
// {
|
||||
// sleep(1);
|
||||
// s32ret = sf_sd_isfull(&Isfull);
|
||||
// if(Isfull)
|
||||
// {
|
||||
// s32ret = sf_card_log_send_ftp();
|
||||
// }
|
||||
// }
|
||||
|
||||
stpfncallback.pstParam = sf_customer_param_get();
|
||||
stpfncallback.pstaticParam = sf_app_ui_para_get();
|
||||
|
@ -2527,7 +2527,7 @@ void sf_register_net_para_ck(void)
|
|||
{
|
||||
SF_STARTUP_TYPE_E startup = sf_poweron_type_get();
|
||||
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
|
||||
SLOGE("NeedTimeSyncStartUp:%d NetWorkNeedSearch:%d\n", puiPara->NeedTimeSyncStartUp, puiPara->NetWorkNeedSearch);
|
||||
SLOGI("NeedTimeSyncStartUp:%d NetWorkNeedSearch:%d\n", puiPara->NeedTimeSyncStartUp, puiPara->NetWorkNeedSearch);
|
||||
|
||||
switch (startup) {
|
||||
case SF_MCU_STARTUP_DP:
|
||||
|
@ -2553,7 +2553,7 @@ void sf_register_net_para_ck(void)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
SLOGE("NeedTimeSyncStartUp:%d NetWorkNeedSearch:%d\n", puiPara->NeedTimeSyncStartUp, puiPara->NetWorkNeedSearch);
|
||||
SLOGI("NeedTimeSyncStartUp:%d NetWorkNeedSearch:%d\n", puiPara->NeedTimeSyncStartUp, puiPara->NetWorkNeedSearch);
|
||||
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -940,6 +940,7 @@ void sf_power_off(void)
|
|||
sf_power_off_check_format_sd();
|
||||
|
||||
sf_power_off_check_sd();
|
||||
sf_power_off_check_sd_fail();
|
||||
|
||||
sf_power_off_check_gprs();
|
||||
|
||||
|
@ -1530,7 +1531,7 @@ void* sf_app_power_off_thread(void *arg)
|
|||
|
||||
SLOGI("thread run\n");
|
||||
PowerOffTskCfg.IsRun = 1;
|
||||
sleep(5);
|
||||
sleep(10);
|
||||
SLOGE("cdv power off err\n");
|
||||
app_system_poweroff(0);
|
||||
PowerOffTskCfg.IsRun = 0;
|
||||
|
|
|
@ -299,6 +299,7 @@ void sf_app_power_on_para_check_init(void)
|
|||
}
|
||||
puiPara->FristSendDailyAndGps = 1;
|
||||
puiPara->GpsSendFlag = 0;
|
||||
puiPara->SdFileSwitch = 0;
|
||||
memset(puiPara->SimIccid,'\0',sizeof(puiPara->SimIccid));
|
||||
memset(puiPara->ServiceProvider,'\0',sizeof(puiPara->ServiceProvider));
|
||||
}
|
||||
|
@ -314,6 +315,7 @@ void sf_app_power_on_para_check_init(void)
|
|||
}
|
||||
else if(PowerOnMode == SF_MCU_STARTUP_DP)
|
||||
{
|
||||
puiPara->SdFileSwitch = 0;
|
||||
//puiPara->NeedTimeSyncStartUp = 1;
|
||||
// if (puiPara->DailyReportSwitch) {
|
||||
// puiPara->GpsSendFlag = 1; // indicate need send dp file in b power on.
|
||||
|
|
|
@ -1740,6 +1740,7 @@ void sf_power_on_para_check_init(void)
|
|||
}
|
||||
puiPara->FristSendDailyAndGps = 1;
|
||||
puiPara->GpsSendFlag = 0;
|
||||
puiPara->SdFileSwitch = 0;
|
||||
memset(puiPara->SimIccid,'\0',sizeof(puiPara->SimIccid));
|
||||
memset(puiPara->Longitude, 0, sizeof(puiPara->Longitude));
|
||||
memset(puiPara->Latitude, 0, sizeof(puiPara->Latitude));
|
||||
|
@ -1759,7 +1760,7 @@ void sf_power_on_para_check_init(void)
|
|||
}
|
||||
else if(PowerOnMode == PWR_ON_DAILY_REPORT)
|
||||
{
|
||||
|
||||
puiPara->SdFileSwitch = 0;
|
||||
}
|
||||
|
||||
printf("PowerOnMode=%d NeedTimeSyncStartUp=%d NetWorkNeedSearch:%d\n", PowerOnMode, puiPara->NeedTimeSyncStartUp, puiPara->NetWorkNeedSearch);
|
||||
|
|
|
@ -581,6 +581,7 @@ typedef struct _UIMenuUIMenuStoreInfo {
|
|||
CHAR SimIccidA[21];
|
||||
UINT32 SdFailCount;
|
||||
CHAR LiBatteryType;/*Alkaline/NI-MH/LI*/
|
||||
UINT8 SdFileSwitch;
|
||||
|
||||
UINT32 x1;
|
||||
UINT32 x2;
|
||||
|
|
Loading…
Reference in New Issue
Block a user