From 8f549afebdac66a95c84c876bec643f699c272bc Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Wed, 13 Dec 2023 15:03:02 +0800 Subject: [PATCH 01/21] Fixed bug number 10186. --- .../source/cardv/SrcCode/System/SysMain_Exe.c | 14 +++++++++++--- .../UIFlowClose/UIFlowCloseEventCallback.c | 7 +++++-- .../UIFlowClose/UIFlowCloseEventCallback.h | 7 ++++++- .../UIFlowMenuCommonConfirmEventCallback.c | 2 +- .../UIFlowPhoto/UIFlowPhotoEventCallback.c | 4 ++-- .../UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c | 2 +- .../source/sifar/code/source/common/sf_common.c | 5 +++-- 7 files changed, 29 insertions(+), 12 deletions(-) diff --git a/code/application/source/cardv/SrcCode/System/SysMain_Exe.c b/code/application/source/cardv/SrcCode/System/SysMain_Exe.c index f5e566e2d..a479a460c 100755 --- a/code/application/source/cardv/SrcCode/System/SysMain_Exe.c +++ b/code/application/source/cardv/SrcCode/System/SysMain_Exe.c @@ -417,11 +417,19 @@ BOOL System_GetShutdownBegin(void) { return g_IsShutdownBegin; } - +#define DO_NOT_SHOW_POWER_OFF 0 +#define SHOW_POWER_OFF 1 INT32 System_OnShutdown(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) { + UINT32 displayShow = SHOW_POWER_OFF; + if ( paramNum >= 2) + { + DBG_DUMP("^MOn Shutdown begin paramNum:%d paramArray[0]:%d paramArray[1]:%d\r\n",paramNum, paramArray[0], paramArray[1]); + displayShow = paramArray[1]; + } + if (paramNum >= 1 /*&& paramArray[0] == 0*/) + { //power-off begin DBG_DUMP("^MOn Shutdown begin paramNum:%d paramArray:%d\r\n",paramNum, paramArray[0]); - if (paramNum == 1 /*&& paramArray[0] == 0*/) { //power-off begin g_IsShutdownBegin=TRUE; #if (DISPLAY_FUNC == ENABLE) @@ -468,7 +476,7 @@ INT32 System_OnShutdown(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) } else { #if (POWEROFFLOGO_FUNCTION == ENABLE) #if HUNTING_CAMERA_MCU == ENABLE - if(sf_get_mode_flag()) + if(sf_get_mode_flag() && SHOW_POWER_OFF == displayShow) #endif { GxDisplay_Set(LAYER_OSD1, LAYER_STATE_ENABLE, 0); //turn off OSD1 diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.c index 2141d19fe..68ad34aa6 100644 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.c @@ -1,3 +1,4 @@ +#include "UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.h" #include "UIFlowLVGL/UIFlowLVGL.h" #include "PrjInc.h" #include "ImageApp/ImageApp_Photo.h" @@ -9,6 +10,7 @@ #define UPDATE_TIMEER_MS 200 static lv_task_t* update_timer = NULL; static lv_group_t* gp = NULL; +static DISPLAY_FINAL_E gPowerOff = DISPLAY_FINAL_END; static void set_indev_keypad_group(lv_obj_t* obj) { if(gp == NULL){ @@ -37,7 +39,7 @@ static void task_update_timer_cb(lv_task_t* task) closing_index ++; if (time_ms == 0) { - Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, APP_POWER_OFF_APO); + Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, gPowerOff); if(update_timer){ lv_task_del(update_timer); update_timer = NULL; @@ -45,8 +47,9 @@ static void task_update_timer_cb(lv_task_t* task) } } } -void OpenClosingScreen(void) +void OpenClosingScreen(const DISPLAY_FINAL_E powerOff) { + gPowerOff = powerOff; lv_plugin_scr_open(UIFlowClose, NULL); } diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.h b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.h index c23661bc4..88535d321 100644 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.h +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.h @@ -3,5 +3,10 @@ #include "UIFlowLVGL/UIFlowMenuCommonConfirm/UIFlowMenuCommonConfirmAPI.h" #include "UIFlowLVGL/UIFlowLVGL.h" #include "Resource/Plugin/lvgl_plugin.h" -void OpenClosingScreen(void); +typedef enum { + DISPLAY_FINAL_DO_NOT_SHOW_POWER_OFF = 0, + DISPLAY_FINAL_SHOW_POWER_OFF, + DISPLAY_FINAL_END +} DISPLAY_FINAL_E; +void OpenClosingScreen(const DISPLAY_FINAL_E powerOff); #endif /*UIFLOW_CLOSE_EVENT_CALLBACK_H*/ \ No newline at end of file diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonConfirm/UIFlowMenuCommonConfirmEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonConfirm/UIFlowMenuCommonConfirmEventCallback.c index 7c5d01aad..e25887503 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonConfirm/UIFlowMenuCommonConfirmEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonConfirm/UIFlowMenuCommonConfirmEventCallback.c @@ -531,7 +531,7 @@ static void UIFlowMenuCommonConfirm_MessageBox_ValueChanged(lv_obj_t* obj, uint3 BKG_PostEvent(gBKGEvt); } else if (gBKGEvt == NVTEVT_BKW_ENTER_WORK_MODE) { - OpenClosingScreen(); + OpenClosingScreen(DISPLAY_FINAL_DO_NOT_SHOW_POWER_OFF); // BKG_PostEvent(gBKGEvt); // UIFlowMenuCommonConfirm_CloseScr(); } else if (gBKGEvt) { 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 1d6a0655c..f6ee00397 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 @@ -1624,7 +1624,7 @@ static void task_update_icons_timer_cb(lv_task_t* task) } else { - OpenClosingScreen(); + OpenClosingScreen(DISPLAY_FINAL_DO_NOT_SHOW_POWER_OFF); } } return; @@ -1985,7 +1985,7 @@ void UIFlowPhtot_KeyLongPress(lv_obj_t* obj, uint32_t key) if (3 * 1000 <= KeyLeftPressingTimeMs) { // Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, APP_POWER_OFF_APO); - OpenClosingScreen(); + OpenClosingScreen(DISPLAY_FINAL_SHOW_POWER_OFF); KeyLeftPressingTimeMs = 0; } break; diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c index 44cfa7555..8c0e10504 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c @@ -52,7 +52,7 @@ static void task_msgbox_timer_cb(lv_task_t* task) } if (0 == autoClose) { - OpenClosingScreen(); + OpenClosingScreen(DISPLAY_FINAL_SHOW_POWER_OFF); } return; } 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 2466f2e3c..9b011ec0d 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -290,16 +290,17 @@ void sf_mode_detect(void) //LCD_BACKLIGHT_OFF; sf_sys_status_led_set(SF_LED_SYS_STATE_POWER_OFF); printf("[power off] %s(%d) AutoOfftime:%d\n", __FUNCTION__, __LINE__, AutoOfftime); + #define DO_NOT_SHOW_POWER_OFF 0 if(AutoOfftime >= KeepAliveTime_s) { - Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, APP_POWER_OFF_APO); //shutdown start + Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, DO_NOT_SHOW_POWER_OFF); //shutdown start } else { #if defined(_MODEL_565_HUNTING_EVB_LINUX_4G_68CS_) Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, APP_POWER_OFF_NORMAL); //shutdown start #elif defined(_MODEL_565_HUNTING_EVB_LINUX_4G_S530_) || defined(_MODEL_565_HUNTING_EVB_LINUX_4G_S550_) - Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, APP_POWER_OFF_APO); //shutdown start + Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, DO_NOT_SHOW_POWER_OFF); //shutdown start #endif } sf_set_power_off_flag(1); From ef46d7922941636c519d4210c95c0af1e96d5491 Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Wed, 13 Dec 2023 18:58:54 +0800 Subject: [PATCH 02/21] Improve Enter work mode tips. --- .../UIFlowClose/UIFlowCloseEventCallback.c | 1 + .../UIFlowPhoto/UIFlowPhotoEventCallback.c | 5 +-- .../UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c | 38 ++++++++++++++++--- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.c index 68ad34aa6..2d64deba0 100644 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.c @@ -39,6 +39,7 @@ static void task_update_timer_cb(lv_task_t* task) closing_index ++; if (time_ms == 0) { + printf("task_update_timer_cb gPowerOff = %d\n", gPowerOff); Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, gPowerOff); if(update_timer){ lv_task_del(update_timer); 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 f6ee00397..931e2c928 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 @@ -47,9 +47,9 @@ static CHAR g_cSelftimerCntStr[8] = {0}; static lv_group_t* gp = NULL; static lv_task_t* task_selftimer = NULL; static lv_task_t* update_icons_timer = NULL; -#define GO_TO_WORK_MODE_TIME 57 +#define GO_TO_WORK_MODE_TIME 59 #define PASSWORD_GO_TO_WORK_MODE_TIME_S 62 -#define MENU_GO_TO_WORK_MODE_TIME_S 27 +#define MENU_GO_TO_WORK_MODE_TIME_S 29 static unsigned int ShutDownTime = GO_TO_WORK_MODE_TIME; static lv_task_t* task_qview = NULL; @@ -1913,7 +1913,6 @@ static void UIFlowPhoto_Key(lv_obj_t* obj, uint32_t key) case LV_USER_KEY_RIGHT: { //SF_WIFI_STATUS_E status = sf_get_wifi_status(); - ShutDownTime = MENU_GO_TO_WORK_MODE_TIME_S; if(TRUE == sf_get_send_statu()) { printf("\r\n[%s] line:%d %d running\n", __FUNCTION__, __LINE__,key); diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c index 8c0e10504..4304f879b 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c @@ -41,26 +41,46 @@ static void task_msgbox_timer_cb(lv_task_t* task) UINT16 autoOffTime = sf_get_auto_off_time(); const lv_plugin_string_t* string = lv_plugin_get_string(msgID); - autoClose = autoClose - 1000; if (0 == autoClose || autoOffTime <= 10) { lv_task_del(msgbox_timer); msgbox_timer = NULL; if (msgbox) { - lv_msgbox_start_auto_close(msgbox, 0); + printf("msg box close delay 1000.\n"); + lv_msgbox_start_auto_close(msgbox, 1000); } if (0 == autoClose) { - OpenClosingScreen(DISPLAY_FINAL_SHOW_POWER_OFF); + // OpenClosingScreen(DISPLAY_FINAL_DO_NOT_SHOW_POWER_OFF); + #define DO_NOT_SHOW_POWER_OFF 0 + Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, DO_NOT_SHOW_POWER_OFF); } return; } + autoClose = autoClose - 1000; if(string){ snprintf(buf, BUF_LENGTH, "%s\n\n%ds\r\n", string->ptr, autoClose/1000); // lv_msgbox_set_text(msgbox, buf); lv_label_set_text_fmt(label_msg_scr_uiflowwrnmsg, "%s", buf); } + if (0 == autoClose || autoOffTime <= 10) + { + // lv_task_del(msgbox_timer); + // msgbox_timer = NULL; + // if (msgbox) + // { + // printf("msg box close delay 1000.\n"); + // lv_msgbox_start_auto_close(msgbox, 1000); + // } + // if (0 == autoClose) + // { + // // OpenClosingScreen(DISPLAY_FINAL_DO_NOT_SHOW_POWER_OFF); + // #define DO_NOT_SHOW_POWER_OFF 0 + // Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, DO_NOT_SHOW_POWER_OFF); + // } + return; + } } // update_icons(); return; @@ -109,6 +129,9 @@ void UIFlowWrnMsgAPI_Open_StringID(lv_plugin_res_id id, uint16_t auto_close_time { lv_plugin_msgbox_set_text(msgbox, id); } + if(auto_close_time_ms){ + lv_msgbox_start_auto_close(msgbox, auto_close_time_ms); + } // if(LV_PLUGIN_STRING_ID_STRING_UPGRADING == msgID) // { @@ -128,6 +151,9 @@ void UIFlowWrnMsgAPI_Open_StringID(lv_plugin_res_id id, uint16_t auto_close_time { snprintf(buf, BUF_LENGTH, "%s\n\n%ds\r\n", tmpstr1->ptr, autoClose/1000); lv_label_set_text_fmt(label_msg_scr_uiflowwrnmsg, "%s", buf); + if(auto_close_time_ms){ + lv_msgbox_start_auto_close(msgbox, auto_close_time_ms + 1000 * 2); + } } else if (LV_PLUGIN_STRING_ID_STRING_UPGRADING == msgID) { lv_label_set_text_fmt(label_msg_scr_uiflowwrnmsg, "Upgrading...\nCamera will automatically restart after upgrade complete"); @@ -161,9 +187,9 @@ void UIFlowWrnMsgAPI_Open_StringID(lv_plugin_res_id id, uint16_t auto_close_time } - if(auto_close_time_ms){ - lv_msgbox_start_auto_close(msgbox, auto_close_time_ms); - } + // if(auto_close_time_ms){ + // lv_msgbox_start_auto_close(msgbox, auto_close_time_ms); + // } set_indev_keypad_group(msgbox); if(msgbox_timer == NULL){ From 50233ba4994821162f8fcab0601a589b4eced703 Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Thu, 14 Dec 2023 10:31:53 +0800 Subject: [PATCH 03/21] Fixed bug number 10238. --- .../UIWnd/LVGL_SPORTCAM/UIFlowLVGL.UIFlowMovie.lvglscr | 8 ++++---- .../UIWnd/LVGL_SPORTCAM/UIFlowLVGL.UIFlowPhoto.lvglscr | 2 +- .../LVGL_SPORTCAM/UIFlowLVGL/UIFlowMovie/UIFlowMovie.c | 8 ++++---- .../LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhoto.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL.UIFlowMovie.lvglscr b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL.UIFlowMovie.lvglscr index f55aab3c4..9aae795c2 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL.UIFlowMovie.lvglscr +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL.UIFlowMovie.lvglscr @@ -1289,7 +1289,7 @@ "height": 30, "width": 90, "x": 38, - "y": 10 + "y": 5 }, "hidden": false, "locked": false, @@ -1346,7 +1346,7 @@ "height": 40, "width": 38, "x": 0, - "y": 0 + "y": -5 }, "hidden": true, "locked": false, @@ -1886,7 +1886,7 @@ "event callback": "", "font type": "Font_Type0", "geometry": { - "height": 3, + "height": 2, "width": 320, "x": 0, "y": 119 @@ -1906,7 +1906,7 @@ }, "Text": { "text_color": "0xff0000", - "text_font": "montserrat 16 4bpp", + "text_font": "SF-UI-Text-Medium 16 1bpp", "text_opa": 0, "text_sel_bg_color": "0x00b495", "text_sel_color": "0x3c3c3c" diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL.UIFlowPhoto.lvglscr b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL.UIFlowPhoto.lvglscr index 7635c021d..4056df4ae 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL.UIFlowPhoto.lvglscr +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL.UIFlowPhoto.lvglscr @@ -2402,7 +2402,7 @@ "event callback": "", "font type": "Font_Type0", "geometry": { - "height": 3, + "height": 2, "width": 320, "x": 0, "y": 119 diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMovie/UIFlowMovie.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMovie/UIFlowMovie.c index 4b2cc85ec..6420fd164 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMovie/UIFlowMovie.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMovie/UIFlowMovie.c @@ -1285,7 +1285,7 @@ lv_obj_t* UIFlowMovie_create(){ lv_plugin_label_allocate_ext_attr(label_rec_time); lv_plugin_label_set_font_type(label_rec_time, LV_PLUGIN_LANGUAGE_FONT_TYPE_0); lv_label_set_long_mode(label_rec_time, LV_LABEL_LONG_CROP); - lv_obj_set_pos(label_rec_time, 38, 10); + lv_obj_set_pos(label_rec_time, 38, 5); lv_obj_set_size(label_rec_time, 90, 30); lv_obj_add_style(label_rec_time, 0, &label_rec_time_s0); @@ -1333,7 +1333,7 @@ lv_obj_t* UIFlowMovie_create(){ lv_obj_set_hidden(image_rec_ellipse, true); lv_obj_set_click(image_rec_ellipse, false); lv_obj_set_drag(image_rec_ellipse, false); - lv_obj_set_pos(image_rec_ellipse, 0, 0); + lv_obj_set_pos(image_rec_ellipse, 0, -5); lv_obj_set_size(image_rec_ellipse, 38, 40); lv_img_set_src(image_rec_ellipse, &sy_luzhi); lv_obj_add_style(image_rec_ellipse, 0, &image_rec_ellipse_s0); @@ -1840,7 +1840,7 @@ lv_obj_t* UIFlowMovie_create(){ STYLE_COLOR_PROP(0x01, 0x00, 0x00, 0x00) ; lv_style_set_border_color(&label_line_s0, LV_STATE_DEFAULT, color); STYLE_COLOR_PROP(0x03, 0xff, 0x00, 0x00) ; lv_style_set_text_color(&label_line_s0, LV_STATE_DEFAULT, color); lv_style_set_text_opa(&label_line_s0,LV_STATE_DEFAULT,0); - lv_style_set_text_font(&label_line_s0,LV_STATE_DEFAULT,&lv_font_montserrat_16); + lv_style_set_text_font(&label_line_s0,LV_STATE_DEFAULT,&sf_ui_text_medium_16_1bpp); STYLE_COLOR_PROP(0xd3, 0x3c, 0x3c, 0x3c) ; lv_style_set_text_sel_color(&label_line_s0, LV_STATE_DEFAULT, color); STYLE_COLOR_PROP(0x3a, 0x00, 0xb4, 0x95) ; lv_style_set_text_sel_bg_color(&label_line_s0, LV_STATE_DEFAULT, color); STYLE_COLOR_PROP(0x03, 0xff, 0x00, 0x00) ; lv_style_set_bg_color(&label_line_s0, LV_STATE_CHECKED, color); @@ -1889,7 +1889,7 @@ lv_obj_t* UIFlowMovie_create(){ lv_label_set_align(label_line, LV_LABEL_ALIGN_CENTER); lv_label_set_long_mode(label_line, LV_LABEL_LONG_SROLL); lv_obj_set_pos(label_line, 0, 119); - lv_obj_set_size(label_line, 320, 3); + lv_obj_set_size(label_line, 320, 2); lv_obj_add_style(label_line, 0, &label_line_s0); label_line_scr_uiflowmovie = label_line; diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhoto.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhoto.c index 2d198a873..c39679d9d 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhoto.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhoto.c @@ -2374,7 +2374,7 @@ lv_obj_t* UIFlowPhoto_create(){ lv_label_set_align(label_line, LV_LABEL_ALIGN_CENTER); lv_label_set_long_mode(label_line, LV_LABEL_LONG_SROLL); lv_obj_set_pos(label_line, 0, 119); - lv_obj_set_size(label_line, 320, 3); + lv_obj_set_size(label_line, 320, 2); lv_obj_add_style(label_line, 0, &label_line_s0); label_line_scr_uiflowphoto = label_line; From 1c2c5262723854070aac9345084b64d6a3054320 Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Thu, 14 Dec 2023 16:32:39 +0800 Subject: [PATCH 04/21] Fixed bug number 10057. --- .../UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 931e2c928..cb3ef5cb2 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 @@ -1984,7 +1984,7 @@ void UIFlowPhtot_KeyLongPress(lv_obj_t* obj, uint32_t key) if (3 * 1000 <= KeyLeftPressingTimeMs) { // Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, APP_POWER_OFF_APO); - OpenClosingScreen(DISPLAY_FINAL_SHOW_POWER_OFF); + OpenClosingScreen(DISPLAY_FINAL_DO_NOT_SHOW_POWER_OFF); KeyLeftPressingTimeMs = 0; } break; From 2865641ffa43abb8b9c609dd8e0597ede243e46a Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Thu, 14 Dec 2023 17:16:36 +0800 Subject: [PATCH 05/21] Fixed bug number 10499. --- .../LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuSend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuSend.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuSend.c index 2a5d56365..553ec3484 100644 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuSend.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuSend.c @@ -513,7 +513,8 @@ void show_send_time_page(lv_obj_t* obj, const int sendType) gMatrixIndex = 0; SendTimeIndex_0 = 0; SendTimeIndex_1 = 0; - gSendType = sendType; + #define OPTION_3 3 + gSendType = sendType == OPTION_3 ? FOUR_TIME_DAY : sendType; gPageNum = FIRST_PAGE; unsigned short settingIndex = gPageNum * 2; SendTimeMatrixObj_1 = NULL; From b2d21371d3728d4ece6c62018c3968b385e0ff00 Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Fri, 15 Dec 2023 14:15:48 +0800 Subject: [PATCH 06/21] Fixed bug number 10227. --- .../UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c index 4304f879b..f42c21a5a 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c @@ -308,15 +308,19 @@ void message_box_wrnmsg_OnKeyMenu(lv_obj_t* msgbox) void message_box_wrnmsg_OnKey(lv_obj_t* msgbox, uint32_t key) { + // static uint32_t key22 = LV_KEY_END; + // key22 = key; + // lv_event_send(lv_obj_get_parent(UIFlowWrnMsg), LV_USER_EVENT_KEY_RELEASE, &key22); + return; switch(key) { case LV_USER_KEY_MENU: - message_box_wrnmsg_OnKeyMenu(msgbox); + // message_box_wrnmsg_OnKeyMenu(msgbox); break; //#NT#2023/11/14#Eric - begin //#NT#Support IVOT_N12144_CO-148_A case LV_KEY_ENTER: - UIFlowWrnMsg_CloseScr(NVTEVT_NULL); + // UIFlowWrnMsg_CloseScr(NVTEVT_NULL); break; //#NT#2023/11/14#Eric - end default: From 22f50803393aa28bb29e7c7c44be7e72fa9460e9 Mon Sep 17 00:00:00 2001 From: payton Date: Wed, 13 Dec 2023 19:39:43 +0800 Subject: [PATCH 07/21] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E8=93=9D=E7=89=99?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E5=8F=AF=E8=83=BD=E4=B8=8D=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIFlowMenuCommonItemEventCallback.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/UIFlowMenuCommonItemEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/UIFlowMenuCommonItemEventCallback.c index 4da122afa..ff42b8a7d 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/UIFlowMenuCommonItemEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/UIFlowMenuCommonItemEventCallback.c @@ -1034,6 +1034,9 @@ static void UIFlowMenuCommonItem_ScrClose(lv_obj_t* obj) Save_MenuInfo(); LV_MenuItem_OnClose(obj); gMenuLuck = MENU_CLOSED; + #if HUNTING_CAMERA_MCU == ENABLE + sf_set_menu_open(FALSE); + #endif } @@ -1059,9 +1062,6 @@ static void UIFlowMenuCommonItem_ChildScrClose(lv_obj_t* obj,const LV_USER_EVENT } gMenuLuck = MENU_UNLUCK; - #if HUNTING_CAMERA_MCU == ENABLE - sf_set_menu_open(FALSE); - #endif } From c4fb81c19176e5405b6926cb1656dbb15fb151b2 Mon Sep 17 00:00:00 2001 From: payton Date: Fri, 15 Dec 2023 16:28:21 +0800 Subject: [PATCH 08/21] =?UTF-8?q?1.=E5=8D=87=E7=BA=A7=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c | 16 ++++++++++++---- .../code/source/systemMng/sf_commu_mcu_reg.c | 2 ++ 2 files changed, 14 insertions(+), 4 deletions(-) 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 ddff14480..59f340237 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UIInfo.c @@ -505,6 +505,10 @@ void Load_MenuInfo(void) #if HUNTING_CAMERA_MCU == ENABLE if(sf_get_ui_para_flag()) { + if(!sf_is_usb_flag()) + { + sf_mcu_reg_set(SF_MCU_SOFT_UPDATE, 0); + } memcpy(&origInfo, ¤tInfo, sizeof(currentInfo)); memcpy(&origInfo_check, ¤tInfo, sizeof(currentInfo)); return; @@ -515,10 +519,14 @@ void Load_MenuInfo(void) #if HUNTING_CAMERA_MCU == ENABLE sf_power_on_para_check_init(); - if(sf_is_usb_flag()) - { - Save_MenuInfo(); - } + if(sf_is_usb_flag()) + { + Save_MenuInfo(); + } + else + { + sf_mcu_reg_set(SF_MCU_SOFT_UPDATE, 0); + } #endif #if HUNTING_CAMERA_MCU == ENABLE //origInfo = currentInfo; 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 c35a971dc..76b4dc56d 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 @@ -882,6 +882,8 @@ unsigned char sf_mcu_reg_set(MCUParam_t attrId, unsigned char val) if(val == 1) { mcuData[i++] = (puiPara->CamArmDiable) << 6 | isUsb << 2 | isCardFull << 1 | isCard << 0 | 0x08; + mcuReg[i] = WDT_TIME; + mcuData[i++] = 16;/*16 min*/ } else { From 86f848136f0d50f8f5c34b12cb77985d455e3c81 Mon Sep 17 00:00:00 2001 From: payton Date: Thu, 14 Dec 2023 10:05:59 +0800 Subject: [PATCH 09/21] =?UTF-8?q?1.iq=20test=E9=BB=98=E8=AE=A4=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h | 2 +- .../cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h | 2 +- 2 files changed, 2 insertions(+), 2 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 47eecf343..b487b056f 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h @@ -69,7 +69,7 @@ #if SF_HW_TEST == ENABLE #define DEFAULT_MOVIE_SIZE MOVIE_SIZE_FRONT_1280x720P30 #else - #define DEFAULT_MOVIE_SIZE MOVIE_SIZE_CLONE_1920x1080P30_1920x1080P25 + #define DEFAULT_MOVIE_SIZE MOVIE_SIZE_FRONT_1920x1080P30 #endif #endif #else diff --git a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h index 70e66f904..59f1a5eec 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h +++ b/rtos/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIInfo/UICfgDefault.h @@ -69,7 +69,7 @@ #if SF_HW_TEST == ENABLE #define DEFAULT_MOVIE_SIZE MOVIE_SIZE_FRONT_1280x720P30 #else - #define DEFAULT_MOVIE_SIZE MOVIE_SIZE_CLONE_1920x1080P30_1920x1080P25 + #define DEFAULT_MOVIE_SIZE MOVIE_SIZE_FRONT_1920x1080P30 #endif #endif #else From c89b1d3eae5ab991f701b04ded8af72603055a76 Mon Sep 17 00:00:00 2001 From: payton Date: Thu, 14 Dec 2023 10:06:27 +0800 Subject: [PATCH 10/21] =?UTF-8?q?1.=E8=BF=87=E6=9B=9D=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/source/cardv/SrcCode/FastFlow/flow_preview.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtos/code/application/source/cardv/SrcCode/FastFlow/flow_preview.c b/rtos/code/application/source/cardv/SrcCode/FastFlow/flow_preview.c index 6c118481d..ae18062a8 100755 --- a/rtos/code/application/source/cardv/SrcCode/FastFlow/flow_preview.c +++ b/rtos/code/application/source/cardv/SrcCode/FastFlow/flow_preview.c @@ -1302,7 +1302,7 @@ void setet_preset_param(void) vendor_isp_get_ae(AET_ITEM_STATUS, &ae_status_info); DBG_WRN(">> aet status exp %d iso %d\r\n",ae_status_info.status_info.expotime[0],ae_status_info.status_info.iso_gain[0]); preset_param.expt= ae_status_info.status_info.expotime[0]; - preset_param.gain= ae_status_info.status_info.iso_gain[0]; + preset_param.gain= ae_status_info.status_info.iso_gain[0]*10; total_gain.id = 0; total_gain.gain = preset_param.gain; vendor_isp_set_common(ISPT_ITEM_TOTAL_GAIN, &total_gain); From fecea29ac49e81e10106a949ca80f24deb540f51 Mon Sep 17 00:00:00 2001 From: payton Date: Thu, 14 Dec 2023 10:08:12 +0800 Subject: [PATCH 11/21] =?UTF-8?q?1.=E8=BF=9E=E6=8B=8D=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E9=97=B4=E9=9A=94=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c | 4 ++-- .../source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c b/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c index 3ec4a95c2..0ef7a994e 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c @@ -1356,10 +1356,10 @@ static INT32 MovieFast_Mode2_Get_Cont_Shot(UINT32* max_cnt, UINT32* duration) if(SF_MULTISHOT_INTEVEL_1S == puiPara->MultiShotIntevel) { - *duration = 1000;//The interval between consecutive shots of each photo is 1 second + *duration = 970;//The interval between consecutive shots of each photo is 1 second } else if(SF_MULTISHOT_INTEVEL_2S == puiPara->MultiShotIntevel) { - *duration = 2000;//The interval between consecutive shots of each photo is 2 second + *duration = 1970;//The interval between consecutive shots of each photo is 2 second } else { *duration = 1000 / *max_cnt;//SF_MULTISHOT_INTEVEL_0S 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 10f6b49c0..b056c5eb9 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/PhotoFast/PhotoFast.c @@ -1500,10 +1500,10 @@ THREAD_RETTYPE PhotoFast_FlowPreviewThread(void *arg) #if HUNTING_CAMERA_MCU == ENABLE if(SF_MULTISHOT_INTEVEL_1S == puiPara->MultiShotIntevel) { - period = 1000;//The interval between consecutive shots of each photo is 1 second + period = 970;//The interval between consecutive shots of each photo is 1 second } else if(SF_MULTISHOT_INTEVEL_2S == puiPara->MultiShotIntevel) { - period = 2000;//The interval between consecutive shots of each photo is 2 second + period = 1970;//The interval between consecutive shots of each photo is 2 second } else { period = 1000 / max_cnt;//SF_MULTISHOT_INTEVEL_0S From 80a26e8088ce7259e18e32770380bf047665e2a0 Mon Sep 17 00:00:00 2001 From: payton Date: Fri, 15 Dec 2023 15:46:08 +0800 Subject: [PATCH 12/21] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E8=83=8C=E5=85=89cmd?= =?UTF-8?q?=EF=BC=9B2.=E5=A6=82=E8=A6=81=E5=88=87=E6=8D=A2=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E6=8B=8D=E6=91=84=E7=BB=93=E6=9D=9F=E5=86=8D=E5=88=87?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIFlowPhoto/UIFlowPhotoEventCallback.c | 3 +- .../lib/source/sifar/code/include/sf_common.h | 3 ++ .../sifar/code/source/common/sf_common.c | 29 +++++++++++++++++-- 3 files changed, 32 insertions(+), 3 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 1d6a0655c..9cfc4a93d 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 @@ -1653,6 +1653,7 @@ void UIFlowPhoto_UpdateInfo(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* msg) case UIAPPPHOTO_CB_CAPSTART: #if HUNTING_CAMERA_MCU == ENABLE sf_set_cap_statu(TRUE); + sf_set_cammode_statu(puiPara->CamMode); #endif if(obj == UIFlowPhoto) @@ -1679,7 +1680,7 @@ void UIFlowPhoto_UpdateInfo(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* msg) UIFlowPhoto_BackPreviewHandle(); #if HUNTING_CAMERA_MCU == ENABLE - if((sf_get_mode_flag()) && (puiPara->CamMode == SF_CAM_MODE_PHOTO_VIDEO || puiPara->CamMode == SF_CAM_MODE_VIDEO2)){ + if((sf_get_mode_flag()) && (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 diff --git a/code/lib/source/sifar/code/include/sf_common.h b/code/lib/source/sifar/code/include/sf_common.h index 4e52744da..62830bdeb 100755 --- a/code/lib/source/sifar/code/include/sf_common.h +++ b/code/lib/source/sifar/code/include/sf_common.h @@ -189,4 +189,7 @@ void sf_set_msdc_clk(void); void sf_send_message_to_create_qrcode(void); UINT8 sf_get_rtsp_flag(void); void sf_set_rtsp_flag(UINT8 flag); +char sf_get_cammode_statu(void); +void sf_set_cammode_statu(char is); +BOOL sf_set_backlight_status(unsigned char argc, char **argv); #endif 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 2466f2e3c..40e51004b 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -100,7 +100,7 @@ static UINT8 UiparaFlag = 0; static SF_BLE_STATUS_E BleStatus = SF_BLE_OK; static UINT8 McuUpdateFlag = 0; static SF_GPS_STATUS_E gGpsSearching = SF_GPS_SEARCHING_UNKNOW; - +static char CamMode = 0; static SF_THREAD_S UpgradeTskParam = { .IsRun = 0, @@ -3368,4 +3368,29 @@ void sf_send_message_to_create_qrcode(void) stMessageBuf.arg1 = SF_EVENT_KEY_MOCK_CREATE_QR_CODE; stMessageBuf.cmdId = CMD_KEY; sf_com_message_send_to_app(&stMessageBuf); -} \ No newline at end of file +} + +void sf_set_cammode_statu(char is) +{ + CamMode = is; + //printf("[%s]:%d IsCap:%d\n", __FUNCTION__, __LINE__,IsCap); +} + +char sf_get_cammode_statu(void) +{ + //printf("[%s]:%d IsCap:%d\n", __FUNCTION__, __LINE__,IsCap); + return CamMode; + +} + +BOOL sf_set_backlight_status(unsigned char argc, char **argv) +{ + UINT32 value; + sscanf_s(argv[0],"%d", &value); + printf("[%s:%d] value:%d\n", __FUNCTION__, __LINE__,value); + if(value < SF_ON_OFF_MAX){ + printf("[%s:%d] Status:%d\n", __FUNCTION__, __LINE__,GPIO_SetBacklightStatus(value)); + } + + return TRUE; +} From 13f633bf6cf0630f82a1c4d5865dd35675c51ab0 Mon Sep 17 00:00:00 2001 From: payton Date: Fri, 15 Dec 2023 15:47:44 +0800 Subject: [PATCH 13/21] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0cardv=E5=85=B3?= =?UTF-8?q?=E6=9C=BA=E8=B6=85=E6=97=B6=E9=94=99=E8=AF=AF=E6=97=B6sfapp?= =?UTF-8?q?=E5=85=B3=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/sf_app/code/source/app/sf_system.c | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/code/application/source/sf_app/code/source/app/sf_system.c b/code/application/source/sf_app/code/source/app/sf_system.c index db2305107..0763b43ff 100755 --- a/code/application/source/sf_app/code/source/app/sf_system.c +++ b/code/application/source/sf_app/code/source/app/sf_system.c @@ -141,7 +141,11 @@ SF_THREAD_S McuUpDataTskCfg = .IsRun = 0, .TskId = -1, }; - +SF_THREAD_S PowerOffTskCfg = +{ + .IsRun = 0, + .TskId = -1, +}; SINT8 debugFlag = 0; UINT8 McuInitFlag = 0; @@ -1499,7 +1503,36 @@ SINT32 sf_app_mcu_para_stop(void) } return SF_SUCCESS; } +void* sf_app_power_off_thread(void *arg) +{ + SLOGI("thread run\n"); + PowerOffTskCfg.IsRun = 1; + sleep(5); + SLOGE("cdv power off err\n"); + app_system_poweroff(0); + PowerOffTskCfg.IsRun = 0; + SLOGI("thread end\n"); + + return NULL; +} +SINT32 sf_app_power_off_start(void) +{ + SINT32 ret = SF_FAILURE; + if(PowerOffTskCfg.IsRun) + { + SLOGE("thread has already run !!!\n"); + return SF_FAILURE; + } + ret = pthread_create(&PowerOffTskCfg.TskId, NULL, sf_app_power_off_thread, NULL); + if(ret != SF_SUCCESS) + { + MLOGD("thread creat fail!\n"); + return ret; + } + return SF_SUCCESS; + +} /************************************************* Function: sf_power_off_msg_to_cardv Description: power off @@ -1516,6 +1549,7 @@ void sf_power_off_msg_to_cardv(void) stMessageBuf.arg1 = SF_EVENT_KEY_SHORT_CLICK; stMessageBuf.arg2 = SF_KEY_PIN_AOTU_MODE_POWOFF;//auto mode powoff sf_com_message_send_to_cardv(&stMessageBuf); + sf_app_power_off_start(); } UINT8 sf_app_get_mcu_init_flag(void) From b11ea12d850e812cc97dceccbea6c8ab0f52cb0b Mon Sep 17 00:00:00 2001 From: payton Date: Fri, 15 Dec 2023 15:48:04 +0800 Subject: [PATCH 14/21] =?UTF-8?q?1.=E8=83=8C=E5=85=89cmd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/application/source/cardv/SrcCode/System/SysMain_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/application/source/cardv/SrcCode/System/SysMain_cmd.c b/code/application/source/cardv/SrcCode/System/SysMain_cmd.c index ef5e621a0..2dea0e44e 100755 --- a/code/application/source/cardv/SrcCode/System/SysMain_cmd.c +++ b/code/application/source/cardv/SrcCode/System/SysMain_cmd.c @@ -263,7 +263,7 @@ SXCMD_ITEM("gprssw %", sf_cmd_gprs_switch, "gprssw 0/1") SXCMD_ITEM("uiprint %", sf_cmd_para_printf, "uiprint") SXCMD_ITEM("blusw %", cmd_blu_switch, "blusw 0/1") SXCMD_ITEM("wifisw %", cmd_wifi_switch, "wifisw 0/1") - +SXCMD_ITEM("lcdbk %", sf_set_backlight_status, "lcdbk 0/1") #endif From 1ac9c48f849d97bd702bbc589113328ef77e7425 Mon Sep 17 00:00:00 2001 From: payton Date: Fri, 15 Dec 2023 17:31:47 +0800 Subject: [PATCH 15/21] =?UTF-8?q?1.iq=E8=BF=87=E6=9B=9D=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c b/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c index 0ef7a994e..6252c77a2 100644 --- a/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c +++ b/rtos/code/application/source/cardv/SrcCode/UIApp/MovieFast/MovieFast.c @@ -1385,11 +1385,11 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg) //UI_SetData(FL_MOVIE_SIZE, MOVIE_SIZE_CLONE_1920x1080P30_1280x720P30); Set_NIGHTMODE(0, 0); - nvt_cmdsys_runcmd("ae set_speed 0 128 700 700 100 "); + //nvt_cmdsys_runcmd("ae set_speed 0 128 700 700 100 "); } else{ Set_NIGHTMODE(0, 1); - Set_AEMODE(0); + //Set_AEMODE(0); } MovieFast_SetRecInfoByUISetting(); @@ -1587,6 +1587,9 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg) MovieFast_InstallID(); + nvt_cmdsys_runcmd("ae set_speed 0 128 700 700 100 "); + //nvt_cmdsys_runcmd("ae dbg 0 256 1 "); + HD_VIDEO_FRAME frame_capture = {0}; { @@ -1614,8 +1617,8 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg) ae_preset_flag = TRUE; vprc_frm_cnt_ae_preset = vprc_frm_cnt; DBG_DUMP("ae preset vprc frame cnt = %lu\n", vprc_frm_cnt_ae_preset); - Set_AEMODE(1); - setet_preset_param(); + Set_AEMODE(0); + //setet_preset_param(); } } From 3ae9ca53e6a88547cfdc39e3e7a06f0e0cee2c1c Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Fri, 15 Dec 2023 19:04:47 +0800 Subject: [PATCH 16/21] 7MR5RCwDC04 --- 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 545c4002c..587c62976 100755 --- a/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h +++ b/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h @@ -922,7 +922,7 @@ #define HUNTING_MCU_UART ENABLE #define HUNTING_IR_LED_940 ENABLE #define SF_EXIF_MN_BUF_SIZE 256 -#define SF_BASE_VERSION "7MR5RCwDC03" +#define SF_BASE_VERSION "7MR5RCwDC04" #define HW_S530 DISABLE #define DCF_DIR_NAME "MEDIA" /* 100MEDIA */ #define DCF_FILE_NAME "SYGW" /* SYFW0001.JPG */ 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 91cca7f5e..83cfbec13 100755 --- a/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h +++ b/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h @@ -945,7 +945,7 @@ #define HUNTING_MCU_UART ENABLE #define HUNTING_IR_LED_940 ENABLE #define SF_EXIF_MN_BUF_SIZE 256 -#define SF_BASE_VERSION "7MR5RCwDC03" +#define SF_BASE_VERSION "7MR5RCwDC04" #define DCF_DIR_NAME "MEDIA" /* 100MEDIA */ #define DCF_FILE_NAME "SYGW" /* SYFW0001.JPG */ #define PHOTO_THUMB_PATH "A:\\THUMB\\" From 041d8d89a3bb2afd5fd87b07777a7dd776026abe Mon Sep 17 00:00:00 2001 From: payton Date: Mon, 18 Dec 2023 13:55:23 +0800 Subject: [PATCH 17/21] =?UTF-8?q?1.=E4=BF=A1=E5=8F=B7=E6=94=B9=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=85=A8=E5=B1=80=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIFlowMovie/UIFlowMovieEventCallback.c | 14 ++-- .../UIFlowPhoto/UIFlowPhotoEventCallback.c | 16 ++-- .../source/sf_app/code/include/sf_eg91_sim.h | 2 + .../sf_app/code/source/4gMng/sf_eg91_sim.c | 78 +++++++++---------- .../source/sf_app/code/source/4gMng/sf_ftp.c | 46 +++++------ .../source/sf_app/code/source/app/sf_device.c | 4 +- .../sf_app/code/source/fileMng/sf_file.c | 14 ++-- .../code/source/systemMng/sf_commu_mcu_reg.c | 11 ++- .../lib/source/sifar/code/include/sf_common.h | 2 + .../sifar/code/source/common/sf_common.c | 20 +++++ .../source/sifar/code/source/module/sf_sim.c | 1 - 11 files changed, 117 insertions(+), 91 deletions(-) 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 6ceb46cc7..732b2e4ae 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 @@ -256,12 +256,12 @@ static void signal_icon_show(const short signal) } static void update_4g_module_icon(void) { - UIMenuStoreInfo *puiPara = sf_ui_para_get(); + //UIMenuStoreInfo *puiPara = sf_ui_para_get(); static short signal = SIGNAL_NOT_YET_GET; static short searching_index = -1; short signal_new = sf_cardv_get_cq_signal(); unsigned short signal_level = 0; - network_signal_level_get(puiPara->NetGeneration, signal_new, &signal_level); + network_signal_level_get(sf_get_net_generation(), signal_new, &signal_level); // printf("new signal = %d, old signal = %d\n", signal_new, signal); if(SIGNAL_NOT_YET_GET == signal_new) { @@ -294,20 +294,20 @@ const int EMPTY_IMAGE = 0; LV_PLUGIN_IMG_ID_SF_NET3G, LV_PLUGIN_IMG_ID_SF_NET4G }; -// printf("NetGeneration:%d\n", puiPara->NetGeneration); +// printf("NetGeneration:%d\n", sf_get_net_generation()); const int SIM_CARD_NOT_INIT = 0; const int NET_GENERATION_2G = 2; // const int NET_GENERATION_3G = 3; const int NET_GENERATION_4G = 4; // puiPara->NetGeneration = NET_GENERATION_4G; // Test - if (SIM_CARD_NOT_INIT == puiPara->NetGeneration - || puiPara->NetGeneration < NET_GENERATION_2G - || puiPara->NetGeneration > NET_GENERATION_4G) + if (SIM_CARD_NOT_INIT == sf_get_net_generation() + || sf_get_net_generation() < NET_GENERATION_2G + || sf_get_net_generation() > NET_GENERATION_4G) { lv_obj_set_hidden(image_4g_scr_uiflowmovie, true); return; } - int index = puiPara->NetGeneration; + int index = sf_get_net_generation(); lv_obj_set_hidden(image_4g_scr_uiflowmovie, false); lv_plugin_img_set_src(image_4g_scr_uiflowmovie, res[index]); } 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 13c52f09e..bc02098b3 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 @@ -546,12 +546,12 @@ static void update_4g_module_icon(void) const int NET_GENERATION_2G = 2; // const int NET_GENERATION_3G = 3; const int NET_GENERATION_4G = 4; - UIMenuStoreInfo *puiPara = sf_ui_para_get(); + //UIMenuStoreInfo *puiPara = sf_ui_para_get(); static short signal = SIGNAL_NOT_YET_GET; static short searching_index = -1; short signal_new = sf_cardv_get_cq_signal(); unsigned short signal_level = 0; - network_signal_level_get(puiPara->NetGeneration, signal_new, &signal_level); + network_signal_level_get(sf_get_net_generation(), signal_new, &signal_level); // printf("new signal = %d, old signal = %d\n", signal_new, signal); if(SIGNAL_NOT_YET_GET == signal_new) { @@ -561,7 +561,7 @@ static void update_4g_module_icon(void) // printf(" searching ... [%d]\n", searching_index); signal_icon_show(searching_index); } - else if(signal != signal_new && SIM_CARD_NOT_INIT != puiPara->NetGeneration) + else if(signal != signal_new && SIM_CARD_NOT_INIT != sf_get_net_generation()) { lv_obj_set_hidden(label_tips_scr_uiflowphoto, true); // Update the icon. @@ -613,16 +613,16 @@ const int EMPTY_IMAGE = 0; LV_PLUGIN_IMG_ID_SF_NET3G, LV_PLUGIN_IMG_ID_SF_NET4G }; -// printf("NetGeneration:%d\n", puiPara->NetGeneration); +// printf("NetGeneration:%d\n", sf_get_net_generation()); // puiPara->NetGeneration = NET_GENERATION_4G; // Test - if (SIM_CARD_NOT_INIT == puiPara->NetGeneration - || puiPara->NetGeneration < NET_GENERATION_2G - || puiPara->NetGeneration > NET_GENERATION_4G) + if (SIM_CARD_NOT_INIT == sf_get_net_generation() + || sf_get_net_generation() < NET_GENERATION_2G + || sf_get_net_generation() > NET_GENERATION_4G) { lv_obj_set_hidden(image_4g_scr_uiflowphoto, true); return; } - int index = puiPara->NetGeneration; + int index = sf_get_net_generation(); lv_obj_set_hidden(image_4g_scr_uiflowphoto, false); lv_plugin_img_set_src(image_4g_scr_uiflowphoto, res[index]); } diff --git a/code/application/source/sf_app/code/include/sf_eg91_sim.h b/code/application/source/sf_app/code/include/sf_eg91_sim.h index b52b28fa8..aedf04890 100755 --- a/code/application/source/sf_app/code/include/sf_eg91_sim.h +++ b/code/application/source/sf_app/code/include/sf_eg91_sim.h @@ -279,6 +279,8 @@ typedef enum SIM_ERR_CODE_s{ SIM_FAILED, }SIM_ERR_CODE; +UINT8 sf_get_net_generation(void); +void sf_set_net_generation(UINT8 value); SINT32 eg91_iccid_get(SF_CHAR *iccid,SF_FN_PARAM_S *pfnParam); SINT32 eg91_qsclk_set(SF_FN_PARAM_S *pfnParam); 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 ca796cc95..dbdd40aee 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 @@ -42,7 +42,7 @@ BOOL GprsNetWorkReady = FALSE; time_t sendStartTime; UINT8 gprs_search_process = GPRS_SEARCH_STEP_IDLE; extern SF_PARA_TIME_S rtcTime; -CHAR netGeneration = SF_NET_NO; +static CHAR netGeneration = SF_NET_NO; // SF_PARA_TIME_S nowDate = { 0, 0, 0, 0, 0, 0}; typedef struct sf_cimi_id @@ -54,6 +54,22 @@ typedef struct sf_cimi_id sf_cimi_id_t cimi_head = { .id = 1, .cimi = "0", .next = NULL }; +UINT8 sf_get_net_generation(void) +{ + return netGeneration; +} + +void sf_set_net_generation(UINT8 value) +{ + if((value >= SF_NET_NO) && (value <= SF_NET_4G)) + { + netGeneration = value; + } + else + { + printf("[%s:%d]value(%d) invalid,no set.\n", __FUNCTION__, __LINE__, value); + } +} UINT8 sf_qcsq_decode(char *instr, UINT8 *csqVal) { char *pStr = NULL; @@ -1784,28 +1800,28 @@ SINT32 eg91_register_net_auto(SF_FN_PARAM_S *pfnParam) SLOGI("%s", ttyData); if(strstr(ttyData, "No Service")) { - pStaticParam->NetGeneration = 2; + sf_set_net_generation(2); }else if (NULL != strtok(ttyData,"\"")){ SF_CHAR netStr[20] = { 0 }; strcpy(netStr, strtok(NULL,"\"")); MLOGD("netStr:%s\n", netStr); if((strstr(netStr,"DD") != NULL)) { - pStaticParam->NetGeneration = 4; + sf_set_net_generation(4); } else if(strstr(netStr, "CDMA") != NULL || strstr(netStr, "HDR") != NULL \ || strstr(netStr, "HSUPA") != NULL || strstr(netStr, "HSDPA") != NULL \ || strstr(netStr, "HSPA+") != NULL) { - pStaticParam->NetGeneration = 3; + sf_set_net_generation(3); } else { - pStaticParam->NetGeneration = 2; + sf_set_net_generation(2); } } - if(pStaticParam->NetGeneration == 4)//NetGeneration == 4 + if(sf_get_net_generation() == 4)//NetGeneration == 4 { enMmcLocation = SIM_REG_NET_QCSQ; sprintf(ttyData, "AT+QCSQ\r"); @@ -2080,24 +2096,24 @@ SINT32 eg91_register_net_manual(SF_FN_PARAM_S *pfnParam) SLOGI("%s", ttyData); if(strstr(ttyData, "No Service")) { - pStaticParam->NetGeneration = 2; + sf_set_net_generation(2); }else if (NULL != strtok(ttyData,"\"")){ SF_CHAR netStr[20] = { 0 }; strcpy(netStr, strtok(NULL,"\"")); MLOGD("netStr:%s\n", netStr); if((strstr(netStr,"DD") != NULL)) { - pStaticParam->NetGeneration = 4; + sf_set_net_generation(4); } else if(strstr(netStr, "CDMA") != NULL || strstr(netStr, "HDR") != NULL \ || strstr(netStr, "HSUPA") != NULL || strstr(netStr, "HSDPA") != NULL \ || strstr(netStr, "HSPA+") != NULL) { - pStaticParam->NetGeneration = 3; + sf_set_net_generation(3); } else { - pStaticParam->NetGeneration = 2; + sf_set_net_generation(2); } } @@ -2122,7 +2138,7 @@ SINT32 eg91_register_net_manual(SF_FN_PARAM_S *pfnParam) printf("cops2 is %s\r\n", pStaticParam->ServiceProvider); } - if(pStaticParam->NetGeneration == 4)//NetGeneration == 4 + if(sf_get_net_generation() == 4)//NetGeneration == 4 { enMmcLocation = SIM_REG_NET_QCSQ; sprintf(ttyData, "AT+QCSQ\r"); @@ -3766,8 +3782,7 @@ SINT32 sf_net_regist_manual(void) { if(strstr((const char *)gsmPara, "No Service")) { - //puiPara->NetGeneration = 2; - netGeneration = 2; + sf_set_net_generation(2); } else if(NULL != strtok((char *)(char *)gsmPara, "\"")) { @@ -3776,30 +3791,23 @@ SINT32 sf_net_regist_manual(void) if((strstr((const char *)netStr, "DD") != NULL)) { - //puiPara->NetGeneration = 4; - netGeneration = 4; + sf_set_net_generation(4); } else if(strstr((const char *)netStr, "CDMA") != NULL || strstr((const char *)netStr, "HDR") != NULL || strstr((const char *)netStr, "HSUPA") != NULL || strstr((const char *)netStr, "HSDPA") != NULL || (strstr((const char *)netStr, "HSPA+") != NULL)) { - //puiPara->NetGeneration = 3; - netGeneration = 3; + sf_set_net_generation(3); } else if(strstr((const char *)netStr, "CMDA") != NULL || strstr((const char *)netStr, "G") != NULL) { - //puiPara->NetGeneration = 2; - netGeneration = 2; + sf_set_net_generation(2); } else { - // puiPara->NetGeneration = 2; - netGeneration = 2; + sf_set_net_generation(2); } } - if(puiPara->NetGeneration != netGeneration) - { - puiPara->NetGeneration = netGeneration; - } + if(netGeneration == 4) { eNetRegLocation = QUECTEL_NETREG_QCSQ; @@ -4598,8 +4606,7 @@ SINT32 sf_auto_net_reg(void) { if(strstr((const char *)gsmPara, "No Service")) { - //puiPara->NetGeneration = 2; - netGeneration = 2; + sf_set_net_generation(2); } else if(NULL != strtok((char *)(char *)gsmPara, "\"")) { @@ -4608,30 +4615,23 @@ SINT32 sf_auto_net_reg(void) if((strstr((const char *)netStr, "DD") != NULL)) { - // puiPara->NetGeneration = 4; - netGeneration = 4; + sf_set_net_generation(4); } else if(strstr((const char *)netStr, "CDMA") != NULL || strstr((const char *)netStr, "HDR") != NULL || strstr((const char *)netStr, "HSUPA") != NULL || strstr((const char *)netStr, "HSDPA") != NULL || (strstr((const char *)netStr, "HSPA+") != NULL)) { - // puiPara->NetGeneration = 3; - netGeneration = 3; + sf_set_net_generation(3); } else if(strstr((const char *)netStr, "CMDA") != NULL || strstr((const char *)netStr, "G") != NULL) { - // puiPara->NetGeneration = 2; - netGeneration = 2; + sf_set_net_generation(2); } else { - // puiPara->NetGeneration = 2; - netGeneration = 2; + sf_set_net_generation(2); } } - if(puiPara->NetGeneration != netGeneration) - { - puiPara->NetGeneration = netGeneration; - } + if(netGeneration == 4) { eNetRegLocation = QUECTEL_NETREG_QCSQ; 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 db6d1c9fe..4c296a8b8 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 @@ -895,15 +895,15 @@ SINT32 sf_pic_send_ftp(void) //sendStartTime = sf_sys_os_utime_get()/1000; sf_custom_str_get(CamNameStr); - sf_4G_signal_level_get(pPara->NetGeneration,sf_get_cq_signal(),&csqlevel); + sf_4G_signal_level_get(sf_get_net_generation(),sf_get_cq_signal(),&csqlevel); snprintf(cameraID, sizeof(cameraID), "%s-%d-%d-%s-", pPara->ModuleImei, sf_app_get_battery(), csqlevel, CamNameStr); /* DCF 8.3 naming rule */ - if(4 == pPara->NetGeneration) + if(4 == sf_get_net_generation()) { tempPicSize = pPara->SendPicSize; } - else if(3 == pPara->NetGeneration) + else if(3 == sf_get_net_generation()) { tempPicSize = ((1 <= pPara->SendPicSize) ? 1 : 0); } @@ -936,7 +936,7 @@ SINT32 sf_pic_send_ftp(void) // piccount = 1; // } // } - MLOGI("NetGeneration:%dG,tempPicSize=%d,piccount=%d,filecnt=%d\n", pPara->NetGeneration, tempPicSize, piccount, pThumbFileCfg->filecnt); + MLOGI("netGeneration:%dG,tempPicSize=%d,piccount=%d,filecnt=%d\n", sf_get_net_generation(), tempPicSize, piccount, pThumbFileCfg->filecnt); //printf("[%s:%d]piccount=%d\n", __FUNCTION__, __LINE__, piccount); @@ -1052,11 +1052,11 @@ SINT32 sf_video_send_ftp(void) MLOGD("start\n"); sf_custom_str_get(CamNameStr); - sf_4G_signal_level_get(pPara->NetGeneration,sf_get_cq_signal(),&csqlevel); + sf_4G_signal_level_get(sf_get_net_generation(),sf_get_cq_signal(),&csqlevel); snprintf(cameraID, sizeof(cameraID), "%s-%d-%d-%s-", pPara->ModuleImei, sf_app_get_battery(), csqlevel, CamNameStr); /* DCF 8.3 naming rule */ - printf("NetGeneration:%dG,tempPicSize=%d,piccount=%d,pic=%d\n", pPara->NetGeneration, tempPicSize, piccount, pic); + printf("netGeneration:%dG,tempPicSize=%d,piccount=%d,pic=%d\n", sf_get_net_generation(), tempPicSize, piccount, pic); /*sf_get_send_video_fname(videoDirKey, videoFname); sprintf((char *)ftpFileName, "%s%s", cameraID, videoFname); @@ -1238,7 +1238,7 @@ SINT32 sf_send_file_to_ftp(UINT8 mode) if(mode == 1 ) //send Original+video { - if(((puiPara->CamMode == SF_CAM_MODE_VIDEO) || (puiPara->CamMode == SF_CAM_MODE_PHOTO_VIDEO) || (puiPara->CamMode == SF_CAM_MODE_VIDEO2)) && (puiPara->SendVideoSwitch == 1) && (puiPara->NetGeneration == 4)) //video + if(((puiPara->CamMode == SF_CAM_MODE_VIDEO) || (puiPara->CamMode == SF_CAM_MODE_PHOTO_VIDEO) || (puiPara->CamMode == SF_CAM_MODE_VIDEO2)) && (puiPara->SendVideoSwitch == 1) && (sf_get_net_generation() == 4)) //video { timeout = 120000; } @@ -1278,9 +1278,9 @@ SINT32 sf_send_file_to_ftp(UINT8 mode) } } - printf("[%s:%d]puiPara->NetGeneration=%d\n", __FUNCTION__, __LINE__, puiPara->NetGeneration); + printf("[%s:%d]netGeneration=%d\n", __FUNCTION__, __LINE__, sf_get_net_generation()); - if(((puiPara->CamMode == SF_CAM_MODE_VIDEO) || (puiPara->CamMode == SF_CAM_MODE_PHOTO_VIDEO) || (puiPara->CamMode == SF_CAM_MODE_VIDEO2)) && (puiPara->SendVideoSwitch == 1) && (puiPara->NetGeneration == 4)) //video + if(((puiPara->CamMode == SF_CAM_MODE_VIDEO) || (puiPara->CamMode == SF_CAM_MODE_PHOTO_VIDEO) || (puiPara->CamMode == SF_CAM_MODE_VIDEO2)) && (puiPara->SendVideoSwitch == 1) && (sf_get_net_generation() == 4)) //video { if(smtpUploadVideoFlag == 0) { @@ -1319,7 +1319,7 @@ SINT32 sf_send_file_to_ftp(UINT8 mode) if(ret1 != SF_FTP_ERROR_TERM) { - ret2 = sf_ftp_stop(ssl, gprsMode); + //ret2 = sf_ftp_stop(ssl, gprsMode); } #if SF_TEST_ERROR_CODE @@ -1427,7 +1427,7 @@ SINT32 sf_connect_ftps_server(void) gprsMode = 0;//puiPara->GprsMode; printf("[%s:%d] ssl:%d,GprsMode:%d\n", __FUNCTION__, __LINE__, ssl, gprsMode); - if(((puiPara->CamMode == SF_CAM_MODE_VIDEO) || (puiPara->CamMode == SF_CAM_MODE_PHOTO_VIDEO) || (puiPara->CamMode == SF_CAM_MODE_VIDEO2)) && (puiPara->SendVideoSwitch == 1) && (puiPara->NetGeneration == 4)) //video + if(((puiPara->CamMode == SF_CAM_MODE_VIDEO) || (puiPara->CamMode == SF_CAM_MODE_PHOTO_VIDEO) || (puiPara->CamMode == SF_CAM_MODE_VIDEO2)) && (puiPara->SendVideoSwitch == 1) && (sf_get_net_generation() == 4)) //video { timeout = 60000; } @@ -1442,7 +1442,7 @@ SINT32 sf_connect_ftps_server(void) { FtpOpenOk = SUCCESS; } - ret = sf_ftp_stop(ssl, gprsMode); + //ret = sf_ftp_stop(ssl, gprsMode); //SF_FTP_CONNECT_END: //printf("[%s:%d]ret:[0x%08X]\n\n", __FUNCTION__, __LINE__, ret); @@ -1561,7 +1561,7 @@ SINT32 sf_concentrated_ftp_send(void) // SINT64 sendStartTime = 0; SINT64 sendEndTime = 0; sf_custom_str_get(CamNameStr); - sf_4G_signal_level_get(pPara->NetGeneration,sf_get_cq_signal(),&csqlevel); + sf_4G_signal_level_get(sf_get_net_generation(),sf_get_cq_signal(),&csqlevel); // sendStartTime = sf_sys_os_utime_get()/1000; @@ -1676,7 +1676,7 @@ SF_CONCENTRATED_END: if(ret1 != SF_FTP_ERROR_TERM) { - ret2 = sf_ftp_stop(ssl, gprsMode); + //ret2 = sf_ftp_stop(ssl, gprsMode); } #if SF_TEST_ERROR_CODE @@ -1748,7 +1748,7 @@ SINT32 sf_hd_ftp_send(void) sf_set_send_hd(0); sf_custom_str_get(CamNameStr); - sf_4G_signal_level_get(pPara->NetGeneration,sf_get_cq_signal(),&csqlevel); + sf_4G_signal_level_get(sf_get_net_generation(),sf_get_cq_signal(),&csqlevel); // sendStartTime = sf_sys_os_utime_get()/1000; @@ -1858,7 +1858,7 @@ SF_HD_END: if(ret1 != SF_FTP_ERROR_TERM) { - ret2 = sf_ftp_stop(ssl, gprsMode); + //ret2 = sf_ftp_stop(ssl, gprsMode); } #if SF_TEST_ERROR_CODE @@ -1969,7 +1969,7 @@ SINT32 sf_video_ftp_send(void) sf_set_send_video(0); sf_custom_str_get(CamNameStr); - sf_4G_signal_level_get(pPara->NetGeneration,sf_get_cq_signal(),&csqlevel); + sf_4G_signal_level_get(sf_get_net_generation(),sf_get_cq_signal(),&csqlevel); // sendStartTime = sf_sys_os_utime_get()/1000; @@ -2084,7 +2084,7 @@ SF_VIDEO_END: if(ret1 != SF_FTP_ERROR_TERM) { - ret2 = sf_ftp_stop(ssl, gprsMode); + //ret2 = sf_ftp_stop(ssl, gprsMode); } #if SF_TEST_ERROR_CODE @@ -2176,7 +2176,7 @@ SINT32 sf_log_send_ftp(void) } if(ret != SF_FTP_ERROR_TERM) { - ret2 = sf_ftp_stop(ssl, gprsMode); + //ret2 = sf_ftp_stop(ssl, gprsMode); } #if SF_TEST_ERROR_CODE @@ -2295,7 +2295,7 @@ SINT32 sf_gps_send_ftp(void) } if(ret != SF_FTP_ERROR_TERM) { - ret2 = sf_ftp_stop(ssl, gprsMode); + //ret2 = sf_ftp_stop(ssl, gprsMode); } #if SF_TEST_ERROR_CODE @@ -2985,11 +2985,11 @@ SINT32 sf_test_send_file_to_ftp(void) MLOGD("start\n"); sf_custom_str_get(CamNameStr); - sf_4G_signal_level_get(puiPara->NetGeneration,sf_get_cq_signal(),&csqlevel); + sf_4G_signal_level_get(sf_get_net_generation(),sf_get_cq_signal(),&csqlevel); snprintf(cameraID, sizeof(cameraID), "%s-%d-%d-%s-", puiPara->ModuleImei, sf_app_get_battery(), csqlevel, CamNameStr); /* DCF 8.3 naming rule */ - printf("NetGeneration:%dG,tempPicSize=%d,piccount=%d,pic=%d\n", puiPara->NetGeneration, tempPicSize, piccount, pic); + printf("netGeneration:%dG,tempPicSize=%d,piccount=%d,pic=%d\n", sf_get_net_generation(), tempPicSize, piccount, pic); sprintf((char *)ftpFileName, "%sMEMPHOTO.JPG", cameraID); sprintf((char *)filePath, "UFS:MEMPHOTO.JPG"); @@ -3082,7 +3082,7 @@ SINT32 sf_card_log_send_ftp(void) } if(ret != SF_FTP_ERROR_TERM) { - ret2 = sf_ftp_stop(ssl, gprsMode); + //ret2 = sf_ftp_stop(ssl, gprsMode); } MLOGD(" end ret:[0x%08X],ret2:[0x%08X]\n", ret, ret2); diff --git a/code/application/source/sf_app/code/source/app/sf_device.c b/code/application/source/sf_app/code/source/app/sf_device.c index 134b8e691..712666c74 100755 --- a/code/application/source/sf_app/code/source/app/sf_device.c +++ b/code/application/source/sf_app/code/source/app/sf_device.c @@ -355,6 +355,7 @@ SINT32 sf_app_cq_signal_to_cardv(void) stMessageBuf.cmdId = CMD_GPRS; stMessageBuf.arg1 = SF_GPRS_CMD_SIGNAL; stMessageBuf.arg2 = sf_get_cq_signal(); + stMessageBuf.arg3 = ((SINT32)(((sf_get_sim_insert()) << 16) | (sf_get_net_generation()))); sf_com_message_send_to_cardv(&stMessageBuf); return SF_SUCCESS; } @@ -383,7 +384,6 @@ void sf_signal_led_show(UINT8 signalLevel) SINT32 app_led_net_reg_stop(SINT32 s32ret) { - UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); //UINT8 netSearchStep = sf_get_netsearch_step(); UINT8 signalLevel = 0; sf_app_cq_signal_to_cardv(); @@ -419,7 +419,7 @@ SINT32 app_led_net_reg_stop(SINT32 s32ret) sf_sys_status_led_set(SF_LED_SYS_STATE_SERVER_FAIL); } else { - sf_4G_signal_level_get(puiPara->NetGeneration,sf_get_cq_signal(),&signalLevel); + sf_4G_signal_level_get(sf_get_net_generation(),sf_get_cq_signal(),&signalLevel); MLOGI("signalLevel = %d\n",signalLevel); // sf_app_cq_signal_to_cardv(); sf_signal_led_show(signalLevel); 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 7492e3f82..85e1c2710 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 @@ -565,11 +565,11 @@ SINT32 sf_upload_send_files_to_module(UINT8 mode) //sf_custom_str_get(customStr); - if(4 == pPara->NetGeneration) + if(4 == sf_get_net_generation()) { tempPicSize = pPara->SendPicSize; } - else if(3 == pPara->NetGeneration) + else if(3 == sf_get_net_generation()) { tempPicSize = ((1 <= pPara->SendPicSize) ? 1 : 0); } @@ -601,7 +601,7 @@ SINT32 sf_upload_send_files_to_module(UINT8 mode) } else if(mode == 1) { - printf("NetGeneration:%dG,tempPicSize=%d,piccount=%d,pic=%d\n", pPara->NetGeneration, tempPicSize, piccount, pic); + printf("netGeneration:%dG,tempPicSize=%d,piccount=%d,pic=%d\n", sf_get_net_generation(), tempPicSize, piccount, pic); SendPicSize = tempPicSize; @@ -657,7 +657,7 @@ SINT32 sf_upload_send_files_to_module(UINT8 mode) printf("[%s:%d]before,piccount=%d\n", __FUNCTION__, __LINE__, piccount); - if(4 == pPara->NetGeneration) + if(4 == sf_get_net_generation()) { if(piccount >= 2) { @@ -1008,8 +1008,8 @@ UINT32 sf_create_dailyreport_file(void) gpsStrTemp[0] = '\0'; }*/ - //csqlevel = sf_signal_level_get(pPara->NetGeneration, sf_get_cq_signal()); - sf_4G_signal_level_get(pPara->NetGeneration,sf_get_cq_signal(),&csqlevel); + //csqlevel = sf_signal_level_get(sf_get_net_generation(), sf_get_cq_signal()); + sf_4G_signal_level_get(sf_get_net_generation(),sf_get_cq_signal(),&csqlevel); if(pPara->DateStyle == SF_DATE_TIME_YYMMDD) { sprintf(tmpDate, "%d/%02d/%02d %02d:%02d:%02d", drRtcTime.Year, drRtcTime.Mon, drRtcTime.Day, drRtcTime.Hour, drRtcTime.Min, drRtcTime.Sec); @@ -1036,7 +1036,7 @@ UINT32 sf_create_dailyreport_file(void) "Total Pics Sent:%ld\r\n", \ pPara->ModuleImei, \ csqlevel, \ - pPara->NetGeneration, \ + sf_get_net_generation(), \ cameraID, \ str, \ tmpDate, \ 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 76b4dc56d..38036be30 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 @@ -34,6 +34,7 @@ #include "sf_sms.h" #include "sf_system.h" #include "sf_message_queue.h" +#include "sf_eg91_sim.h" #ifdef __cplusplus #if __cplusplus extern "C" { @@ -912,7 +913,11 @@ unsigned char sf_mcu_reg_set(MCUParam_t attrId, unsigned char val) sf_debug_save_log(); } #endif - sf_mcu_write_multi(mcuReg, mcuData, i); + if(FAIL == sf_mcu_write_multi(mcuReg, mcuData, i)) + { + sf_sleep_ms(200); + sf_mcu_write_multi(mcuReg, mcuData, i); + } return SUCCESS; } @@ -1267,9 +1272,7 @@ UINT32 sf_get_sim_insert(void) void sf_set_cq_signal(UINT8 csq) { - UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); - - if(((puiPara->NetGeneration == 4) && (csq > 0) && (csq < 129)) || ((puiPara->NetGeneration < 4) && (csq > 1) && (csq < 32))) + if(((sf_get_net_generation() == 4) && (csq > 0) && (csq < 129)) || ((sf_get_net_generation() < 4) && (csq > 1) && (csq < 32))) { cq_Signal = csq; isSignalReady = 1; diff --git a/code/lib/source/sifar/code/include/sf_common.h b/code/lib/source/sifar/code/include/sf_common.h index 62830bdeb..47409f9ca 100755 --- a/code/lib/source/sifar/code/include/sf_common.h +++ b/code/lib/source/sifar/code/include/sf_common.h @@ -192,4 +192,6 @@ void sf_set_rtsp_flag(UINT8 flag); char sf_get_cammode_statu(void); void sf_set_cammode_statu(char is); BOOL sf_set_backlight_status(unsigned char argc, char **argv); +UINT8 sf_get_net_generation(void); +void sf_set_net_generation(UINT8 value); #endif 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 9e5f0a26c..453e6d5cb 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -101,6 +101,7 @@ static SF_BLE_STATUS_E BleStatus = SF_BLE_OK; static UINT8 McuUpdateFlag = 0; static SF_GPS_STATUS_E gGpsSearching = SF_GPS_SEARCHING_UNKNOW; static char CamMode = 0; +static CHAR netGeneration = SF_NET_NO; static SF_THREAD_S UpgradeTskParam = { .IsRun = 0, @@ -1794,6 +1795,8 @@ static SINT32 sf_cardv_proccess_cmd_gprs(SF_MESSAGE_BUF_S *pMessageBuf) { case SF_GPRS_CMD_SIGNAL: cq_Signal = pMessageBuf->arg2; + sf_set_net_generation(pMessageBuf->arg3 & 0xFF); + sf_cardv_set_sim_insert((pMessageBuf->arg3>>16)&0x0F); break; default: @@ -3395,3 +3398,20 @@ BOOL sf_set_backlight_status(unsigned char argc, char **argv) return TRUE; } + +UINT8 sf_get_net_generation(void) +{ + return netGeneration; +} + +void sf_set_net_generation(UINT8 value) +{ + if((value >= SF_NET_NO) && (value <= SF_NET_4G)) + { + netGeneration = value; + } + else + { + printf("[%s:%d]value(%d) invalid,no set.\n", __FUNCTION__, __LINE__, value); + } +} \ No newline at end of file diff --git a/code/lib/source/sifar/code/source/module/sf_sim.c b/code/lib/source/sifar/code/source/module/sf_sim.c index 7b234cd7a..e2cfc6801 100644 --- a/code/lib/source/sifar/code/source/module/sf_sim.c +++ b/code/lib/source/sifar/code/source/module/sf_sim.c @@ -138,7 +138,6 @@ SINT32 sf_module_init(VOID) UIMenuStoreInfo *pPara = sf_ui_para_get(); needRecordLogFlag = 1; - pPara->NetGeneration = SF_NET_NO; sf_4g_data_buff_clear(); sf_gsm_para_buff_clear(); From 52f09283fc587529508a4dc6e2f863b681ef7836 Mon Sep 17 00:00:00 2001 From: payton Date: Mon, 18 Dec 2023 13:55:36 +0800 Subject: [PATCH 18/21] =?UTF-8?q?1.=E9=A2=84=E7=BA=A6=E5=8F=91=E9=80=81?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E6=96=87=E4=BB=B6=E6=98=AF=E5=90=A6=E5=AD=98?= =?UTF-8?q?=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/sf_app/code/source/4gMng/sf_sms.c | 42 ++++++++++++++++--- 1 file changed, 37 insertions(+), 5 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 489632da4..542d853e4 100755 --- a/code/application/source/sf_app/code/source/4gMng/sf_sms.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_sms.c @@ -1975,12 +1975,17 @@ void sf_hd_pic_add_to_list(UINT8 *fileName) UINT8 tempStr[20] = {0}; SubImgList_t *pList = pSubImgListHead; SubImgList_t *qList = pSubImgListHead; - + char fname[50] = {0}; printf("[%s:%d] add to list:%s\n", __FUNCTION__, __LINE__, fileName); SF_STRNCPY(tempStr, fileName+1, 3); dirKey = atoi((const char *)tempStr); fileKey = atoi((const char *)fileName+4); - + SF_SPRINTF(fname, "%s/%03dMEDIA/%s%04d.JPG", SF_DCIM_DIR, dirKey, DCF_FILE_NAME, fileKey); + if(sf_file_IsExsit(fname) != SF_TRUE) + { + MLOGE("%s\n", fname); + return; + } if(pSubImgListHead == NULL) { pSubImgListHead = (SubImgList_t *)malloc(sizeof(SubImgList_t)); @@ -2088,13 +2093,40 @@ void sf_video_add_to_list(UINT8 *fileName) SubImgList_t *qList = pSubVideoListHead; //sfPara_t* pSifarPara = sf_ParaGet(); //UINT8 subscribeMaxNum = SUBSCRIBE_MAX_NUM - pSifarPara->subscribeSendCnt; - + char fname[50] = {0}; + UINT32 fileSize = 0; + UINT32 fileIndex = 0; + UINT8 i = 0; + UINT16 dirKeytmp = 0; + UINT16 fileKeytmp = 0; printf("add to list:%s\n", fileName); SF_STRNCPY(tempStr, fileName+1, 3); dirKey = atoi((const char *)tempStr); fileKey = atoi((const char *)fileName+4); + fileIndex = dirKey * 10000 + fileKey + 1; + + for(i = 0; i < 3; i++) + { + dirKeytmp = fileIndex / 10000; + fileKeytmp = fileIndex % 10000; + SF_SPRINTF(fname, "%s/%03dMEDIA/%s%04d.MP4", SF_DCIM_DIR, dirKeytmp, DCF_FILE_NAME, fileKeytmp); + sf_file_size_get(fname,&fileSize); + printf("find video:%s size=%d\n", fname, fileSize); + + if(fileSize != 0) + { + break; + } + fileIndex++; + } + if(fileSize == 0) + { + MLOGE("No File %s\n", fname); + return; + } + if(pSubVideoListHead == NULL) { pSubVideoListHead = (SubImgList_t *)malloc(sizeof(SubImgList_t)); @@ -2167,10 +2199,10 @@ SINT32 sf_simcom_check_need_send(void) UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); UINT8 PowerOnMode = sf_poweron_type_get(); - printf("[%s:%d]sf_get_pic()=%d,puiPara->NetGeneration=%d\n", __FUNCTION__, __LINE__, sf_get_pic(), puiPara->NetGeneration); + printf("[%s:%d]sf_get_pic()=%d,netGeneration=%d\n", __FUNCTION__, __LINE__, sf_get_pic(), sf_get_net_generation()); if((sf_get_sim_insert()) && ((sf_get_mode_flag() == 1) || (PowerOnMode == PWR_ON_PIR) || (PowerOnMode == PWR_ON_TIMELAPSE) || (sf_get_pic() == SF_TRUE)) - && ((puiPara->SendPhotoSwitch == 1) || ((puiPara->CamMode == SF_CAM_MODE_VIDEO) && (puiPara->SendVideoSwitch == 1) && (puiPara->NetGeneration == 4)))) + && ((puiPara->SendPhotoSwitch == 1) || ((puiPara->CamMode == SF_CAM_MODE_VIDEO) && (puiPara->SendVideoSwitch == 1) && (sf_get_net_generation() == 4)))) { if((sf_check_ftp_send(1) == SF_SUCCESS)) { From a32f7c314a4b11fb81bc2633c50f48bb6db8a2b9 Mon Sep 17 00:00:00 2001 From: payton Date: Mon, 18 Dec 2023 13:56:32 +0800 Subject: [PATCH 19/21] =?UTF-8?q?1.1=E8=BF=9B=E5=85=A5setup=E4=BD=BF?= =?UTF-8?q?=E7=94=A8reboot=E9=87=8D=E5=90=AF=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/lib/source/sifar/code/source/mcu/sf_mcu_client.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 5f6483806..0125885b7 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 @@ -803,7 +803,14 @@ void sf_mcu_dataready_ck(UINT8 startMode) gModuleSleep = 0; //power off 4G module sf_set_power_off_flag(1); printf("[power off] %s(%d)\n", __FUNCTION__, __LINE__); - Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, 0); //shutdown start + if((startMode == 1) && (PWR_ON_AUTO == sf_cardv_convert_power_on_mode())) + { + system("reboot"); + } + else + { + Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, 0); //shutdown start + } } } From 47674661eaaeb17f1dfbbcf0d2c8a129bb2484b8 Mon Sep 17 00:00:00 2001 From: payton Date: Mon, 18 Dec 2023 16:29:54 +0800 Subject: [PATCH 20/21] =?UTF-8?q?1.ota=20cmd=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/lib/source/sifar/code/source/common/sf_common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 453e6d5cb..2b63c91ca 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -1352,7 +1352,11 @@ BOOL sf_cmd_ftp_ota(unsigned char argc, char **argv) //UINT32 value; UIMenuStoreInfo *puiPara = sf_ui_para_get(); if(4 == argc) - { + { + memset(puiPara ->OtaFtpIp,'\0', sizeof(puiPara ->OtaFtpIp)); + memset(puiPara ->OtaFtpPort, '\0', sizeof(puiPara ->OtaFtpPort)); + memset(puiPara ->OtaFtpUserName, '\0', sizeof(puiPara ->OtaFtpUserName)); + memset(puiPara ->OtaFtpPassWord,'\0', sizeof(puiPara ->OtaFtpPassWord)); strncpy((char *)puiPara->OtaFtpIp, argv[0], ((sizeof(puiPara->OtaFtpIp) <= strlen(argv[0])) ? (sizeof(puiPara->OtaFtpIp)) : (strlen(argv[0])))); strncpy((char *)puiPara->OtaFtpPort, argv[1], ((sizeof(puiPara->OtaFtpPort) <= strlen(argv[1])) ? (sizeof(puiPara->OtaFtpPort)) : (strlen(argv[1])))); strncpy((char *)puiPara->OtaFtpUserName, argv[2], ((sizeof(puiPara->OtaFtpUserName) <= strlen(argv[2])) ? (sizeof(puiPara->OtaFtpUserName)) : (strlen(argv[2])))); From 73c15c532c21c52e80b76271a770f8a3738e5f47 Mon Sep 17 00:00:00 2001 From: payton Date: Mon, 18 Dec 2023 16:30:16 +0800 Subject: [PATCH 21/21] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9ota?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/cardv/SrcCode/PrjCfg_HUNTING_S550.h | 4 ++-- .../application/source/sf_app/code/source/4gMng/sf_ftp.c | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h b/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h index 587c62976..918345cbe 100755 --- a/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h +++ b/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S550.h @@ -966,8 +966,8 @@ #define SF_HW_TEST DISABLE #define SF_MODULE_UP_FILE "EG915QNA.tar.bz2" #define SF_MODULE_UP_FILE_PATH "/mnt/sd/EG915QNA.tar.bz2" -#define SF_CAM_UP_FILE "S530.tar.bz2" -#define SF_CAM_UP_FILE_PATH "/mnt/sd/S530.tar.bz2" +#define SF_CAM_UP_FILE "CAM_OTA_S550/SPHOST_REVEAL.BIN" +#define SF_CAM_UP_FILE_PATH "/mnt/sd/FW98565A.bin" #define SF_CAMERA_GPS_INFO_FILENAME "/tmp/gps.txt" #define SF_UBOOT_UPDATA_FW ENABLE 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 4c296a8b8..e372ae237 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 @@ -1499,10 +1499,11 @@ SINT32 sf_camera_ota_ftp(void) } ret = ftp_download_file(SF_CAM_UP_FILE,SF_CAM_UP_FILE_PATH,0); - if(SUCCESS == ret){ - sprintf(Cmd, "tar -xjvf %s -C %s", SF_CAM_UP_FILE_PATH, SF_SD_ROOT); - MLOGD("%s\n", Cmd); - ret = system(Cmd); + //if(SUCCESS == ret) + { + // sprintf(Cmd, "tar -xjvf %s -C %s", SF_CAM_UP_FILE_PATH, SF_SD_ROOT); + // MLOGD("%s\n", Cmd); + // ret = system(Cmd); if(SUCCESS == ret){ sf_set_fw_update(1); sf_set_key_fw_update(sf_get_fw_update());