From 8a68dab79b7c1fa989d68349a8bf53d2ee957618 Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 19 Dec 2023 10:45:38 +0800 Subject: [PATCH 01/11] =?UTF-8?q?1.wifi=E7=82=B9=E5=87=BB=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E6=A8=A1=E5=BC=8F=E5=86=8D=E5=B7=A5=E4=BD=9C=E8=BF=87?= =?UTF-8?q?=E7=A8=8B=E4=B8=AD=E4=B8=8D=E5=88=87=E6=8D=A2=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SrcCode/UIApp/Photo/UIAppPhoto_Exe.c | 10 ++--- .../UIFlowMovie/UIFlowMovieEventCallback.c | 16 +++---- .../sf_app/code/source/wifi/sf_wifi_svr.c | 42 +++++++++---------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c b/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c index 4dd80a36a..c0740a58b 100755 --- a/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c +++ b/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto_Exe.c @@ -6818,22 +6818,22 @@ INT32 PhotoExe_Preview_SliceEncode_CB3(void* user_data) FileSys_CloseFile(fp); #if HUNTING_CAMERA_MCU == ENABLE char tmp2[64] = {'\0'}; - UIMenuStoreInfo *puiPara = sf_ui_para_get(); + //UIMenuStoreInfo *puiPara = sf_ui_para_get(); memset(tmp, '\0', sizeof(tmp)); SF_FILE_TYPE_E enFileType = 0; - if(SF_CAM_MODE_PHOTO == puiPara->CamMode){ + if(SF_CAM_MODE_PHOTO == sf_get_cammode_statu()){ enFileType = SF_FILE_TYPE_PIC_SMALL; - }else if(SF_CAM_MODE_PHOTO_VIDEO == puiPara->CamMode){ + }else if(SF_CAM_MODE_PHOTO_VIDEO == sf_get_cammode_statu()){ enFileType = SF_FILE_TYPE_PIC_VIDEO; } - else if(SF_CAM_MODE_VIDEO2 == puiPara->CamMode){ + else if(SF_CAM_MODE_VIDEO2 == sf_get_cammode_statu()){ enFileType = SF_FILE_TYPE_PIC_VIDEO; } snprintf(tmp, sizeof(tmp), "%sW%s%s.JPG", SF_SEND_LIST_DIR, folder, number); /* DCF 8.3 naming rule */ snprintf(tmp2, sizeof(tmp2), "W%s%s.JPG", folder, number); /* DCF 8.3 naming rule */ DBG_DUMP("PHOTO THUMB %s \n %s\n", tmp, tmp2); sf_file_thumb_cfg_fill(tmp, tmp2, queue_ele_in->jpg_thumb_size, enFileType); - if((!sf_get_mode_flag()) || ((FALSE == sf_check_net_work_flag()) && (0 < sf_cardv_get_cq_signal()) && (SF_CAM_MODE_PHOTO == puiPara->CamMode))) + if((!sf_get_mode_flag()) || ((FALSE == sf_check_net_work_flag()) && (0 < sf_cardv_get_cq_signal()) && (SF_CAM_MODE_PHOTO == sf_get_cammode_statu()))) { if(SUCCESS == sf_share_mem_file_down(0, 0)){ sf_set_send_statu(TRUE); diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMovie/UIFlowMovieEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMovie/UIFlowMovieEventCallback.c index 732b2e4ae..71338921e 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMovie/UIFlowMovieEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMovie/UIFlowMovieEventCallback.c @@ -707,9 +707,9 @@ static void UIFlowMovie_ScrOpen(lv_obj_t* obj) { DBG_DUMP("%s\r\n", __func__); - #if HUNTING_CAMERA_MCU == ENABLE - UIMenuStoreInfo *puiPara = sf_ui_para_get(); - #endif + // #if HUNTING_CAMERA_MCU == ENABLE + // UIMenuStoreInfo *puiPara = sf_ui_para_get(); + // #endif set_indev_keypad_group(obj); @@ -765,7 +765,7 @@ static void UIFlowMovie_ScrOpen(lv_obj_t* obj) } //#NT#2018/08/10#KCHong -end #if HUNTING_CAMERA_MCU == ENABLE - if(puiPara->CamMode == SF_CAM_MODE_PHOTO_VIDEO || puiPara->CamMode == SF_CAM_MODE_VIDEO2) + if(sf_get_cammode_statu() == SF_CAM_MODE_PHOTO_VIDEO || sf_get_cammode_statu() == SF_CAM_MODE_VIDEO2) #else if(SysGetFlag(CamMode) == SF_CAM_MODE_PHOTO_VIDEO) #endif @@ -1391,9 +1391,9 @@ void UIFlowMovie_KeyRelease(lv_obj_t* obj, uint32_t key) static void UIFlowMovie_NVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* msg) { -#if HUNTING_CAMERA_MCU == ENABLE - UIMenuStoreInfo *puiPara = sf_ui_para_get(); -#endif +// #if HUNTING_CAMERA_MCU == ENABLE +// UIMenuStoreInfo *puiPara = sf_ui_para_get(); +// #endif switch(msg->event) { @@ -1414,7 +1414,7 @@ static void UIFlowMovie_NVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* m UIFlowMovie_REC_FINISH(obj,msg); #if HUNTING_CAMERA_MCU == ENABLE - if(puiPara->CamMode == SF_CAM_MODE_PHOTO_VIDEO || puiPara->CamMode == SF_CAM_MODE_VIDEO2){ + if(sf_get_cammode_statu() == SF_CAM_MODE_PHOTO_VIDEO || sf_get_cammode_statu() == SF_CAM_MODE_VIDEO2){ sf_set_phone_shot_status(PHONE_SHOT_STOP); if(sf_get_mode_flag()) { diff --git a/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c b/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c index b0f1e1125..0924259d5 100755 --- a/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c +++ b/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c @@ -1400,28 +1400,28 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen) { puiPara->CamMode = SF_CAM_MODE_PHOTO; } - - int iCurrMode = System_GetState(SYS_STATE_CURRMODE); - int iNextMode = PRIMARY_MODE_PHOTO; - if((puiPara->CamMode == SF_CAM_MODE_PHOTO) || (puiPara->CamMode == SF_CAM_MODE_PHOTO_VIDEO) || (puiPara->CamMode == SF_CAM_MODE_VIDEO2)) - { - iNextMode = PRIMARY_MODE_PHOTO; - } - else if(puiPara->CamMode == SF_CAM_MODE_VIDEO) - { - iNextMode = PRIMARY_MODE_MOVIE; - } - else - { - iNextMode = PRIMARY_MODE_PHOTO; - } - if(iNextMode != iCurrMode) - { - UI_SetData(FL_PreMode, iCurrMode); - UI_SetData(FL_NextMode, iNextMode); - Ux_PostEvent(NVTEVT_SYSTEM_MODE, 1, iNextMode); - } + // int iCurrMode = System_GetState(SYS_STATE_CURRMODE); + // int iNextMode = PRIMARY_MODE_PHOTO; + + // if((puiPara->CamMode == SF_CAM_MODE_PHOTO) || (puiPara->CamMode == SF_CAM_MODE_PHOTO_VIDEO) || (puiPara->CamMode == SF_CAM_MODE_VIDEO2)) + // { + // iNextMode = PRIMARY_MODE_PHOTO; + // } + // else if(puiPara->CamMode == SF_CAM_MODE_VIDEO) + // { + // iNextMode = PRIMARY_MODE_MOVIE; + // } + // else + // { + // iNextMode = PRIMARY_MODE_PHOTO; + // } + // if((iNextMode != iCurrMode) && ((TRUE != sf_is_preview()))) + // { + // UI_SetData(FL_PreMode, iCurrMode); + // UI_SetData(FL_NextMode, iNextMode); + // Ux_PostEvent(NVTEVT_SYSTEM_MODE, 1, iNextMode); + // } Save_MenuInfo(); //sf_set_cam_mode(puiPara->CamMode); From e5416993b63db62d9f67c75d3f6e61238f0316b0 Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 19 Dec 2023 10:46:10 +0800 Subject: [PATCH 02/11] =?UTF-8?q?1.=E5=8E=BB=E6=8E=89=E8=93=9D=E7=89=99?= =?UTF-8?q?=E7=9A=84=E6=99=AE=E9=80=9Alog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/sf_app/code/source/sf_blue/src/sf_blue_hal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/application/source/sf_app/code/source/sf_blue/src/sf_blue_hal.c b/code/application/source/sf_app/code/source/sf_blue/src/sf_blue_hal.c index b9505fae9..c65baae4b 100644 --- a/code/application/source/sf_app/code/source/sf_blue/src/sf_blue_hal.c +++ b/code/application/source/sf_app/code/source/sf_blue/src/sf_blue_hal.c @@ -170,7 +170,7 @@ static void *sf_bluetooth_piscan_task(void *arg) system("dbus-daemon --system"); usleep(200 * 1000); - system("bluetoothd -d -n -C &"); + system("bluetoothd -n -C &"); for (i = 0; i < 40; i++) { if (access("/tmp/blue_status_ready", F_OK) == 0) { printf("blue status ready\r\n"); From 6e47f2c69803472fa4fdaf937200c62dcfd28f30 Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 19 Dec 2023 10:46:46 +0800 Subject: [PATCH 03/11] =?UTF-8?q?1.dp=E8=AE=B0=E5=BD=95=E7=9A=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/sf_app/code/include/sf_file.h | 1 + .../sf_app/code/source/4gMng/sf_eg91_sim.c | 8 +++ .../source/sf_app/code/source/4gMng/sf_ftp.c | 26 +++++++++ .../sf_app/code/source/fileMng/sf_file.c | 54 +++++++++++++------ 4 files changed, 74 insertions(+), 15 deletions(-) diff --git a/code/application/source/sf_app/code/include/sf_file.h b/code/application/source/sf_app/code/include/sf_file.h index 32a2dc9d9..1655ced1d 100755 --- a/code/application/source/sf_app/code/include/sf_file.h +++ b/code/application/source/sf_app/code/include/sf_file.h @@ -45,6 +45,7 @@ UINT8 sf_get_send_file_total(void); SINT32 sf_mem_upload_file_to_module(UINT32 MemPhotoAddr, UINT32 MemPhotosize); SINT32 sf_usr_mem_photo_ch(void); UINT8 sf_save_sd_log(void); +void sf_log_error_code(char* buff); #ifdef __cplusplus #if __cplusplus } 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 dbdd40aee..3acbd8a7a 100755 --- 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 @@ -4532,6 +4532,8 @@ SINT32 sf_auto_net_reg(void) SLOGE(gsmPara); sprintf((char *)logStr, "AT+CGREG? Timeout,Error Code:0x%08X\n", ret); SLOGE(logStr); + SF_SPRINTF(logStr, "%x,", ret); + sf_log_error_code(logStr); goto SF_MODULE_END; } } @@ -4699,6 +4701,8 @@ SINT32 sf_auto_net_reg(void) SLOGE(gsmPara); sprintf((char *)logStr, "Error Code:0x%08X\n", ret); SLOGE(logStr); + SF_SPRINTF(logStr, "%x,", ret); + sf_log_error_code(logStr); goto SF_MODULE_END; } } @@ -4750,6 +4754,8 @@ SINT32 sf_auto_net_reg(void) SLOGE(gsmPara); sprintf((char *)logStr, "Error Code:0x%08X\n", ret); SLOGE(logStr); + SF_SPRINTF(logStr, "%x,", ret); + sf_log_error_code(logStr); goto SF_MODULE_END; } else @@ -4768,6 +4774,8 @@ SINT32 sf_auto_net_reg(void) SLOGE(gsmPara); sprintf((char *)logStr, "Error Code:0x%08X\n", ret); SLOGE(logStr); + SF_SPRINTF(logStr, "%x,", ret); + sf_log_error_code(logStr); goto SF_MODULE_END; } else 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 e372ae237..e2b2a439f 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 @@ -970,6 +970,8 @@ SINT32 sf_pic_send_ftp(void) //TIMEOUT //pSifarPara->picSendTimeoutCount++; printf("%s:%d err ftpFileName:%s filePath:%s picSendFailCount:%d sendThumbnailFailCount:%d\n", __FUNCTION__, __LINE__, ftpFileName[pic], filePath[pic],pSifarPara->picSendFailCount, pSifarPara->sendThumbnailFailCount); + SF_SPRINTF(logStr, "%x,", ret); + sf_log_error_code(logStr); } else { if(!sf_get_mode_flag()){ @@ -1084,6 +1086,8 @@ SINT32 sf_video_send_ftp(void) if(SF_SUCCESS != ret) { printf("%s:%d err ret: [0x%08X] ftpFileName:%s filePath:%s\n", __FUNCTION__, __LINE__, ret, ftpFileName, filePath); + SF_SPRINTF(logStr, "%x,", ret); + sf_log_error_code(logStr); } } @@ -1130,6 +1134,8 @@ SINT32 sf_ftp_dailyreport_send(void) if(SF_SUCCESS != ret) { printf("%s:%d err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath); + SF_SPRINTF(logStr, "%x,", ret); + sf_log_error_code(logStr); }else { DailyReportFtpSendSucess = 1; pSifarPara->picSendCount = 0; @@ -1147,6 +1153,7 @@ SINT32 sf_ftp_dailyreport_send(void) pSifarPara->videoSendFailCount = 0; pSifarPara->videoSendSucessCount = 0; pSifarPara->SendlowPowerWarnCnt = 0; + sf_file_remove(SF_ERROR_CODE); } sf_dailyReport_set(); } @@ -1513,6 +1520,11 @@ SINT32 sf_camera_ota_ftp(void) } sf_set_fw_update(0); } + else + { + SF_SPRINTF(logStr, "%x,", ret); + sf_log_error_code(logStr); + } } MLOGD(" end ret:[0x%08X]\n", ret); @@ -1645,6 +1657,8 @@ SINT32 sf_concentrated_ftp_send(void) goto SF_CONCENTRATED_MODULE_REBOOT; } timeoutCnt++; + SF_SPRINTF(logStr, "%x,", ret1); + sf_log_error_code(logStr); goto SF_CONCENTRATED_END; } else { @@ -1825,6 +1839,8 @@ SINT32 sf_hd_ftp_send(void) goto SF_HD_MODULE_REBOOT; } timeoutCnt++; + SF_SPRINTF(logStr, "%x,", ret1); + sf_log_error_code(logStr); goto SF_HD_END; } else { @@ -2056,6 +2072,8 @@ SINT32 sf_video_ftp_send(void) goto SF_VIDEO_MODULE_REBOOT; } timeoutCnt++; + SF_SPRINTF(logStr, "%x,", ret1); + sf_log_error_code(logStr); goto SF_VIDEO_END; } else { @@ -2172,6 +2190,8 @@ SINT32 sf_log_send_ftp(void) if(SF_SUCCESS != ret) { printf("%s:%d err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath); + SF_SPRINTF(logStr, "%x,", ret); + sf_log_error_code(logStr); } } } @@ -2230,6 +2250,8 @@ SINT32 sf_low_power_warn_send_ftp(void) if(SF_SUCCESS != ret) { printf("%s:%d err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath); + SF_SPRINTF(logStr, "%x,", ret); + sf_log_error_code(logStr); }else { pSifarPara->SendlowPowerWarnCnt++; } @@ -2285,6 +2307,8 @@ SINT32 sf_gps_send_ftp(void) if(SF_SUCCESS != ret) { printf("%s:%d err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath); + SF_SPRINTF(logStr, "%x,", ret); + sf_log_error_code(logStr); } else { //GPS send success,add gps send flag @@ -3075,6 +3099,8 @@ SINT32 sf_card_log_send_ftp(void) if(SF_SUCCESS != ret) { printf("%s:%d err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath); + SF_SPRINTF(logStr, "%x,", ret); + sf_log_error_code(logStr); } else { diff --git a/code/application/source/sf_app/code/source/fileMng/sf_file.c b/code/application/source/sf_app/code/source/fileMng/sf_file.c index 85e1c2710..1f6b8c702 100755 --- a/code/application/source/sf_app/code/source/fileMng/sf_file.c +++ b/code/application/source/sf_app/code/source/fileMng/sf_file.c @@ -1301,23 +1301,23 @@ UINT32 sf_create_dailyreport_file(void) if(sf_file_IsExsit(SF_ERROR_CODE) == SF_TRUE){ size = sf_get_file_size((UINT8 *)SF_ERROR_CODE); - } - fd1 = open(SF_ERROR_CODE, O_APPEND | O_WRONLY, S_IRUSR | S_IWUSR); - if(fd1) - { - //size = sp5kFsFileSizeGet(fd1); - buf = malloc(size); - - if (buf) + fd1 = open(SF_ERROR_CODE, O_RDONLY, S_IRUSR | S_IWUSR); + if(fd1) { - read(fd1, buf, size-1); - printf("error code size=%d\n",size); - write(fd, buf, size-1); - write(fd, (UINT8 *)"\r\n", SF_STRLEN("\r\n")); - free(buf); - } + //size = sp5kFsFileSizeGet(fd1); + buf = malloc(size); - close(fd1); + if (buf) + { + read(fd1, buf, size-1); + printf("error code size=%d\n",size); + write(fd, buf, size-1); + write(fd, (UINT8 *)"\r\n", SF_STRLEN("\r\n")); + free(buf); + } + + close(fd1); + } } szTmpsize=SF_STRLEN(cfgTmp); @@ -1881,6 +1881,30 @@ UINT8 sf_save_sd_log(void) return ret; } +/************************************************* + Function: sf_log_error_code + Description: save error code + Input: error code + Output: N/A + Return: N/A + Others: N/A +*************************************************/ +void sf_log_error_code(char* buff) +{ + UINT32 fd = 0; + + if(sf_in_card_exist()) + { + fd = open(SF_ERROR_CODE, O_WRONLY | O_CREAT); + if(fd) + { + lseek(fd, 0, SEEK_END); + write(fd, buff, strlen(buff)); + close(fd); + system("sync"); + } + } +} #ifdef __cplusplus #if __cplusplus } From 63ec1857adeae33f74f6d5db7e1fb71f8b0532bd Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 19 Dec 2023 10:47:11 +0800 Subject: [PATCH 04/11] =?UTF-8?q?1.=E7=A8=8B=E5=BA=8F=E7=BB=99R6.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h | 2 +- .../code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h b/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h index 56e4dc412..4b869ab2c 100755 --- a/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h +++ b/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h @@ -945,7 +945,7 @@ #define SF_IS_RELEASE ENABLE #define PHOTO_ISP_STAMP DISABLE -#define SF_BASE_VERSION_FEA "R2.3" +#define SF_BASE_VERSION_FEA "R6.0" #define SF_GPS_SUPPORT 1 #define SF_SEND_LIST_ITEM_LENGTH 15 #define SF_4G_REGISTER_NETWORK_COUNT 230 diff --git a/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h b/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h index 83cfbec13..058fb0aad 100755 --- a/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h +++ b/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h @@ -957,7 +957,7 @@ #define SF_IQ_TEST DISABLE #define HW_S530 DISABLE #define PHOTO_ISP_STAMP DISABLE -#define SF_BASE_VERSION_FEA "R2.3" +#define SF_BASE_VERSION_FEA "R6.0" #define SF_GPS_SUPPORT 0 #define SF_SEND_LIST_ITEM_LENGTH 15 #define SF_4G_REGISTER_NETWORK_COUNT 230 From eb3e4e257feacb8a2c1e852d29695c97982a3bfc Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 19 Dec 2023 15:33:47 +0800 Subject: [PATCH 05/11] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9dp=E7=94=B5=E6=B1=A0?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/application/source/sf_app/code/source/fileMng/sf_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/application/source/sf_app/code/source/fileMng/sf_file.c b/code/application/source/sf_app/code/source/fileMng/sf_file.c index 1f6b8c702..c078bff75 100755 --- a/code/application/source/sf_app/code/source/fileMng/sf_file.c +++ b/code/application/source/sf_app/code/source/fileMng/sf_file.c @@ -1059,7 +1059,7 @@ UINT32 sf_create_dailyreport_file(void) } else if(temp == SF_POWER_TYPE_LI_POLYER) { - sprintf(str, "Custom"); + sprintf(str, "Lith Pack"); } else { From c4a322004bf48bccc42df882fd37e85beb510413 Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 19 Dec 2023 16:49:18 +0800 Subject: [PATCH 06/11] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8Dcam=20id=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E6=97=B6=E5=9C=A8dp=E6=96=87=E4=BB=B6=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/application/source/sf_app/code/source/fileMng/sf_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/application/source/sf_app/code/source/fileMng/sf_file.c b/code/application/source/sf_app/code/source/fileMng/sf_file.c index c078bff75..83874c1a1 100755 --- a/code/application/source/sf_app/code/source/fileMng/sf_file.c +++ b/code/application/source/sf_app/code/source/fileMng/sf_file.c @@ -956,7 +956,7 @@ UINT32 sf_create_dailyreport_file(void) } //sf_create_thumb_dir(); - if(pPara->CamNameSwitch) + if(SF_CAMID_ON == pPara->CamNameSwitch) { SF_STRCPY(cameraID, pPara->CamNameStr); } From ce3132dc912f61bd7478ad051c31e0725df2cac3 Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 19 Dec 2023 16:52:18 +0800 Subject: [PATCH 07/11] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E4=BA=9Blog=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E4=BF=A1=E5=8F=B7=EF=BC=9B2.=E4=BC=98=E5=8C=96gps?= =?UTF-8?q?=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIFlowPhoto/UIFlowPhotoEventCallback.c | 2 +- .../sf_app/code/source/systemMng/sf_commu_mcu_reg.c | 13 +++++++++---- .../lib/source/sifar/code/source/common/sf_common.c | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c index bc02098b3..21aaab05c 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c @@ -565,7 +565,7 @@ static void update_4g_module_icon(void) { lv_obj_set_hidden(label_tips_scr_uiflowphoto, true); // Update the icon. - printf("old signal = %d new signal = %d signal_level = %d\n", signal, signal_new, signal_level); + printf("old signal = %d new signal = %d signal_level = %d generation = %d\n", signal, signal_new, signal_level, sf_get_net_generation()); lv_obj_set_hidden(label_sim_scr_uiflowphoto, true); signal_icon_hidden(searching_index); signal_icon_hidden(signal); diff --git a/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c b/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c index 38036be30..7834cd807 100755 --- a/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c +++ b/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu_reg.c @@ -1250,11 +1250,16 @@ void sf_set_sim_insert(INT32 sim) } void sf_set_gps_status(const short status) { + static short ModeFlag = -1; SF_MESSAGE_BUF_S stMessageBuf = {0}; - stMessageBuf.arg2 = status; - stMessageBuf.arg1 = SF_PARA_CMD_GPS_STATUS; - stMessageBuf.cmdId = CMD_PARA; - sf_com_message_send_to_cardv(&stMessageBuf); + if(ModeFlag != status) + { + ModeFlag = status; + stMessageBuf.arg2 = status; + stMessageBuf.arg1 = SF_PARA_CMD_GPS_STATUS; + stMessageBuf.cmdId = CMD_PARA; + sf_com_message_send_to_cardv(&stMessageBuf); + } } void sf_set_usb_init(int flag) { 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 2b63c91ca..8cce8ce65 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -3410,6 +3410,7 @@ UINT8 sf_get_net_generation(void) void sf_set_net_generation(UINT8 value) { + //MLOGI("netGeneration:%d value:%d\n",netGeneration, value); if((value >= SF_NET_NO) && (value <= SF_NET_4G)) { netGeneration = value; From 3ec82a2b9a7a64eaeae742f6300de380955e7ab8 Mon Sep 17 00:00:00 2001 From: payton Date: Tue, 19 Dec 2023 16:53:57 +0800 Subject: [PATCH 08/11] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0log=E4=B8=AD=E9=97=B4?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/application/source/cardv/SrcCode/System/SysMain.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/application/source/cardv/SrcCode/System/SysMain.c b/code/application/source/cardv/SrcCode/System/SysMain.c index 82d051e3a..a2b0c6e60 100644 --- a/code/application/source/cardv/SrcCode/System/SysMain.c +++ b/code/application/source/cardv/SrcCode/System/SysMain.c @@ -773,6 +773,8 @@ exit: { DBG_DUMP("LogFile_Close ...\n"); LogFile_Close(); + system("rm -rf /mnt/sd/LOG/*dummy*");//Clear intermediate files. + system("sync"); } #endif #else From c1ef11a1cdf34ac384e8e09c1fa0a6c07dfa3af2 Mon Sep 17 00:00:00 2001 From: payton Date: Wed, 20 Dec 2023 09:54:14 +0800 Subject: [PATCH 09/11] =?UTF-8?q?1.mcu=E5=8D=87=E7=BA=A7=E8=B0=83=E6=95=B4?= =?UTF-8?q?=EF=BC=9A=E5=8D=87=E7=BA=A7=E5=BC=80lcd=EF=BC=9Bmcu=E8=AF=BB?= =?UTF-8?q?=E5=86=99=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4=E8=B0=83=E6=95=B4?= =?UTF-8?q?=EF=BC=9B2.lib=E9=87=8C=E7=9A=84usb=E6=A0=87=E8=AF=86=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/cardv/SrcCode/System/SysMain_Exe.c | 2 +- .../source/sf_app/code/include/sf_param_enum.h | 3 ++- .../sf_app/code/source/paramMng/sf_param_common.c | 2 ++ .../sf_app/code/source/systemMng/sf_commu_mcu.c | 15 +++++++++++++-- code/lib/source/sifar/code/include/sf_mcu.h | 1 + .../source/sifar/code/source/mcu/sf_mcu_client.c | 9 +++++++-- .../code/driver/na51089/source/mcu/sf_commu_mcu.c | 2 +- rtos/code/driver/na51089/source/mcu/sf_mcu.c | 3 ++- 8 files changed, 29 insertions(+), 8 deletions(-) diff --git a/code/application/source/cardv/SrcCode/System/SysMain_Exe.c b/code/application/source/cardv/SrcCode/System/SysMain_Exe.c index a479a460c..e52e84f72 100755 --- a/code/application/source/cardv/SrcCode/System/SysMain_Exe.c +++ b/code/application/source/cardv/SrcCode/System/SysMain_Exe.c @@ -158,7 +158,7 @@ INT32 System_GetBootFirstMode(void) { return PRIMARY_MODE_USBMSDC; } - else if((PWR_ON_SETUP != PowerOnMode) /*|| (sf_get_fw_update())*/) + else if((PWR_ON_SETUP != PowerOnMode) && (PWR_ON_MCU_UPDATA != PowerOnMode)/*|| (sf_get_fw_update())*/) { return PRIMARY_MODE_TRANSCODE; } diff --git a/code/application/source/sf_app/code/include/sf_param_enum.h b/code/application/source/sf_app/code/include/sf_param_enum.h index 0e39a30f5..17ca545c8 100755 --- a/code/application/source/sf_app/code/include/sf_param_enum.h +++ b/code/application/source/sf_app/code/include/sf_param_enum.h @@ -321,7 +321,8 @@ typedef enum sf_STARTUP_TYPE_E SF_MCU_STARTUP_RESET = 0x0A,/*power on to reset(reserve)*/ SF_MCU_STARTUP_SYN_PARAM = 0x0B,/*power on to syn param(reserve)*/ SF_MCU_STARTUP_BATCH_SEND= 0x0C,/*power on to send batch*/ - SF_MCU_STARTUP_BUTT = 0X0D, + SF_MCU_STARTUP_MCU_UPDATA= 0x0F,/*power on to send batch*/ + SF_MCU_STARTUP_BUTT = 0X10, } SF_STARTUP_TYPE_E; typedef enum sfPOWEROFF_TYPE_E diff --git a/code/application/source/sf_app/code/source/paramMng/sf_param_common.c b/code/application/source/sf_app/code/source/paramMng/sf_param_common.c index a10a9797f..5ff399edb 100755 --- a/code/application/source/sf_app/code/source/paramMng/sf_param_common.c +++ b/code/application/source/sf_app/code/source/paramMng/sf_param_common.c @@ -995,6 +995,8 @@ const SF_CHAR* sf_poweron_type_string(SF_STARTUP_TYPE_E enType) return "SF_MCU_STARTUP_SYN_PARAM"; case SF_MCU_STARTUP_BATCH_SEND: return "SF_MCU_STARTUP_BATCH_SEND"; + case SF_MCU_STARTUP_MCU_UPDATA: + return "SF_MCU_STARTUP_MCU_UPDATA"; default: return "unknown poweron type!!!"; } diff --git a/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu.c b/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu.c index 17300097f..151de0b01 100755 --- a/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu.c +++ b/code/application/source/sf_app/code/source/systemMng/sf_commu_mcu.c @@ -40,6 +40,7 @@ #include "kwrap/debug.h" #include "kwrap/util.h" #include +#include "sf_system.h" #define SERIAL_DEVICE_PATH "/dev/ttyS2" #ifdef __cplusplus @@ -707,7 +708,7 @@ unsigned int sf_get_mcu_reg_ack_depack_many(unsigned char reg[], unsigned char v int sf_commu_wait(unsigned char cmd) { - if(sf_mcu_flag_wait_done_timeout(cmd, 60)) + if(sf_mcu_flag_wait_done_timeout(cmd, 100)) { sf_commu_reset(); return - 1; @@ -963,7 +964,17 @@ unsigned char sf_commu_parse_mcu_data(unsigned char * src, unsigned int len) { sf_set_pir_statu_flag(0); sf_set_module_sleep_flag(0); - sf_com_message_send_to_cardv(&stMessageBuf); + if((PWR_ON_SETUP != sf_convert_power_on_mode()) && (PWR_ON_USB!= sf_convert_power_on_mode())) + { + printf("[power off] %s(%d)\n", __FUNCTION__, __LINE__); + sf_set_power_off_flag(1); + sf_app_battery_stop(); + system("reboot"); + } + else + { + sf_com_message_send_to_cardv(&stMessageBuf); + } } else if(0 == stMessageBuf.arg3) //ON->OFF { diff --git a/code/lib/source/sifar/code/include/sf_mcu.h b/code/lib/source/sifar/code/include/sf_mcu.h index 3bbd3516c..93b14f808 100644 --- a/code/lib/source/sifar/code/include/sf_mcu.h +++ b/code/lib/source/sifar/code/include/sf_mcu.h @@ -51,6 +51,7 @@ #define PWR_ON_GPRS_INIT 0x0A #define PWR_ON_TIME_SYNC 0x0B #define PWR_ON_TIME_SEND 0x0C +#define PWR_ON_MCU_UPDATA 0x0F /*REG FUNCTION_SWTICH*/ #define PIR_OFF 0x00 diff --git a/code/lib/source/sifar/code/source/mcu/sf_mcu_client.c b/code/lib/source/sifar/code/source/mcu/sf_mcu_client.c index 0125885b7..028855846 100644 --- a/code/lib/source/sifar/code/source/mcu/sf_mcu_client.c +++ b/code/lib/source/sifar/code/source/mcu/sf_mcu_client.c @@ -46,6 +46,7 @@ #include #include "UIInfo/UIInfo.h" #include "sf_param_enum.h" +#include "GxUSB.h" //#include "../../../application/source/cardv/SrcCode/PrjInc.h" @@ -1910,7 +1911,11 @@ BOOL sf_get_mode_flag(void) BOOL sf_is_usb_flag(void) { - return GxUSB_GetIsUSBPlug(); + if(GxUSB_GetConnectType() == 1) + { + return 1; + } + return 0;//GxUSB_GetIsUSBPlug(); } void sf_calculate_daily_report(UINT8*dailyHour, UINT8*dailyMin) @@ -2144,7 +2149,7 @@ void sf_set_power_on_mode(UINT8 data) ModeFlag = 0; PowerOnMode = data; PowerOnMode &= 0x0f; - if(1 == PowerOnMode) + if((1 == PowerOnMode) || 15 == PowerOnMode) { ConfigureModeFlag = 1; } diff --git a/rtos/code/driver/na51089/source/mcu/sf_commu_mcu.c b/rtos/code/driver/na51089/source/mcu/sf_commu_mcu.c index 1e80ee3c4..3030c01dd 100644 --- a/rtos/code/driver/na51089/source/mcu/sf_commu_mcu.c +++ b/rtos/code/driver/na51089/source/mcu/sf_commu_mcu.c @@ -486,7 +486,7 @@ unsigned int sf_get_mcu_reg_ack_depack_many(unsigned char reg[], unsigned char v int sf_commu_wait(unsigned char cmd) { //sf_mcu_flag_set_done(cmd); - if(sf_mcu_flag_wait_done_timeout(cmd, 30)) + if(sf_mcu_flag_wait_done_timeout(cmd, 100)) { sf_commu_reset(); return - 1; diff --git a/rtos/code/driver/na51089/source/mcu/sf_mcu.c b/rtos/code/driver/na51089/source/mcu/sf_mcu.c index 258aa0731..b0866f118 100755 --- a/rtos/code/driver/na51089/source/mcu/sf_mcu.c +++ b/rtos/code/driver/na51089/source/mcu/sf_mcu.c @@ -691,13 +691,14 @@ UINT8 sf_get_power_on_mode(void) if(gpio_getIntStatus(GPIO_INT_USBPLUGIN)) { PowerOnMode = PWR_ON_USB; + ConfigureModeFlag = 1; } else{ //PowerOnMode = sf_mcu_power_on_para_get(SF_MCU_POWERON); PowerOnMode = sf_mcu_power_on_para_get(SF_MCU_STARTMODE); //PowerOnMode &= 0x0f; //sf_is_night_mode(1); - if(1 == PowerOnMode) + if((PWR_ON_SETUP == PowerOnMode) || (PWR_ON_MCU_UPDATA == PowerOnMode)) { ConfigureModeFlag = 1; } From be37d33bc1d64fdbd48b86151093bf0d8f5727a5 Mon Sep 17 00:00:00 2001 From: payton Date: Wed, 20 Dec 2023 09:54:45 +0800 Subject: [PATCH 10/11] =?UTF-8?q?1.=E5=85=B3=E9=97=ADgps=E6=97=B6=E9=A6=96?= =?UTF-8?q?=E6=AC=A1=E5=90=AF=E5=8A=A8=E4=B9=9F=E5=8F=91=E4=B8=80=E6=AC=A1?= =?UTF-8?q?gps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/application/source/sf_app/code/source/app/sf_service.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 08ca4989c..c1dc92b39 100755 --- a/code/application/source/sf_app/code/source/app/sf_service.c +++ b/code/application/source/sf_app/code/source/app/sf_service.c @@ -1829,7 +1829,8 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) s32ret = sf_get_utc(); - if ((SF_ON == pCustomerParam->GpsSwitch)) { + if ((SF_ON == pCustomerParam->GpsSwitch) || (pCustomerParam->FristSendDailyAndGps)) + { s32ret = open_gps(s32ret); } if (0 != sf_get_cq_signal()) { @@ -1867,7 +1868,8 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam) set_at_parament(); sf_USB_net_init(); - if ((SF_ON == pCustomerParam->GpsSwitch)) { + if ((SF_ON == pCustomerParam->GpsSwitch) || (pCustomerParam->FristSendDailyAndGps)) + { const int KEEP_SERACHING_TIMEOUT_MS = 2000; const int KEEP_SERACHING_PERIOD_MS = 200; // keep_seraching_gps_location(KEEP_SERACHING_TIMEOUT_S); From 14e8e020ca2429736e522e1c843aabe6282c725b Mon Sep 17 00:00:00 2001 From: payton Date: Wed, 20 Dec 2023 09:55:01 +0800 Subject: [PATCH 11/11] =?UTF-8?q?1.log=E8=AE=B0=E5=BD=95=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/application/source/cardv/SrcCode/System/SysStrg_Exe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c b/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c index 5d21b03ee..fe4a9b0f2 100644 --- a/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c +++ b/code/application/source/cardv/SrcCode/System/SysStrg_Exe.c @@ -424,6 +424,7 @@ void System_OnStrgInit_FS(void) cfg.LogBuffSize2 = gLogFile_Buff2_Size; #endif LogFile_Config(&cfg); + DBG_DUMP("LogFile_Config ...\n"); } #endif @@ -1064,7 +1065,7 @@ INT32 System_OnStrgAttach(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) logOpenParm.maxFileNum = maxFileNum; logOpenParm.maxFileSize = maxFileSize; - logOpenParm.isPreAllocAllFiles = TRUE; + logOpenParm.isPreAllocAllFiles = FALSE; #if defined(__FREERTOS) logOpenParm.isSaveLastTimeSysErrLog = wdt_getResetNum()>0 ? TRUE : FALSE; #else //defined(__LINUX_USER__)