From 35da120b353b614156f0ed1cf1a7adb51eb86ac4 Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 25 Jul 2023 11:33:09 +0800 Subject: [PATCH 1/5] =?UTF-8?q?1.ftps=E6=B5=8B=E8=AF=95=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h | 6 +++--- .../cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h index 98f0808ce..bf0fcd70a 100644 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h @@ -264,10 +264,10 @@ #define SIFAR_FTP_USERNAME "cameraftp" #define SIFAR_FTP_PASSWORD "camera123456" -#define SIFAR_FTPS_IP "49.51.247.68" +#define SIFAR_FTPS_IP "150.109.112.64" #define SIFAR_FTPS_PORT "21" -#define SIFAR_FTPS_USERNAME "sifarftpsuser" -#define SIFAR_FTPS_PASSWORD "rsHkZJPg" +#define SIFAR_FTPS_USERNAME "ftp_user" +#define SIFAR_FTPS_PASSWORD "Sifar%%123456" #define CUSTOM_FTP_IP "ZnRwLTE1YmVuYWpmZWIuaXNoYXJlaXQubmV0" diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c index 1e85f5516..d2891cf4d 100644 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c @@ -1772,10 +1772,10 @@ void SysResetFlag(void) snprintf((char *)puiPara->FtpPort, sizeof(puiPara->FtpPort), USER_FTP_PORT); snprintf((char *)puiPara->FtpUsr, sizeof(puiPara->FtpUsr), USER_FTP_USERNAME); snprintf((char *)puiPara->FtpPwd, sizeof(puiPara->FtpPwd), USER_FTP_PASSWORD); - snprintf((char *)puiPara->FtpsIp, sizeof(puiPara->FtpsIp), USER_FTP_IP); - snprintf((char *)puiPara->FtpsPort, sizeof(puiPara->FtpsPort), USER_FTP_PORT); - snprintf((char *)puiPara->FtpsUsr, sizeof(puiPara->FtpsUsr), USER_FTP_USERNAME); - snprintf((char *)puiPara->FtpsPwd, sizeof(puiPara->FtpsPwd), USER_FTP_PASSWORD); + snprintf((char *)puiPara->FtpsIp, sizeof(puiPara->FtpsIp), SIFAR_FTPS_IP); + snprintf((char *)puiPara->FtpsPort, sizeof(puiPara->FtpsPort), SIFAR_FTPS_PORT); + snprintf((char *)puiPara->FtpsUsr, sizeof(puiPara->FtpsUsr), SIFAR_FTPS_USERNAME); + snprintf((char *)puiPara->FtpsPwd, sizeof(puiPara->FtpsPwd), SIFAR_FTPS_PASSWORD); //SF_STRCPY(puiPara ->APNGPRS, "3gnet"); #else sf_base64_decode(USER_FTP_IP, (char *)tmpStr); From dbd7ec304fee1cf47b9f8579c4c17003b23e32b8 Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 25 Jul 2023 11:34:12 +0800 Subject: [PATCH 2/5] =?UTF-8?q?1.=E5=85=BC=E5=AE=B9eg915q=E6=B3=A8?= =?UTF-8?q?=E7=BD=91=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/source/sf_app/code/source/4gMng/sf_eg91_sim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c b/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c index 968a2c531..c0e587f81 100644 --- a/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_eg91_sim.c @@ -3335,7 +3335,7 @@ SINT32 sf_net_regist_manual(void) sf_test_code_err(eNetRegLocation, "+CGREG: 0,2"); #endif - if((strstr((const char *)gsmPara, "+CGREG: 0,1") != NULL) || (strstr((const char *)gsmPara, "+CGREG: 0,5") != NULL)) + if((strstr((const char *)gsmPara, "+CGREG: 2,1") != NULL) || (strstr((const char *)gsmPara, "+CGREG: 0,1") != NULL) || (strstr((const char *)gsmPara, "+CGREG: 0,5") != NULL)) { if(PWR_ON_TIME_SYNC == sf_poweron_type_get()) { @@ -3976,7 +3976,7 @@ SINT32 sf_auto_net_reg(void) #endif - if((strstr((const char *)gsmPara, "+CGREG: 0,1") != NULL) || (strstr((const char *)gsmPara, "+CGREG: 0,5") != NULL)) + if((strstr((const char *)gsmPara, "+CGREG: 2,1") != NULL) || (strstr((const char *)gsmPara, "+CGREG: 0,1") != NULL) || (strstr((const char *)gsmPara, "+CGREG: 0,5") != NULL)) { eNetRegLocation = QUECTEL_NETREG_QNWINFO; strcpy((char *)gsmPara, "AT+QNWINFO\r"); From 62801c2e90b9df08fcb988386b58f5f1870b665c Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 25 Jul 2023 11:35:19 +0800 Subject: [PATCH 3/5] =?UTF-8?q?1.=E5=85=BC=E5=AE=B9eg915q=20usb=20net?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/sf_app/code/include/sf_service.h | 2 + .../sf_app/code/source/app/sf_service.c | 120 +++++++++++++++++- 2 files changed, 115 insertions(+), 7 deletions(-) diff --git a/code/application/source/sf_app/code/include/sf_service.h b/code/application/source/sf_app/code/include/sf_service.h index 174eb1838..ad69e8e47 100644 --- a/code/application/source/sf_app/code/include/sf_service.h +++ b/code/application/source/sf_app/code/include/sf_service.h @@ -52,6 +52,8 @@ SINT32 app_t110(void); SINT32 sf_app_to_cardv_capture(void); SINT32 sf_module_reboot_reg_net(void); SINT32 sf_app_to_cardv_hd_ture(void); +int sf_check_eth0(void); +int sf_check_usb0(void); #ifdef __cplusplus #if __cplusplus } diff --git a/code/application/source/sf_app/code/source/app/sf_service.c b/code/application/source/sf_app/code/source/app/sf_service.c index 2599411dd..5b72ca15e 100644 --- a/code/application/source/sf_app/code/source/app/sf_service.c +++ b/code/application/source/sf_app/code/source/app/sf_service.c @@ -148,7 +148,7 @@ static SINT16 app_Qlog_procress(void) { SINT32 sf_USB_net_init(void) { SF_CHAR cmdStr[128] = {0}; char cmdtmp[20] = {0}; - + UINT8 i = 0; int ret = SF_FAILURE; UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); @@ -160,7 +160,7 @@ SINT32 sf_USB_net_init(void) { sprintf(cmdtmp, "/dev/qcqmi0"); } - for (UINT8 i = 0; i < 40; i++) { + for (i = 0; i < 40; i++) { if (access(cmdtmp, F_OK) == SF_SUCCESS) { ret = SF_SUCCESS; printf("usb net ko exist!\r\n"); @@ -171,12 +171,30 @@ SINT32 sf_USB_net_init(void) { } if (ret == SF_SUCCESS) { - system(cmdStr); - if (sf_poweron_type_get() == SF_MCU_STARTUP_RING) { + ret = system(cmdStr); + if(SUCCESS != ret){ + MLOGE("usb net err %d\n",ret); + }else { + for (i = 0; i < 40; i++) { + if(strncmp(puiPara->ModuleVer, GPRS_MODULE_TYPE_EG915Q, 6) == 0){ + ret = sf_check_usb0(); + }else{ + ret = sf_check_eth0(); + } + if (SUCCESS == ret) { + ret = SF_SUCCESS; + MLOGI("usb net ip up\r\n"); + break; + } else { + sleep(1); + } + } + } + /*if (sf_poweron_type_get() == SF_MCU_STARTUP_RING) { sleep(2); } else { sleep(5); - } + }*/ return ret; } @@ -1276,6 +1294,9 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) { s32ret = sf_get_ntp(s32ret); } + sf_4G_usb_net_apn_cfg(pfnParam); + sf_USB_net_init(); + if(sf_get_signal_ready()){ if(SUCCESS != sf_connect_ftps_server()){ printf("[%s:%d]open ftps fail, reconnect\n", __FUNCTION__, __LINE__); @@ -1284,8 +1305,6 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) { } } } - sf_4G_usb_net_apn_cfg(pfnParam); - sf_USB_net_init(); SF_APPCOMM_CHECK_RETURN(s32ret, s32ret); break; @@ -1624,6 +1643,93 @@ SINT32 sf_app_to_cardv_hd_ture(void) { s32ret = sf_share_mem_hd_down(1); return s32ret; } + +int sf_check_eth0(void) +{ + FILE *fp; + int len = 256; + char *output = malloc(len); + + if (output == NULL) { + MLOGE("%s:%d output malloc err\n", __FUNCTION__, __LINE__); + return 1; + } + + fp = popen("ifconfig eth0", "r"); + if (fp == NULL) { + perror("popen"); + free(output); + return 1; + } + fgets(output, len, fp); + if (strstr(output, "eth0") == NULL) { + MLOGI("The network card does not exist\n"); + pclose(fp); + free(output); + return 1; + } + + fgets(output, len, fp); + if (strstr(output, "inet ") == NULL) { + MLOGI("The network card exists, but no IP address has been assigned\n"); + pclose(fp); + free(output); + return 1; + } + + char *ip_address_start = strstr(output, "inet ") + strlen("inet "); + char *ip_address_end = strchr(ip_address_start, ' '); + *ip_address_end = '\0'; + + MLOGI("IP address of network card eth0: %s\n", ip_address_start); + + pclose(fp); + free(output); + return 0; +} +int sf_check_usb0(void) +{ + FILE *fp; + int len = 256; + char *output = malloc(len); + + if (output == NULL) { + MLOGE("%s:%d output malloc err\n", __FUNCTION__, __LINE__); + return 1; + } + + fp = popen("ifconfig usb0", "r"); + if (fp == NULL) { + perror("popen"); + free(output); + return 1; + } + fgets(output, len, fp); + if (strstr(output, "usb0") == NULL) { + MLOGI("The network card does not exist\n"); + pclose(fp); + free(output); + return 1; + } + + fgets(output, len, fp); + if (strstr(output, "inet ") == NULL) { + MLOGI("The network card exists, but no IP address has been assigned\n"); + pclose(fp); + free(output); + return 1; + } + + char *ip_address_start = strstr(output, "inet ") + strlen("inet "); + char *ip_address_end = strchr(ip_address_start, ' '); + *ip_address_end = '\0'; + + MLOGI("IP address of network card usb0: %s\n", ip_address_start); + + pclose(fp); + free(output); + return 0; +} #ifdef __cplusplus #if __cplusplus } From 9776baf171b511fb03d5365acc1984e0e7db19fb Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 25 Jul 2023 14:59:40 +0800 Subject: [PATCH 4/5] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E8=BF=9E=E6=8B=8D?= =?UTF-8?q?=E5=8F=91=E9=80=81=202.=E9=80=82=E9=85=8Deg915q?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/sf_app/code/source/4gMng/sf_ftp.c | 76 +++++++++++-------- 1 file changed, 45 insertions(+), 31 deletions(-) diff --git a/code/application/source/sf_app/code/source/4gMng/sf_ftp.c b/code/application/source/sf_app/code/source/4gMng/sf_ftp.c index 6432326f4..c178a2322 100755 --- a/code/application/source/sf_app/code/source/4gMng/sf_ftp.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_ftp.c @@ -226,7 +226,7 @@ SINT32 sf_ftp_config(UINT8 ssl, UINT8 GprsMode, UINT8 timeout) if(SF_SUCCESS != ret){ sf_sys_status_led_set(SF_LED_SYS_STATE_SEND_FAIL); } - FtpOpenOk = ret; + //FtpOpenOk = ret; return ret; @@ -908,8 +908,7 @@ SINT32 sf_pic_send_ftp(void) timeout = 120; } - printf("NetGeneration:%dG,tempPicSize=%d,piccount=%d,pic=%d\n", pPara->NetGeneration, tempPicSize, piccount, pic); - +#if 0 if((0 == pPara->SendMulti) || (pPara->SendMultishotIndex1) || (SF_MANUAL == sf_get_mode_flag())) { if(SF_FILE_TYPE_PIC_VIDEO == pThumbFileCfg->stfileattr[piccount].enFileTye){ @@ -993,7 +992,8 @@ SINT32 sf_pic_send_ftp(void) piccount++; } } - +#endif + piccount = pThumbFileCfg->filecnt; if(4 == pPara->NetGeneration) { if(piccount >= 2) @@ -1008,17 +1008,26 @@ SINT32 sf_pic_send_ftp(void) piccount = 1; } } + MLOGI("NetGeneration:%dG,tempPicSize=%d,piccount=%d,filecnt=%d\n", pPara->NetGeneration, tempPicSize, piccount, pThumbFileCfg->filecnt); - printf("[%s:%d]piccount=%d\n", __FUNCTION__, __LINE__, piccount); + //printf("[%s:%d]piccount=%d\n", __FUNCTION__, __LINE__, piccount); /* dbg log */ - for(pic = 0; pic < piccount; pic++) +/* for(pic = 0; pic < piccount; pic++) { printf("%s:%d pic:%d ftpFileName:%s filePath:%s fileStr:%s\n", __FUNCTION__, __LINE__, pic, ftpFileName[pic], filePath[pic], fileStr[pic]); } - +*/ for(pic = 0; pic < piccount; pic++) { + if(SF_FILE_TYPE_PIC_VIDEO == pThumbFileCfg->stfileattr[pic].enFileTye){ + sprintf((char *)ftpFileName[pic], "%sV-%s", cameraID, pThumbFileCfg->stfileattr[pic].thumbfileName); + }else{ + sprintf((char *)ftpFileName[pic], "%s%s", cameraID, pThumbFileCfg->stfileattr[pic].thumbfileName); + } + sprintf((char *)filePath[pic], "%s", pThumbFileCfg->stfileattr[pic].thumbfilePath); + printf("%s:%d pic:%d ftpFileName:%s filePath:%s fileStr:%s\n", __FUNCTION__, __LINE__, pic, ftpFileName[pic], filePath[pic], fileStr[pic]); + //ret = sf_simcom_upload_file_to_module(fileStr[pic],ftpFileName[pic]); ret = SF_SUCCESS; @@ -1076,7 +1085,7 @@ SINT32 sf_video_send_ftp(void) fileIndex = sf_check_file_video(); sprintf((char *)ftpFileName, "%s%s", cameraID, pThumbFileCfg->stfileattr[fileIndex].thumbfileName); - sprintf((char *)filePath, "UFS:/%s", pThumbFileCfg->stfileattr[fileIndex].thumbfileName); + sprintf((char *)filePath, "%s", pThumbFileCfg->stfileattr[fileIndex].thumbfilePath); printf("%s:%d ftpFileName:%s filePath:%s videoDir:%s\n", __FUNCTION__, __LINE__, ftpFileName, filePath, videoDir); @@ -1118,7 +1127,7 @@ SINT32 sf_ftp_dailyreport_send(void) printf("%s:%d err create dailyreport file\n", __FUNCTION__, __LINE__); return SF_FAILURE; } - sprintf((char *)filePath, "UFS:/%s", SF_DAILYREPORT_TXT); + sprintf((char *)filePath, "%s", SF_DAILYREPORT_FILENAME); //sprintf((char *)filePath, "UFS:/%s-dr.txt", pPara->ModuleImei); printf("%s:%d filePath:%s\n", __FUNCTION__, __LINE__, filePath); @@ -1126,7 +1135,7 @@ SINT32 sf_ftp_dailyreport_send(void) sf_custom_str_get(customStr); sprintf((char *)uploadFname, "%s-%s-dr.txt",pPara->ModuleImei, customStr); - ret = sf_quectel_upload_file_to_module((UINT8 *)SF_DAILYREPORT_FILENAME, (UINT8 *)SF_DAILYREPORT_TXT); + ret = SF_SUCCESS;//sf_quectel_upload_file_to_module((UINT8 *)SF_DAILYREPORT_FILENAME, (UINT8 *)SF_DAILYREPORT_TXT); if(SF_SUCCESS != ret) { @@ -1252,7 +1261,7 @@ SINT32 sf_send_file_to_ftp(UINT8 mode) { if(smtpUploadPicFlag == 0) { - ret1 = sf_upload_send_files_to_module(1); + ret1 = SF_SUCCESS;//sf_upload_send_files_to_module(1); if(SF_UPLOAD_ERROR_RETRY == ret1) { @@ -1261,7 +1270,7 @@ SINT32 sf_send_file_to_ftp(UINT8 mode) if(ret1 == SF_SUCCESS) { - ret1 = sf_upload_send_files_to_module(1); + ret1 = SF_SUCCESS;//sf_upload_send_files_to_module(1); } } } @@ -1278,7 +1287,7 @@ SINT32 sf_send_file_to_ftp(UINT8 mode) { if(smtpUploadVideoFlag == 0) { - ret1 = sf_upload_send_files_to_module(2); + ret1 = SF_SUCCESS;//sf_upload_send_files_to_module(2); if(SF_UPLOAD_ERROR_RETRY == ret1) { @@ -1287,7 +1296,7 @@ SINT32 sf_send_file_to_ftp(UINT8 mode) if(ret1 == SF_SUCCESS) { - ret1 = sf_upload_send_files_to_module(2); + ret1 = SF_SUCCESS;//sf_upload_send_files_to_module(2); } } } @@ -2264,7 +2273,11 @@ SINT32 sf_connect_ftps_server(void) } ret = sf_ftp_config(ssl, gprsMode, timeout); - + FtpManagerCode result = ftp_service_available(); + if(FTP_MANAGER_SERVICE_AVAILABLE == result) + { + FtpOpenOk = SUCCESS; + } ret = sf_ftp_stop(ssl, gprsMode); //SF_FTP_CONNECT_END: @@ -3296,7 +3309,7 @@ SINT32 sf_hd_ftp_send(void) UINT8 ssl = 0; UINT8 gprsMode = 0; UINT8 timeout = 100; - UINT8 piccount = 1; + UINT8 piccount = 0; UINT8 SendFileTotal = 0; UINT8 battery = 0; UIMenuStoreInfo *pPara = sf_app_ui_para_get(); @@ -3334,13 +3347,13 @@ SINT32 sf_hd_ftp_send(void) if(SF_SUCCESS == ret1) { - while((sf_app_while_flag()) && (((piccount+1) <= SendFileTotal)) && ((pPara->GprsMode == 1) || ((pSifarPara->subscribeSendCnt < SUBSCRIBE_SEND_MAX_NUM) && (pPara->GprsMode != 1)))) + while((sf_app_while_flag()) && (((piccount) < SendFileTotal)) && ((pPara->GprsMode == 1) || ((pSifarPara->subscribeSendCnt < SUBSCRIBE_SEND_MAX_NUM) && (pPara->GprsMode != 1)))) { snprintf((char *)ftpFileName, sizeof(ftpFileName), "W%03d%04d.JPG", fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); snprintf((char *)filePath, sizeof(filePath), "%s/%s", SF_HD_DIR, ftpFileName); sf_set_del_flag(FALSE); - ret1 = sf_quectel_upload_file_to_module(filePath, ftpFileName); + ret1 = SF_SUCCESS;//sf_quectel_upload_file_to_module(filePath, ftpFileName); if(SF_UPLOAD_ERROR_RETRY == ret1) { @@ -3349,18 +3362,18 @@ SINT32 sf_hd_ftp_send(void) if(ret1 == SF_SUCCESS) { - ret1 = sf_quectel_upload_file_to_module(filePath, ftpFileName); + ret1 = SF_SUCCESS;//sf_quectel_upload_file_to_module(filePath, ftpFileName); } } battery = sf_app_get_battery(); memset(cameraID, '\0', sizeof(cameraID)); memset(ftpFileName, '\0', sizeof(ftpFileName)); - memset(filePath, '\0', sizeof(filePath)); + //memset(filePath, '\0', sizeof(filePath)); snprintf(cameraID, sizeof(cameraID), "%s-%d-%d-%s-", pPara->ModuleImei, battery, csqlevel, CamNameStr); snprintf((char *)ftpFileName, sizeof(ftpFileName), "%sHD-W%03d%04d.JPG", cameraID, fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); - snprintf((char *)filePath, sizeof(filePath), "UFS:/W%03d%04d.JPG", fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); + //snprintf((char *)filePath, sizeof(filePath), "UFS:/W%03d%04d.JPG", fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); printf("%s:%d ftpFileName:%s filePath:%s\n", __FUNCTION__, __LINE__, ftpFileName, filePath); @@ -3424,7 +3437,7 @@ SF_HD_END: //pSifarPara->sendThumbnailTimeCount += sendEndTime - sendStartTime; printf("[%s:%d] : sendStartTime:%d sendEndTime:%d\n\n", __FUNCTION__, __LINE__, sendStartTime, sendEndTime); - if(!(((piccount+1) <= SendFileTotal) && ((pSifarPara->picSendMax < pPara->SendMaxNum) || (pPara->SendMaxNum == 0)))) + if(!(((piccount) <= SendFileTotal) && ((pSifarPara->picSendMax < pPara->SendMaxNum) || (pPara->SendMaxNum == 0)))) { sf_delete_send_flie_list(); } @@ -3511,7 +3524,7 @@ SINT32 sf_video_ftp_send(void) UINT8 ssl = 0; UINT8 gprsMode = 0; UINT8 timeout = 100; - UINT8 piccount = 1; + UINT8 piccount = 0; UINT8 SendFileTotal = 0; UINT8 battery = 0; UIMenuStoreInfo *pPara = sf_app_ui_para_get(); @@ -3550,7 +3563,7 @@ SINT32 sf_video_ftp_send(void) if(SF_SUCCESS == ret1) { - while((sf_app_while_flag()) && (((piccount+1) <= SendFileTotal)) && ((pPara->GprsMode == 1) || ((pSifarPara->subscribeVideoSendCnt < SUBSCRIBE_VIDEO_SEND_MAX_NUM) && (pPara->GprsMode != 1)))) + while((sf_app_while_flag()) && (((piccount) < SendFileTotal)) && ((pPara->GprsMode == 1) || ((pSifarPara->subscribeVideoSendCnt < SUBSCRIBE_VIDEO_SEND_MAX_NUM) && (pPara->GprsMode != 1)))) { snprintf((char *)ftpFileName, sizeof(ftpFileName), "W%03d%04d.MP4", fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); //snprintf((char *)filePath, sizeof(filePath), "%s/%s", SF_HD_DIR, ftpFileName); @@ -3564,7 +3577,7 @@ SINT32 sf_video_ftp_send(void) } sf_set_del_flag(FALSE); - ret1 = sf_quectel_upload_file_to_module(filePath, ftpFileName); + ret1 = SF_SUCCESS;//sf_quectel_upload_file_to_module(filePath, ftpFileName); if(SF_UPLOAD_ERROR_RETRY == ret1) { @@ -3573,18 +3586,18 @@ SINT32 sf_video_ftp_send(void) if(ret1 == SF_SUCCESS) { - ret1 = sf_quectel_upload_file_to_module(filePath, ftpFileName); + ret1 = SF_SUCCESS;//sf_quectel_upload_file_to_module(filePath, ftpFileName); } } battery = sf_app_get_battery(); memset(cameraID, '\0', sizeof(cameraID)); memset(ftpFileName, '\0', sizeof(ftpFileName)); - memset(filePath, '\0', sizeof(filePath)); + //memset(filePath, '\0', sizeof(filePath)); snprintf(cameraID, sizeof(cameraID), "%s-%d-%d-%s-", pPara->ModuleImei, battery, csqlevel, CamNameStr); - snprintf((char *)ftpFileName, sizeof(ftpFileName), "%s-W%03d%04d.MP4", cameraID, fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); + snprintf((char *)ftpFileName, sizeof(ftpFileName), "%sW%03d%04d.MP4", cameraID, fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); - snprintf((char *)filePath, sizeof(filePath), "UFS:/W%03d%04d.MP4", fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); + //snprintf((char *)filePath, sizeof(filePath), "UFS:/W%03d%04d.MP4", fileCfg->stfileattr[piccount].dirKey, fileCfg->stfileattr[piccount].fileKey); printf("%s:%d ftpFileName:%s filePath:%s\n", __FUNCTION__, __LINE__, ftpFileName, filePath); @@ -3715,14 +3728,15 @@ SINT32 sf_log_send_ftp(void) if(SF_SUCCESS == ret) { - sprintf((char *)filePath, "UFS:/%s", SF_LOG_TXT); + //sprintf((char *)filePath, "UFS:/%s", SF_LOG_TXT); + sprintf((char *)filePath, "%s", LOG_AT_FILE_PATH); printf("%s:%d filePath:%s\n", __FUNCTION__, __LINE__, filePath); sf_custom_str_get(customStr); sprintf((char *)uploadFname, "%s-%s-log.txt",pPara->ModuleImei, customStr); - ret = sf_quectel_upload_file_to_module((UINT8 *)LOG_AT_FILE_PATH, (UINT8 *)SF_LOG_TXT); + ret = SF_SUCCESS;//sf_quectel_upload_file_to_module((UINT8 *)LOG_AT_FILE_PATH, (UINT8 *)SF_LOG_TXT); if(SF_SUCCESS != ret) { From cf56097085a676f5f084cd6651b2b54f285103bd Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 25 Jul 2023 15:02:24 +0800 Subject: [PATCH 5/5] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=202.?= =?UTF-8?q?=E9=80=82=E9=85=8Deg915q=203.=E4=BF=AE=E5=A4=8Drtos=E4=B8=8B?= =?UTF-8?q?=E8=BF=9E=E6=8B=8D=E5=8F=91=E9=80=81=E9=97=AE=E9=A2=98=204.?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=90=8E=E4=BF=9D=E5=AD=98=E5=8F=82=E6=95=B0?= =?UTF-8?q?(=E5=8D=87=E7=BA=A7=E5=90=8E=E4=BF=9D=E5=AD=98=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=AD=98=E5=9C=A8=E5=81=B6=E5=8F=91bug=E6=9C=AA?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/sf_app/code/source/4gMng/sf_sms.c | 24 +++++++++++++------ .../source/sf_app/code/source/app/sf_app.c | 3 ++- .../source/sf_app/code/source/app/sf_dbg.c | 2 +- .../sifar/code/source/common/sf_common.c | 1 + .../cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c | 6 ++--- rtos/code/driver/na51089/source/mcu/sf_mcu.c | 9 ++++--- 6 files changed, 30 insertions(+), 15 deletions(-) diff --git a/code/application/source/sf_app/code/source/4gMng/sf_sms.c b/code/application/source/sf_app/code/source/4gMng/sf_sms.c index 7c0623e8f..546bc3c91 100644 --- a/code/application/source/sf_app/code/source/4gMng/sf_sms.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_sms.c @@ -1455,7 +1455,8 @@ SINT32 sf_sms_read_message(void) if(strstr((const char *)gsmPara, "$")) { strtok((char *)gsmPara, "$"); - strcpy((char *)strok, strtok(NULL, "$")); + //strcpy((char *)strok, strtok(NULL, "$")); + snprintf((char *)strok, sizeof(strok), "%s", strtok(NULL, "$")); //printf("strok:%s\n", strok); } @@ -1468,7 +1469,8 @@ SINT32 sf_sms_read_message(void) while(temp != 0) { - strcpy((char *)strValue[mm], (const char *)temp); + //strcpy((char *)strValue[mm], (const char *)temp); + snprintf((char *)strValue[mm], sizeof(strValue[mm]), "%s", temp); printf("strValue[%d]:%s\n", mm, strValue[mm]); mm++; temp = (UINT8 *)strsep(&pStr, "#"); @@ -1752,6 +1754,8 @@ SINT32 sf_check_message(void) UINT8 location = MMS_ATCMGL1; SF_PDT_PARAM_STATISTICS_S *pSifarPara = sf_statistics_param_get(); SINT32 ttyRet = 0; + char strtmp[20] = {0}; + UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); printf("%s:%d s\n", __FUNCTION__, __LINE__); @@ -1766,6 +1770,12 @@ SINT32 sf_check_message(void) } } + if(strncmp(puiPara->ModuleVer, GPRS_MODULE_TYPE_EG915Q, 6) == 0){ + sprintf(strtmp, "sms/listmsgmap"); + }else { + sprintf(strtmp, "SMS/ListMsgMap"); + } + strcpy((char *)gsmPara, "AT+QCFG=\"sms/listmsgmap\",\"REC UNREAD\"\r"); ttyRet = sf_hal_ttyusb2_write(gsmPara, strlen((const char *)gsmPara)); SF_CHECK_RETURN(ttyRet, SF_GPRS_MODULE_ERROR_WRITE); @@ -1839,7 +1849,7 @@ SINT32 sf_check_message(void) case MMS_ATCMGL1: - if(strstr((const char *)gsmPara, "SMS/ListMsgMap")) + if(strstr((const char *)gsmPara, strtmp)) { char *temp = NULL; char *delim;// @@ -2118,7 +2128,7 @@ void sf_hd_pic_list_print(void) struct stat st_buffer; char sendListName[64] = {0}; char buff[SF_SEND_LIST_ITEM_LENGTH+1] = {0}; - SubImgList_t *pList = pSubImgListHead; + SubImgList_t *pList = pSubImgListHead->pNext; printf("[%s:%d] print list:\n", __FUNCTION__, __LINE__); SF_HDFILE_ATTR_S* fileCfg = sf_file_hd_cfg_get(); @@ -2225,17 +2235,17 @@ void sf_video_add_to_list(UINT8 *fileName) *************************************************/ void sf_video_list_print(void) { - UINT8 i = 0; + //UINT8 i = 0; SF_HDFILE_ATTR_S* fileCfg = sf_file_video_cfg_get(); - SubImgList_t *pList = pSubVideoListHead; + SubImgList_t *pList = pSubVideoListHead->pNext; printf("[%s:%d] print list:\n", __FUNCTION__, __LINE__); while(pList != NULL) { fileCfg->stfileattr[fileCfg->filecnt].dirKey = pList->dirKey; fileCfg->stfileattr[fileCfg->filecnt].fileKey = pList->fileKey; fileCfg->filecnt += 1; + printf("filecnt:%d f:%d,%d\n", fileCfg->filecnt, pList->dirKey, pList->fileKey); pList = pList->pNext; - printf("ID:%d f:%d,%d\n", i++, pList->dirKey, pList->fileKey); } } diff --git a/code/application/source/sf_app/code/source/app/sf_app.c b/code/application/source/sf_app/code/source/app/sf_app.c index 73aecf1db..f126cc37e 100644 --- a/code/application/source/sf_app/code/source/app/sf_app.c +++ b/code/application/source/sf_app/code/source/app/sf_app.c @@ -51,6 +51,7 @@ #include "sf_keymng.h" #include "sf_wifi_svr.h" #include "sf_battery.h" +#include "ftp_manager.h" //#include //#include //#include @@ -289,7 +290,7 @@ int main(int argc, char *argv[]) sf_com_message_send_to_cardv(&stMessageBuf); }*/ - + ftp_manager_uninit(); sf_share_mem_file_deinit(); sf_share_mem_customer_deinit(); SF_MUTEX_DESTROY(Param_mutexLock); diff --git a/code/application/source/sf_app/code/source/app/sf_dbg.c b/code/application/source/sf_app/code/source/app/sf_dbg.c index 0363ca194..9c56b6aaa 100644 --- a/code/application/source/sf_app/code/source/app/sf_dbg.c +++ b/code/application/source/sf_app/code/source/app/sf_dbg.c @@ -955,7 +955,7 @@ SINT32 app_debug_signal(SINT32 argc, SF_CHAR **argv[]) } SINT8 nValue = 0; - SINT8 mValue = 0; + int mValue = 0; if(strstr((SF_CHAR*)argv[1], "3g")) { nValue = 3; mValue = atoi((SF_CHAR*)argv[2]); diff --git a/code/lib/source/sifar/code/source/common/sf_common.c b/code/lib/source/sifar/code/source/common/sf_common.c index b91d8b0fa..0781a770b 100644 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -2024,6 +2024,7 @@ void* sf_sys_do_upgrade(void *arg) } else { SysResetFlag(); + Save_MenuInfo(); //sync(); } sf_mcu_reg_set(SF_MCU_SOFT_UPDATE, 1); diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c index f42a2b9dc..a5c225572 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c @@ -1428,15 +1428,15 @@ THREAD_RETTYPE PhotoFast_FlowPreviewThread(void *arg) UINT32 period = 0; #if HUNTING_CAMERA_MCU == ENABLE - if(1 == puiPara->MultiShotIntevel) + if(SF_MULTISHOT_INTEVEL_1S == puiPara->MultiShotIntevel) { period = 1000;//The interval between consecutive shots of each photo is 1 second } - else if(2 == puiPara->MultiShotIntevel) { + else if(SF_MULTISHOT_INTEVEL_2S == puiPara->MultiShotIntevel) { period = 2000;//The interval between consecutive shots of each photo is 2 second } else { - period = 1000 / max_cnt; + period = 1000 / max_cnt;//SF_MULTISHOT_INTEVEL_0S } #else period = 1000 / max_cnt; diff --git a/rtos/code/driver/na51089/source/mcu/sf_mcu.c b/rtos/code/driver/na51089/source/mcu/sf_mcu.c index 19180f944..d6e3ff917 100644 --- a/rtos/code/driver/na51089/source/mcu/sf_mcu.c +++ b/rtos/code/driver/na51089/source/mcu/sf_mcu.c @@ -2152,9 +2152,10 @@ void sf_file_thumb_cfg_sava(void) if (pThumbFileCfg != NULL) { for(fileIndex = 0; fileIndex < pThumbFileCfg->filecnt; fileIndex++) { - if((fileIndex == 0) || (puiPara->SendMulti == 1)) + if((0 == fileIndex) || ((1 == puiPara->SendMulti))){ sf_add_file_name_to_send_list(pThumbFileCfg->stfileattr[fileIndex].thumbfileName); - printf("%s:%d thumbfileSize:%ld thumbfileName:%s thumbfilePath:%s\n", __FUNCTION__, __LINE__,pThumbFileCfg->stfileattr[fileIndex].thumbfileSize,pThumbFileCfg->stfileattr[fileIndex].thumbfileName,pThumbFileCfg->stfileattr[fileIndex].thumbfilePath); + printf("%s:%d thumbfileSize:%ld thumbfileName:%s thumbfilePath:%s\n", __FUNCTION__, __LINE__,pThumbFileCfg->stfileattr[fileIndex].thumbfileSize,pThumbFileCfg->stfileattr[fileIndex].thumbfileName,pThumbFileCfg->stfileattr[fileIndex].thumbfilePath); + } } //printf("%s:%d e Size:%ld\n", __FUNCTION__, __LINE__,pThumbFileCfg->stfileattr[fileIndex].thumbfileSize); free(pThumbFileCfg); @@ -2174,6 +2175,7 @@ void sf_add_file_name_to_send_list(char *sendfname) char sendListName[64] = {0}; char buff[SF_SEND_LIST_ITEM_LENGTH+1] = {0}; int fd = 0; + static int flag = 0; struct stat st; UIMenuStoreInfo *puiPara = sf_ui_para_get(); #if SF_IQ_TEST != ENABLE @@ -2196,12 +2198,13 @@ void sf_add_file_name_to_send_list(char *sendfname) //printf("Add %s to send.List\n", sendfname); if(0 == puiPara->SendType){ snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_AUTO); - if(access(sendListName, F_OK) == 0) + if((access(sendListName, F_OK) == 0) && (0 == flag)) { if (FileSys_DeleteFile(sendListName) != FST_STA_OK) { DBG_IND("Ignore deleting file.\r\n"); } } + flag = 1; }else { snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_LIST);