1.修改lpa

This commit is contained in:
payton 2024-01-15 14:36:21 +08:00
parent eccecf2618
commit 1539965212
7 changed files with 46 additions and 50 deletions

View File

@ -271,6 +271,8 @@
#define DEFAULT_PIC_UP_DAILY_REPORT SF_OFF #define DEFAULT_PIC_UP_DAILY_REPORT SF_OFF
#define DEFAULT_BLU_SWITCH SF_ON #define DEFAULT_BLU_SWITCH SF_ON
#define DEFAULT_WIFI_SWITCH SF_ON #define DEFAULT_WIFI_SWITCH SF_ON
#define DEFAULT_UPDATEFLG_SWITCH SF_ON
#define SIFAR_FTP_IP "119.23.174.139" #define SIFAR_FTP_IP "119.23.174.139"
#define SIFAR_FTP_PORT "21" #define SIFAR_FTP_PORT "21"
#define SIFAR_FTP_USERNAME "cameraftp" #define SIFAR_FTP_USERNAME "cameraftp"

View File

@ -1793,6 +1793,8 @@ void SysResetFlag(void)
puiPara->PicUpDailyReport = DEFAULT_PIC_UP_DAILY_REPORT; puiPara->PicUpDailyReport = DEFAULT_PIC_UP_DAILY_REPORT;
puiPara->BluSwitch = DEFAULT_BLU_SWITCH; puiPara->BluSwitch = DEFAULT_BLU_SWITCH;
puiPara->WifiSwitch = DEFAULT_WIFI_SWITCH; puiPara->WifiSwitch = DEFAULT_WIFI_SWITCH;
puiPara->UpdateFlg = DEFAULT_UPDATEFLG_SWITCH;
if(puiPara->ModuleImei[0] != '\0') if(puiPara->ModuleImei[0] != '\0')
{ {
puiPara->DailyReportTime.Hour = ((UINT16)(puiPara->ModuleImei[11]-48)*10+(puiPara->ModuleImei[12]-48))%12; puiPara->DailyReportTime.Hour = ((UINT16)(puiPara->ModuleImei[11]-48)*10+(puiPara->ModuleImei[12]-48))%12;

View File

@ -226,5 +226,6 @@ time_t sf_time (time_t *__timer);
SINT32 sf_gps_send_ftp(void); SINT32 sf_gps_send_ftp(void);
SINT32 sf_test_send_file_to_ftp(void); SINT32 sf_test_send_file_to_ftp(void);
SINT32 sf_card_log_send_ftp(void); SINT32 sf_card_log_send_ftp(void);
SINT32 sf_ftp_lpa_log_send(void);
#endif /*_SF_FTP_H_*/ #endif /*_SF_FTP_H_*/

View File

@ -3633,6 +3633,26 @@ SINT32 sf_net_regist_manual(void)
ttyData.cmp = "OK"; ttyData.cmp = "OK";
ttyData.len = strlen(gsmPara) + 2; ttyData.len = strlen(gsmPara) + 2;
} }
else if((strstr((const char *)gsmPara, "+CGREG: 0,3") != NULL))
{
if(callTime > 3)
{
ret = SF_SIM_ERROR_REG_NET_REFUSE;
printf("[%s:%d]AT+CGREG? REG_NET_REFUSE.\n", __FUNCTION__, __LINE__);
SLOGE(gsmPara);
sprintf((char *)logStr, "AT+CGREG? REG_NET_REFUSE,Error Code:0x%08X\n", ret);
SLOGE(logStr);
goto SF_NET_REG_END;
}
else
{
sprintf((char *)gsmPara, "AT+CGREG?\r");
ttyRet = sf_hal_ttyusb2_write(gsmPara, strlen((const char *)gsmPara));
SF_CHECK_RETURN(ttyRet, SF_GPRS_MODULE_ERROR_WRITE);
sf_sleep_ms(300);
}
callTime++;
}
else else
{ {
//callTime--; //callTime--;

View File

@ -52,6 +52,7 @@ extern "C" {
#include "ftp_manager.h" #include "ftp_manager.h"
#include "sf_system.h" #include "sf_system.h"
#include "curl/curl.h" #include "curl/curl.h"
#include "sf_4G_sms_lpa_cmd.h"
/************************************************************************** /**************************************************************************
* C O N S T A N T S * * C O N S T A N T S *
**************************************************************************/ **************************************************************************/
@ -1099,20 +1100,17 @@ SINT32 sf_ftp_lpa_log_send(void)
{ {
SINT32 ret = SF_SUCCESS; SINT32 ret = SF_SUCCESS;
//UINT8 CamNameStr[20] = { 0 }; //UINT8 CamNameStr[20] = { 0 };
UINT8 uploadFname[64] = { 0 }; //UINT8 uploadFname[64] = { 0 };
UINT8 lpaFile[64] = { 0 }; UINT8 lpaFile[64] = { 0 };
UINT8 filePath[64] = { 0 }; UINT8 filePath[64] = { 0 };
int timeout = 60000; int timeout = 60000;
UIMenuStoreInfo *pPara = sf_app_ui_para_get();
SF_PDT_PARAM_STATISTICS_S *pSifarPara = sf_statistics_param_get();
MLOGD("start\n"); MLOGD("start\n");
printf("%s:%d filePath:%s\n", __FUNCTION__, __LINE__, filePath); printf("%s:%d filePath:%s\n", __FUNCTION__, __LINE__, filePath);
sprintf(lpaFile, "%s", sf_sms_lpa_log_file_name_get()); sprintf((char *)lpaFile, "%s", sf_sms_lpa_log_file_name_get());
sprintf(uploadFname, "%s/%s", SF_LPA_LOG_FILE_PATH, lpaFile); sprintf((char *)filePath, "%s%s", SF_LPA_LOG_FILE_PATH, lpaFile);
ret = SF_SUCCESS; ret = sf_ftp_config(0, 0, timeout);
if(SF_SUCCESS != ret) if(SF_SUCCESS != ret)
{ {
@ -1120,30 +1118,12 @@ SINT32 sf_ftp_lpa_log_send(void)
} }
else else
{ {
ret = sf_ftp_send(uploadFname, filePath, timeout); ret = sf_ftp_send(lpaFile, filePath, timeout);
if(SF_SUCCESS != ret) if(SF_SUCCESS != ret)
{ {
printf("%s:%d err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath); printf("%s:%d err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath);
}else {
DailyReportFtpSendSucess = 1;
pSifarPara->picSendCount = 0;
pSifarPara->sendThumbnailCount = 0;
pSifarPara->picSendSucessCount = 0;
pSifarPara->picSendTimeoutCount = 0;
pSifarPara->picSendFailCount = 0;
pSifarPara->sendThumbnailFailCount = 0;
pSifarPara->picSendTimeCount = 0;
pSifarPara->sendThumbnailTimeCount = 0;
pSifarPara->TirgNum=0;
pSifarPara->NewFlieCount=0;
pSifarPara->videoSendCount = 0;
pSifarPara->videoSendTimeCount = 0;
pSifarPara->videoSendFailCount = 0;
pSifarPara->videoSendSucessCount = 0;
pSifarPara->SendlowPowerWarnCnt = 0;
} }
sf_dailyReport_set();
} }
MLOGD(" end ret:[0x%08X]\n", ret); MLOGD(" end ret:[0x%08X]\n", ret);
@ -1164,20 +1144,12 @@ SINT32 sf_ftp_dailyreport_send(void)
MLOGD("start\n"); MLOGD("start\n");
char *dp_filename = sf_root_path_strcat(SF_DAILYREPORT_FILENAME);
if(dp_filename == NULL)
{
free(dp_filename);
return SF_FAILURE;
}
if(SUCCESS != sf_create_dailyreport_file()) if(SUCCESS != sf_create_dailyreport_file())
{ {
printf("%s:%d err create dailyreport file\n", __FUNCTION__, __LINE__); printf("%s:%d err create dailyreport file\n", __FUNCTION__, __LINE__);
return SF_FAILURE; return SF_FAILURE;
} }
sprintf((char *)filePath, "%s", dp_filename); sprintf((char *)filePath, "%s", SF_DAILYREPORT_FILENAME);
free(dp_filename);
//sprintf((char *)filePath, "UFS:/%s-dr.txt", pPara->ModuleImei); //sprintf((char *)filePath, "UFS:/%s-dr.txt", pPara->ModuleImei);
printf("%s:%d filePath:%s\n", __FUNCTION__, __LINE__, filePath); printf("%s:%d filePath:%s\n", __FUNCTION__, __LINE__, filePath);
@ -1553,7 +1525,7 @@ SINT32 sf_connect_ftps_server(void)
*************************************************/ *************************************************/
SINT32 sf_camera_ota_ftp(void) SINT32 sf_camera_ota_ftp(void)
{ {
char Cmd[128] = {0}; //char Cmd[128] = {0};
UIMenuStoreInfo *pPara = sf_app_ui_para_get(); UIMenuStoreInfo *pPara = sf_app_ui_para_get();
SINT32 ret = SF_SUCCESS; SINT32 ret = SF_SUCCESS;
FtpSslFlag ssl_flag = FTP_SSL_FLAG_END; FtpSslFlag ssl_flag = FTP_SSL_FLAG_END;

View File

@ -1286,7 +1286,7 @@ UINT8 sf_message_data_processing(UINT8 strValue[30][32], UINT16 mm, UINT8 *sms_s
UINT8 sf_poweroff_check_lpa_excute_cmd() UINT8 sf_poweroff_check_lpa_excute_cmd(void)
{ {
//sf_mcu_watchdog_set(5); //sf_mcu_watchdog_set(5);
sf_sms_lpa_download_command_add_to_list(); sf_sms_lpa_download_command_add_to_list();
@ -1295,12 +1295,12 @@ UINT8 sf_poweroff_check_lpa_excute_cmd()
{ {
sf_sms_lpa_set_send_lpa_log_flg(FALSE); sf_sms_lpa_set_send_lpa_log_flg(FALSE);
// to do: send lpa log // to do: send lpa log
//sf_ftp_txt_file_send(FTP_FILE_LPA_LOG); sf_ftp_lpa_log_send();
} }
return 0; return 0;
} }
UINT8 sf_poweroff_check_lpa_enable_profile() UINT8 sf_poweroff_check_lpa_enable_profile(void)
{ {
if(sf_sms_lpa_is_need_enable_profile()) if(sf_sms_lpa_is_need_enable_profile())
{ {
@ -1312,7 +1312,7 @@ UINT8 sf_poweroff_check_lpa_enable_profile()
sf_sms_lpa_set_send_lpa_log_flg(FALSE); sf_sms_lpa_set_send_lpa_log_flg(FALSE);
// to do: send lpa log // to do: send lpa log
//sf_ftp_txt_file_send(FTP_FILE_LPA_LOG); sf_ftp_lpa_log_send();
printf("enter send LPA LOG\n"); printf("enter send LPA LOG\n");
} }
@ -1322,7 +1322,7 @@ UINT8 sf_poweroff_check_lpa_enable_profile()
///sf_set_netsearch_step(SIM_NETSEARCH_STEP_IDLE); ///sf_set_netsearch_step(SIM_NETSEARCH_STEP_IDLE);
//to do: poweroff 4G MODELU power off, a reboot //to do: poweroff 4G MODELU power off, a reboot
//sf_set_poweroff_type(SF_POWEROFF_SYNC_PARAM); sf_cmd_camera_restart(1);
return 0; return 0;
} }
} }
@ -1337,13 +1337,13 @@ UINT8 sf_sms_content_parse(SF_CHAR *smsStr)
UINT16 smsCnt = 0; UINT16 smsCnt = 0;
UINT8 ret; UINT8 ret;
SF_SMS_LPA_CMD_T *pLpaCmd = NULL; SF_SMS_LPA_CMD_T *pLpaCmd = NULL;
UIMenuStoreInfo *sfParam = sf_app_ui_para_get(); //UIMenuStoreInfo *sfParam = sf_app_ui_para_get();
SF_PDT_PARAM_STATISTICS_S *sfStat = sf_statistics_param_get(); //SF_PDT_PARAM_STATISTICS_S *sfStat = sf_statistics_param_get();
if(strlen(smsStr) > 0) if(strlen(smsStr) > 0)
{ {
lpaCmdStr = SF_STRSTR(smsStr, "$R0e*"); lpaCmdStr = strstr(smsStr, "$R0e*");
if(lpaCmdStr == NULL) if(lpaCmdStr == NULL)
{ {
smsCnt = 0; smsCnt = 0;

View File

@ -1496,7 +1496,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
usleep(100*1000); usleep(100*1000);
} }
// to do: 首次升级之后需要删除LPA log //to do: 首次升级之后需要删除LPA log
if(!sf_is_esim_card() || pCustomerParam->UpdateFlg) if(!sf_is_esim_card() || pCustomerParam->UpdateFlg)
{ {
if(pCustomerParam->UpdateFlg) if(pCustomerParam->UpdateFlg)
@ -1757,7 +1757,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
usleep(100*1000); usleep(100*1000);
} }
//to do:首次烧录后删除lpa log //to do:首次烧录后删除lpa log
if(!sf_is_esim_card() || pCustomerParam->UpdateFlg) if(!sf_is_esim_card() || pCustomerParam->UpdateFlg)
{ {
if(pCustomerParam->UpdateFlg) if(pCustomerParam->UpdateFlg)
@ -1807,7 +1807,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
snprintf((char *)pCustomerParam->SimIccidV, sizeof(pCustomerParam->SimIccidV), (char *)simIccidTmp[0]); snprintf((char *)pCustomerParam->SimIccidV, sizeof(pCustomerParam->SimIccidV), (char *)simIccidTmp[0]);
snprintf((char *)pCustomerParam->SimIccidA, sizeof(pCustomerParam->SimIccidA), (char *)simIccidTmp[1]); snprintf((char *)pCustomerParam->SimIccidA, sizeof(pCustomerParam->SimIccidA), (char *)simIccidTmp[1]);
// to do: 注网收到0,3的返回时返回SF_SIM_ERROR_REG_NET_REFUSE // to do: 注网收到0,3的返回时返回SF_SIM_ERROR_REG_NET_REFUSE
s32ret = sf_4G_register_net_manual(pfnParam); s32ret = sf_4G_register_net_manual(pfnParam);
if(pCustomerParam->ProfileSwitchFlg) if(pCustomerParam->ProfileSwitchFlg)
@ -1880,8 +1880,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
//to do :profile,reboot regnet,than send lpa log;log is exist //to do :profile,reboot regnet,than send lpa log;log is exist
if(sf_sms_lpa_is_need_send_lpa_log()) if(sf_sms_lpa_is_need_send_lpa_log())
{ {
//tp_txt_file_send(FTP_FILE_LPA_LOG); sf_ftp_lpa_log_send();
} }
break; break;
case SF_MCU_STARTUP_SYN_PARAM: case SF_MCU_STARTUP_SYN_PARAM:
@ -1909,7 +1908,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
sf_USB_net_init(); sf_USB_net_init();
//to do : send lpa direct //to do : send lpa direct
//_ftp_txt_file_send(FTP_FILE_LPA_LOG); sf_ftp_lpa_log_send();
if ((SF_ON == pCustomerParam->GpsSwitch) || (pCustomerParam->FristSendDailyAndGps)) if ((SF_ON == pCustomerParam->GpsSwitch) || (pCustomerParam->FristSendDailyAndGps))
{ {