Merge branch 'Branch_S550_Fast' into Branch_S550_Fast_Emmc

This commit is contained in:
payton 2023-12-18 16:40:06 +08:00
commit 212f874943
34 changed files with 355 additions and 161 deletions

View File

@ -922,7 +922,7 @@
#define HUNTING_MCU_UART ENABLE #define HUNTING_MCU_UART ENABLE
#define HUNTING_IR_LED_940 ENABLE #define HUNTING_IR_LED_940 ENABLE
#define SF_EXIF_MN_BUF_SIZE 256 #define SF_EXIF_MN_BUF_SIZE 256
#define SF_BASE_VERSION "7MR5RCwDC03" #define SF_BASE_VERSION "7MR5RCwDC04"
#define HW_S530 DISABLE #define HW_S530 DISABLE
#define DCF_DIR_NAME "MEDIA" /* 100MEDIA */ #define DCF_DIR_NAME "MEDIA" /* 100MEDIA */
#define DCF_FILE_NAME "SYGW" /* SYFW0001.JPG */ #define DCF_FILE_NAME "SYGW" /* SYFW0001.JPG */
@ -966,8 +966,8 @@
#define SF_HW_TEST DISABLE #define SF_HW_TEST DISABLE
#define SF_MODULE_UP_FILE "EG915QNA.tar.bz2" #define SF_MODULE_UP_FILE "EG915QNA.tar.bz2"
#define SF_MODULE_UP_FILE_PATH "/mnt/sd/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 "CAM_OTA_S550/SPHOST_REVEAL.BIN"
#define SF_CAM_UP_FILE_PATH "/mnt/sd/S530.tar.bz2" #define SF_CAM_UP_FILE_PATH "/mnt/sd/FW98565A.bin"
#define SF_CAMERA_GPS_INFO_FILENAME "/tmp/gps.txt" #define SF_CAMERA_GPS_INFO_FILENAME "/tmp/gps.txt"
#define SF_UBOOT_UPDATA_FW ENABLE #define SF_UBOOT_UPDATA_FW ENABLE

View File

@ -417,11 +417,19 @@ BOOL System_GetShutdownBegin(void)
{ {
return g_IsShutdownBegin; return g_IsShutdownBegin;
} }
#define DO_NOT_SHOW_POWER_OFF 0
#define SHOW_POWER_OFF 1
INT32 System_OnShutdown(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) 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]); 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; g_IsShutdownBegin=TRUE;
#if (DISPLAY_FUNC == ENABLE) #if (DISPLAY_FUNC == ENABLE)
@ -468,7 +476,7 @@ INT32 System_OnShutdown(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
} else { } else {
#if (POWEROFFLOGO_FUNCTION == ENABLE) #if (POWEROFFLOGO_FUNCTION == ENABLE)
#if HUNTING_CAMERA_MCU == ENABLE #if HUNTING_CAMERA_MCU == ENABLE
if(sf_get_mode_flag()) if(sf_get_mode_flag() && SHOW_POWER_OFF == displayShow)
#endif #endif
{ {
GxDisplay_Set(LAYER_OSD1, LAYER_STATE_ENABLE, 0); //turn off OSD1 GxDisplay_Set(LAYER_OSD1, LAYER_STATE_ENABLE, 0); //turn off OSD1

View File

@ -263,7 +263,7 @@ SXCMD_ITEM("gprssw %", sf_cmd_gprs_switch, "gprssw 0/1")
SXCMD_ITEM("uiprint %", sf_cmd_para_printf, "uiprint") SXCMD_ITEM("uiprint %", sf_cmd_para_printf, "uiprint")
SXCMD_ITEM("blusw %", cmd_blu_switch, "blusw 0/1") SXCMD_ITEM("blusw %", cmd_blu_switch, "blusw 0/1")
SXCMD_ITEM("wifisw %", cmd_wifi_switch, "wifisw 0/1") SXCMD_ITEM("wifisw %", cmd_wifi_switch, "wifisw 0/1")
SXCMD_ITEM("lcdbk %", sf_set_backlight_status, "lcdbk 0/1")
#endif #endif

View File

@ -1289,7 +1289,7 @@
"height": 30, "height": 30,
"width": 90, "width": 90,
"x": 38, "x": 38,
"y": 10 "y": 5
}, },
"hidden": false, "hidden": false,
"locked": false, "locked": false,
@ -1346,7 +1346,7 @@
"height": 40, "height": 40,
"width": 38, "width": 38,
"x": 0, "x": 0,
"y": 0 "y": -5
}, },
"hidden": true, "hidden": true,
"locked": false, "locked": false,
@ -1886,7 +1886,7 @@
"event callback": "", "event callback": "",
"font type": "Font_Type0", "font type": "Font_Type0",
"geometry": { "geometry": {
"height": 3, "height": 2,
"width": 320, "width": 320,
"x": 0, "x": 0,
"y": 119 "y": 119
@ -1906,7 +1906,7 @@
}, },
"Text": { "Text": {
"text_color": "0xff0000", "text_color": "0xff0000",
"text_font": "montserrat 16 4bpp", "text_font": "SF-UI-Text-Medium 16 1bpp",
"text_opa": 0, "text_opa": 0,
"text_sel_bg_color": "0x00b495", "text_sel_bg_color": "0x00b495",
"text_sel_color": "0x3c3c3c" "text_sel_color": "0x3c3c3c"

View File

@ -2402,7 +2402,7 @@
"event callback": "", "event callback": "",
"font type": "Font_Type0", "font type": "Font_Type0",
"geometry": { "geometry": {
"height": 3, "height": 2,
"width": 320, "width": 320,
"x": 0, "x": 0,
"y": 119 "y": 119

View File

@ -1,3 +1,4 @@
#include "UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.h"
#include "UIFlowLVGL/UIFlowLVGL.h" #include "UIFlowLVGL/UIFlowLVGL.h"
#include "PrjInc.h" #include "PrjInc.h"
#include "ImageApp/ImageApp_Photo.h" #include "ImageApp/ImageApp_Photo.h"
@ -9,6 +10,7 @@
#define UPDATE_TIMEER_MS 200 #define UPDATE_TIMEER_MS 200
static lv_task_t* update_timer = NULL; static lv_task_t* update_timer = NULL;
static lv_group_t* gp = 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) static void set_indev_keypad_group(lv_obj_t* obj)
{ {
if(gp == NULL){ if(gp == NULL){
@ -37,7 +39,8 @@ static void task_update_timer_cb(lv_task_t* task)
closing_index ++; closing_index ++;
if (time_ms == 0) if (time_ms == 0)
{ {
Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, APP_POWER_OFF_APO); printf("task_update_timer_cb gPowerOff = %d\n", gPowerOff);
Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, gPowerOff);
if(update_timer){ if(update_timer){
lv_task_del(update_timer); lv_task_del(update_timer);
update_timer = NULL; update_timer = NULL;
@ -45,8 +48,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); lv_plugin_scr_open(UIFlowClose, NULL);
} }

View File

@ -3,5 +3,10 @@
#include "UIFlowLVGL/UIFlowMenuCommonConfirm/UIFlowMenuCommonConfirmAPI.h" #include "UIFlowLVGL/UIFlowMenuCommonConfirm/UIFlowMenuCommonConfirmAPI.h"
#include "UIFlowLVGL/UIFlowLVGL.h" #include "UIFlowLVGL/UIFlowLVGL.h"
#include "Resource/Plugin/lvgl_plugin.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*/ #endif /*UIFLOW_CLOSE_EVENT_CALLBACK_H*/

View File

@ -531,7 +531,7 @@ static void UIFlowMenuCommonConfirm_MessageBox_ValueChanged(lv_obj_t* obj, uint3
BKG_PostEvent(gBKGEvt); BKG_PostEvent(gBKGEvt);
} else if (gBKGEvt == NVTEVT_BKW_ENTER_WORK_MODE) } else if (gBKGEvt == NVTEVT_BKW_ENTER_WORK_MODE)
{ {
OpenClosingScreen(); OpenClosingScreen(DISPLAY_FINAL_DO_NOT_SHOW_POWER_OFF);
// BKG_PostEvent(gBKGEvt); // BKG_PostEvent(gBKGEvt);
// UIFlowMenuCommonConfirm_CloseScr(); // UIFlowMenuCommonConfirm_CloseScr();
} else if (gBKGEvt) { } else if (gBKGEvt) {

View File

@ -513,7 +513,8 @@ void show_send_time_page(lv_obj_t* obj, const int sendType)
gMatrixIndex = 0; gMatrixIndex = 0;
SendTimeIndex_0 = 0; SendTimeIndex_0 = 0;
SendTimeIndex_1 = 0; SendTimeIndex_1 = 0;
gSendType = sendType; #define OPTION_3 3
gSendType = sendType == OPTION_3 ? FOUR_TIME_DAY : sendType;
gPageNum = FIRST_PAGE; gPageNum = FIRST_PAGE;
unsigned short settingIndex = gPageNum * 2; unsigned short settingIndex = gPageNum * 2;
SendTimeMatrixObj_1 = NULL; SendTimeMatrixObj_1 = NULL;

View File

@ -1034,6 +1034,9 @@ static void UIFlowMenuCommonItem_ScrClose(lv_obj_t* obj)
Save_MenuInfo(); Save_MenuInfo();
LV_MenuItem_OnClose(obj); LV_MenuItem_OnClose(obj);
gMenuLuck = MENU_CLOSED; 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; gMenuLuck = MENU_UNLUCK;
#if HUNTING_CAMERA_MCU == ENABLE
sf_set_menu_open(FALSE);
#endif
} }

View File

@ -1285,7 +1285,7 @@ lv_obj_t* UIFlowMovie_create(){
lv_plugin_label_allocate_ext_attr(label_rec_time); 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_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_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_set_size(label_rec_time, 90, 30);
lv_obj_add_style(label_rec_time, 0, &label_rec_time_s0); 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_hidden(image_rec_ellipse, true);
lv_obj_set_click(image_rec_ellipse, false); lv_obj_set_click(image_rec_ellipse, false);
lv_obj_set_drag(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_obj_set_size(image_rec_ellipse, 38, 40);
lv_img_set_src(image_rec_ellipse, &sy_luzhi); lv_img_set_src(image_rec_ellipse, &sy_luzhi);
lv_obj_add_style(image_rec_ellipse, 0, &image_rec_ellipse_s0); 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(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); 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_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(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(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); 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_align(label_line, LV_LABEL_ALIGN_CENTER);
lv_label_set_long_mode(label_line, LV_LABEL_LONG_SROLL); lv_label_set_long_mode(label_line, LV_LABEL_LONG_SROLL);
lv_obj_set_pos(label_line, 0, 119); 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); lv_obj_add_style(label_line, 0, &label_line_s0);
label_line_scr_uiflowmovie = label_line; label_line_scr_uiflowmovie = label_line;

View File

@ -256,12 +256,12 @@ static void signal_icon_show(const short signal)
} }
static void update_4g_module_icon(void) 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 signal = SIGNAL_NOT_YET_GET;
static short searching_index = -1; static short searching_index = -1;
short signal_new = sf_cardv_get_cq_signal(); short signal_new = sf_cardv_get_cq_signal();
unsigned short signal_level = 0; 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); // printf("new signal = %d, old signal = %d\n", signal_new, signal);
if(SIGNAL_NOT_YET_GET == signal_new) 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_NET3G,
LV_PLUGIN_IMG_ID_SF_NET4G 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 SIM_CARD_NOT_INIT = 0;
const int NET_GENERATION_2G = 2; const int NET_GENERATION_2G = 2;
// const int NET_GENERATION_3G = 3; // const int NET_GENERATION_3G = 3;
const int NET_GENERATION_4G = 4; const int NET_GENERATION_4G = 4;
// puiPara->NetGeneration = NET_GENERATION_4G; // Test // puiPara->NetGeneration = NET_GENERATION_4G; // Test
if (SIM_CARD_NOT_INIT == puiPara->NetGeneration if (SIM_CARD_NOT_INIT == sf_get_net_generation()
|| puiPara->NetGeneration < NET_GENERATION_2G || sf_get_net_generation() < NET_GENERATION_2G
|| puiPara->NetGeneration > NET_GENERATION_4G) || sf_get_net_generation() > NET_GENERATION_4G)
{ {
lv_obj_set_hidden(image_4g_scr_uiflowmovie, true); lv_obj_set_hidden(image_4g_scr_uiflowmovie, true);
return; return;
} }
int index = puiPara->NetGeneration; int index = sf_get_net_generation();
lv_obj_set_hidden(image_4g_scr_uiflowmovie, false); lv_obj_set_hidden(image_4g_scr_uiflowmovie, false);
lv_plugin_img_set_src(image_4g_scr_uiflowmovie, res[index]); lv_plugin_img_set_src(image_4g_scr_uiflowmovie, res[index]);
} }

View File

@ -2374,7 +2374,7 @@ lv_obj_t* UIFlowPhoto_create(){
lv_label_set_align(label_line, LV_LABEL_ALIGN_CENTER); lv_label_set_align(label_line, LV_LABEL_ALIGN_CENTER);
lv_label_set_long_mode(label_line, LV_LABEL_LONG_SROLL); lv_label_set_long_mode(label_line, LV_LABEL_LONG_SROLL);
lv_obj_set_pos(label_line, 0, 119); 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); lv_obj_add_style(label_line, 0, &label_line_s0);
label_line_scr_uiflowphoto = label_line; label_line_scr_uiflowphoto = label_line;

View File

@ -47,9 +47,9 @@ static CHAR g_cSelftimerCntStr[8] = {0};
static lv_group_t* gp = NULL; static lv_group_t* gp = NULL;
static lv_task_t* task_selftimer = NULL; static lv_task_t* task_selftimer = NULL;
static lv_task_t* update_icons_timer = 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 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 unsigned int ShutDownTime = GO_TO_WORK_MODE_TIME;
static lv_task_t* task_qview = NULL; static lv_task_t* task_qview = NULL;
@ -546,12 +546,12 @@ static void update_4g_module_icon(void)
const int NET_GENERATION_2G = 2; const int NET_GENERATION_2G = 2;
// const int NET_GENERATION_3G = 3; // const int NET_GENERATION_3G = 3;
const int NET_GENERATION_4G = 4; 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 signal = SIGNAL_NOT_YET_GET;
static short searching_index = -1; static short searching_index = -1;
short signal_new = sf_cardv_get_cq_signal(); short signal_new = sf_cardv_get_cq_signal();
unsigned short signal_level = 0; 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); // printf("new signal = %d, old signal = %d\n", signal_new, signal);
if(SIGNAL_NOT_YET_GET == signal_new) if(SIGNAL_NOT_YET_GET == signal_new)
{ {
@ -561,7 +561,7 @@ static void update_4g_module_icon(void)
// printf(" searching ... [%d]\n", searching_index); // printf(" searching ... [%d]\n", searching_index);
signal_icon_show(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); lv_obj_set_hidden(label_tips_scr_uiflowphoto, true);
// Update the icon. // Update the icon.
@ -613,16 +613,16 @@ const int EMPTY_IMAGE = 0;
LV_PLUGIN_IMG_ID_SF_NET3G, LV_PLUGIN_IMG_ID_SF_NET3G,
LV_PLUGIN_IMG_ID_SF_NET4G 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 // puiPara->NetGeneration = NET_GENERATION_4G; // Test
if (SIM_CARD_NOT_INIT == puiPara->NetGeneration if (SIM_CARD_NOT_INIT == sf_get_net_generation()
|| puiPara->NetGeneration < NET_GENERATION_2G || sf_get_net_generation() < NET_GENERATION_2G
|| puiPara->NetGeneration > NET_GENERATION_4G) || sf_get_net_generation() > NET_GENERATION_4G)
{ {
lv_obj_set_hidden(image_4g_scr_uiflowphoto, true); lv_obj_set_hidden(image_4g_scr_uiflowphoto, true);
return; return;
} }
int index = puiPara->NetGeneration; int index = sf_get_net_generation();
lv_obj_set_hidden(image_4g_scr_uiflowphoto, false); lv_obj_set_hidden(image_4g_scr_uiflowphoto, false);
lv_plugin_img_set_src(image_4g_scr_uiflowphoto, res[index]); lv_plugin_img_set_src(image_4g_scr_uiflowphoto, res[index]);
} }
@ -1624,7 +1624,7 @@ static void task_update_icons_timer_cb(lv_task_t* task)
} }
else else
{ {
OpenClosingScreen(); OpenClosingScreen(DISPLAY_FINAL_DO_NOT_SHOW_POWER_OFF);
} }
} }
return; return;
@ -1653,6 +1653,7 @@ void UIFlowPhoto_UpdateInfo(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* msg)
case UIAPPPHOTO_CB_CAPSTART: case UIAPPPHOTO_CB_CAPSTART:
#if HUNTING_CAMERA_MCU == ENABLE #if HUNTING_CAMERA_MCU == ENABLE
sf_set_cap_statu(TRUE); sf_set_cap_statu(TRUE);
sf_set_cammode_statu(puiPara->CamMode);
#endif #endif
if(obj == UIFlowPhoto) if(obj == UIFlowPhoto)
@ -1679,7 +1680,7 @@ void UIFlowPhoto_UpdateInfo(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* msg)
UIFlowPhoto_BackPreviewHandle(); UIFlowPhoto_BackPreviewHandle();
#if HUNTING_CAMERA_MCU == ENABLE #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 #else
if(SysGetFlag(CamMode) == SF_CAM_MODE_PHOTO_VIDEO){ if(SysGetFlag(CamMode) == SF_CAM_MODE_PHOTO_VIDEO){
#endif #endif
@ -1913,7 +1914,6 @@ static void UIFlowPhoto_Key(lv_obj_t* obj, uint32_t key)
case LV_USER_KEY_RIGHT: case LV_USER_KEY_RIGHT:
{ {
//SF_WIFI_STATUS_E status = sf_get_wifi_status(); //SF_WIFI_STATUS_E status = sf_get_wifi_status();
ShutDownTime = MENU_GO_TO_WORK_MODE_TIME_S;
if(TRUE == sf_get_send_statu()) if(TRUE == sf_get_send_statu())
{ {
printf("\r\n[%s] line:%d %d running\n", __FUNCTION__, __LINE__,key); printf("\r\n[%s] line:%d %d running\n", __FUNCTION__, __LINE__,key);
@ -1985,7 +1985,7 @@ void UIFlowPhtot_KeyLongPress(lv_obj_t* obj, uint32_t key)
if (3 * 1000 <= KeyLeftPressingTimeMs) if (3 * 1000 <= KeyLeftPressingTimeMs)
{ {
// Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, APP_POWER_OFF_APO); // Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, APP_POWER_OFF_APO);
OpenClosingScreen(); OpenClosingScreen(DISPLAY_FINAL_DO_NOT_SHOW_POWER_OFF);
KeyLeftPressingTimeMs = 0; KeyLeftPressingTimeMs = 0;
} }
break; break;

View File

@ -41,26 +41,46 @@ static void task_msgbox_timer_cb(lv_task_t* task)
UINT16 autoOffTime = sf_get_auto_off_time(); UINT16 autoOffTime = sf_get_auto_off_time();
const lv_plugin_string_t* string = lv_plugin_get_string(msgID); const lv_plugin_string_t* string = lv_plugin_get_string(msgID);
autoClose = autoClose - 1000;
if (0 == autoClose || autoOffTime <= 10) if (0 == autoClose || autoOffTime <= 10)
{ {
lv_task_del(msgbox_timer); lv_task_del(msgbox_timer);
msgbox_timer = NULL; msgbox_timer = NULL;
if (msgbox) 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) if (0 == autoClose)
{ {
OpenClosingScreen(); // 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; return;
} }
autoClose = autoClose - 1000;
if(string){ if(string){
snprintf(buf, BUF_LENGTH, "%s\n\n%ds\r\n", string->ptr, autoClose/1000); snprintf(buf, BUF_LENGTH, "%s\n\n%ds\r\n", string->ptr, autoClose/1000);
// lv_msgbox_set_text(msgbox, buf); // lv_msgbox_set_text(msgbox, buf);
lv_label_set_text_fmt(label_msg_scr_uiflowwrnmsg, "%s", 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(); // update_icons();
return; 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); 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) // 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); 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); 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) } 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"); 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){ // if(auto_close_time_ms){
lv_msgbox_start_auto_close(msgbox, auto_close_time_ms); // lv_msgbox_start_auto_close(msgbox, auto_close_time_ms);
} // }
set_indev_keypad_group(msgbox); set_indev_keypad_group(msgbox);
if(msgbox_timer == NULL){ if(msgbox_timer == NULL){
@ -282,15 +308,19 @@ void message_box_wrnmsg_OnKeyMenu(lv_obj_t* msgbox)
void message_box_wrnmsg_OnKey(lv_obj_t* msgbox, uint32_t key) 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) switch(key)
{ {
case LV_USER_KEY_MENU: case LV_USER_KEY_MENU:
message_box_wrnmsg_OnKeyMenu(msgbox); // message_box_wrnmsg_OnKeyMenu(msgbox);
break; break;
//#NT#2023/11/14#Eric - begin //#NT#2023/11/14#Eric - begin
//#NT#Support IVOT_N12144_CO-148_A //#NT#Support IVOT_N12144_CO-148_A
case LV_KEY_ENTER: case LV_KEY_ENTER:
UIFlowWrnMsg_CloseScr(NVTEVT_NULL); // UIFlowWrnMsg_CloseScr(NVTEVT_NULL);
break; break;
//#NT#2023/11/14#Eric - end //#NT#2023/11/14#Eric - end
default: default:

View File

@ -69,7 +69,7 @@
#if SF_HW_TEST == ENABLE #if SF_HW_TEST == ENABLE
#define DEFAULT_MOVIE_SIZE MOVIE_SIZE_FRONT_1280x720P30 #define DEFAULT_MOVIE_SIZE MOVIE_SIZE_FRONT_1280x720P30
#else #else
#define DEFAULT_MOVIE_SIZE MOVIE_SIZE_CLONE_1920x1080P30_1920x1080P25 #define DEFAULT_MOVIE_SIZE MOVIE_SIZE_FRONT_1920x1080P30
#endif #endif
#endif #endif
#else #else

View File

@ -505,6 +505,10 @@ void Load_MenuInfo(void)
#if HUNTING_CAMERA_MCU == ENABLE #if HUNTING_CAMERA_MCU == ENABLE
if(sf_get_ui_para_flag()) if(sf_get_ui_para_flag())
{ {
if(!sf_is_usb_flag())
{
sf_mcu_reg_set(SF_MCU_SOFT_UPDATE, 0);
}
memcpy(&origInfo, &currentInfo, sizeof(currentInfo)); memcpy(&origInfo, &currentInfo, sizeof(currentInfo));
memcpy(&origInfo_check, &currentInfo, sizeof(currentInfo)); memcpy(&origInfo_check, &currentInfo, sizeof(currentInfo));
return; return;
@ -515,10 +519,14 @@ void Load_MenuInfo(void)
#if HUNTING_CAMERA_MCU == ENABLE #if HUNTING_CAMERA_MCU == ENABLE
sf_power_on_para_check_init(); sf_power_on_para_check_init();
if(sf_is_usb_flag()) if(sf_is_usb_flag())
{ {
Save_MenuInfo(); Save_MenuInfo();
} }
else
{
sf_mcu_reg_set(SF_MCU_SOFT_UPDATE, 0);
}
#endif #endif
#if HUNTING_CAMERA_MCU == ENABLE #if HUNTING_CAMERA_MCU == ENABLE
//origInfo = currentInfo; //origInfo = currentInfo;

View File

@ -279,6 +279,8 @@ typedef enum SIM_ERR_CODE_s{
SIM_FAILED, SIM_FAILED,
}SIM_ERR_CODE; }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_iccid_get(SF_CHAR *iccid,SF_FN_PARAM_S *pfnParam);
SINT32 eg91_qsclk_set(SF_FN_PARAM_S *pfnParam); SINT32 eg91_qsclk_set(SF_FN_PARAM_S *pfnParam);

View File

@ -42,7 +42,7 @@ BOOL GprsNetWorkReady = FALSE;
time_t sendStartTime; time_t sendStartTime;
UINT8 gprs_search_process = GPRS_SEARCH_STEP_IDLE; UINT8 gprs_search_process = GPRS_SEARCH_STEP_IDLE;
extern SF_PARA_TIME_S rtcTime; 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}; // SF_PARA_TIME_S nowDate = { 0, 0, 0, 0, 0, 0};
typedef struct sf_cimi_id 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 }; 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) UINT8 sf_qcsq_decode(char *instr, UINT8 *csqVal)
{ {
char *pStr = NULL; char *pStr = NULL;
@ -1784,28 +1800,28 @@ SINT32 eg91_register_net_auto(SF_FN_PARAM_S *pfnParam)
SLOGI("%s", ttyData); SLOGI("%s", ttyData);
if(strstr(ttyData, "No Service")) if(strstr(ttyData, "No Service"))
{ {
pStaticParam->NetGeneration = 2; sf_set_net_generation(2);
}else if (NULL != strtok(ttyData,"\"")){ }else if (NULL != strtok(ttyData,"\"")){
SF_CHAR netStr[20] = { 0 }; SF_CHAR netStr[20] = { 0 };
strcpy(netStr, strtok(NULL,"\"")); strcpy(netStr, strtok(NULL,"\""));
MLOGD("netStr:%s\n", netStr); MLOGD("netStr:%s\n", netStr);
if((strstr(netStr,"DD") != NULL)) if((strstr(netStr,"DD") != NULL))
{ {
pStaticParam->NetGeneration = 4; sf_set_net_generation(4);
} }
else if(strstr(netStr, "CDMA") != NULL || strstr(netStr, "HDR") != NULL \ else if(strstr(netStr, "CDMA") != NULL || strstr(netStr, "HDR") != NULL \
|| strstr(netStr, "HSUPA") != NULL || strstr(netStr, "HSDPA") != NULL \ || strstr(netStr, "HSUPA") != NULL || strstr(netStr, "HSDPA") != NULL \
|| strstr(netStr, "HSPA+") != NULL) || strstr(netStr, "HSPA+") != NULL)
{ {
pStaticParam->NetGeneration = 3; sf_set_net_generation(3);
} }
else 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; enMmcLocation = SIM_REG_NET_QCSQ;
sprintf(ttyData, "AT+QCSQ\r"); sprintf(ttyData, "AT+QCSQ\r");
@ -2080,24 +2096,24 @@ SINT32 eg91_register_net_manual(SF_FN_PARAM_S *pfnParam)
SLOGI("%s", ttyData); SLOGI("%s", ttyData);
if(strstr(ttyData, "No Service")) if(strstr(ttyData, "No Service"))
{ {
pStaticParam->NetGeneration = 2; sf_set_net_generation(2);
}else if (NULL != strtok(ttyData,"\"")){ }else if (NULL != strtok(ttyData,"\"")){
SF_CHAR netStr[20] = { 0 }; SF_CHAR netStr[20] = { 0 };
strcpy(netStr, strtok(NULL,"\"")); strcpy(netStr, strtok(NULL,"\""));
MLOGD("netStr:%s\n", netStr); MLOGD("netStr:%s\n", netStr);
if((strstr(netStr,"DD") != NULL)) if((strstr(netStr,"DD") != NULL))
{ {
pStaticParam->NetGeneration = 4; sf_set_net_generation(4);
} }
else if(strstr(netStr, "CDMA") != NULL || strstr(netStr, "HDR") != NULL \ else if(strstr(netStr, "CDMA") != NULL || strstr(netStr, "HDR") != NULL \
|| strstr(netStr, "HSUPA") != NULL || strstr(netStr, "HSDPA") != NULL \ || strstr(netStr, "HSUPA") != NULL || strstr(netStr, "HSDPA") != NULL \
|| strstr(netStr, "HSPA+") != NULL) || strstr(netStr, "HSPA+") != NULL)
{ {
pStaticParam->NetGeneration = 3; sf_set_net_generation(3);
} }
else 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); 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; enMmcLocation = SIM_REG_NET_QCSQ;
sprintf(ttyData, "AT+QCSQ\r"); sprintf(ttyData, "AT+QCSQ\r");
@ -3766,8 +3782,7 @@ SINT32 sf_net_regist_manual(void)
{ {
if(strstr((const char *)gsmPara, "No Service")) if(strstr((const char *)gsmPara, "No Service"))
{ {
//puiPara->NetGeneration = 2; sf_set_net_generation(2);
netGeneration = 2;
} }
else if(NULL != strtok((char *)(char *)gsmPara, "\"")) else if(NULL != strtok((char *)(char *)gsmPara, "\""))
{ {
@ -3776,30 +3791,23 @@ SINT32 sf_net_regist_manual(void)
if((strstr((const char *)netStr, "DD") != NULL)) if((strstr((const char *)netStr, "DD") != NULL))
{ {
//puiPara->NetGeneration = 4; sf_set_net_generation(4);
netGeneration = 4;
} }
else if(strstr((const char *)netStr, "CDMA") != NULL || strstr((const char *)netStr, "HDR") != NULL || strstr((const char *)netStr, "HSUPA") != NULL 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)) || strstr((const char *)netStr, "HSDPA") != NULL || (strstr((const char *)netStr, "HSPA+") != NULL))
{ {
//puiPara->NetGeneration = 3; sf_set_net_generation(3);
netGeneration = 3;
} }
else if(strstr((const char *)netStr, "CMDA") != NULL || strstr((const char *)netStr, "G") != NULL) else if(strstr((const char *)netStr, "CMDA") != NULL || strstr((const char *)netStr, "G") != NULL)
{ {
//puiPara->NetGeneration = 2; sf_set_net_generation(2);
netGeneration = 2;
} }
else else
{ {
// puiPara->NetGeneration = 2; sf_set_net_generation(2);
netGeneration = 2;
} }
} }
if(puiPara->NetGeneration != netGeneration)
{
puiPara->NetGeneration = netGeneration;
}
if(netGeneration == 4) if(netGeneration == 4)
{ {
eNetRegLocation = QUECTEL_NETREG_QCSQ; eNetRegLocation = QUECTEL_NETREG_QCSQ;
@ -4598,8 +4606,7 @@ SINT32 sf_auto_net_reg(void)
{ {
if(strstr((const char *)gsmPara, "No Service")) if(strstr((const char *)gsmPara, "No Service"))
{ {
//puiPara->NetGeneration = 2; sf_set_net_generation(2);
netGeneration = 2;
} }
else if(NULL != strtok((char *)(char *)gsmPara, "\"")) else if(NULL != strtok((char *)(char *)gsmPara, "\""))
{ {
@ -4608,30 +4615,23 @@ SINT32 sf_auto_net_reg(void)
if((strstr((const char *)netStr, "DD") != NULL)) if((strstr((const char *)netStr, "DD") != NULL))
{ {
// puiPara->NetGeneration = 4; sf_set_net_generation(4);
netGeneration = 4;
} }
else if(strstr((const char *)netStr, "CDMA") != NULL || strstr((const char *)netStr, "HDR") != NULL || strstr((const char *)netStr, "HSUPA") != NULL 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)) || strstr((const char *)netStr, "HSDPA") != NULL || (strstr((const char *)netStr, "HSPA+") != NULL))
{ {
// puiPara->NetGeneration = 3; sf_set_net_generation(3);
netGeneration = 3;
} }
else if(strstr((const char *)netStr, "CMDA") != NULL || strstr((const char *)netStr, "G") != NULL) else if(strstr((const char *)netStr, "CMDA") != NULL || strstr((const char *)netStr, "G") != NULL)
{ {
// puiPara->NetGeneration = 2; sf_set_net_generation(2);
netGeneration = 2;
} }
else else
{ {
// puiPara->NetGeneration = 2; sf_set_net_generation(2);
netGeneration = 2;
} }
} }
if(puiPara->NetGeneration != netGeneration)
{
puiPara->NetGeneration = netGeneration;
}
if(netGeneration == 4) if(netGeneration == 4)
{ {
eNetRegLocation = QUECTEL_NETREG_QCSQ; eNetRegLocation = QUECTEL_NETREG_QCSQ;

View File

@ -895,15 +895,15 @@ SINT32 sf_pic_send_ftp(void)
//sendStartTime = sf_sys_os_utime_get()/1000; //sendStartTime = sf_sys_os_utime_get()/1000;
sf_custom_str_get(CamNameStr); 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 */ 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; tempPicSize = pPara->SendPicSize;
} }
else if(3 == pPara->NetGeneration) else if(3 == sf_get_net_generation())
{ {
tempPicSize = ((1 <= pPara->SendPicSize) ? 1 : 0); tempPicSize = ((1 <= pPara->SendPicSize) ? 1 : 0);
} }
@ -936,7 +936,7 @@ SINT32 sf_pic_send_ftp(void)
// piccount = 1; // 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); //printf("[%s:%d]piccount=%d\n", __FUNCTION__, __LINE__, piccount);
@ -1052,11 +1052,11 @@ SINT32 sf_video_send_ftp(void)
MLOGD("start\n"); MLOGD("start\n");
sf_custom_str_get(CamNameStr); 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 */ 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); /*sf_get_send_video_fname(videoDirKey, videoFname);
sprintf((char *)ftpFileName, "%s%s", cameraID, 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(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; 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) if(smtpUploadVideoFlag == 0)
{ {
@ -1319,7 +1319,7 @@ SINT32 sf_send_file_to_ftp(UINT8 mode)
if(ret1 != SF_FTP_ERROR_TERM) if(ret1 != SF_FTP_ERROR_TERM)
{ {
ret2 = sf_ftp_stop(ssl, gprsMode); //ret2 = sf_ftp_stop(ssl, gprsMode);
} }
#if SF_TEST_ERROR_CODE #if SF_TEST_ERROR_CODE
@ -1427,7 +1427,7 @@ SINT32 sf_connect_ftps_server(void)
gprsMode = 0;//puiPara->GprsMode; gprsMode = 0;//puiPara->GprsMode;
printf("[%s:%d] ssl:%d,GprsMode:%d\n", __FUNCTION__, __LINE__, ssl, 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; timeout = 60000;
} }
@ -1442,7 +1442,7 @@ SINT32 sf_connect_ftps_server(void)
{ {
FtpOpenOk = SUCCESS; FtpOpenOk = SUCCESS;
} }
ret = sf_ftp_stop(ssl, gprsMode); //ret = sf_ftp_stop(ssl, gprsMode);
//SF_FTP_CONNECT_END: //SF_FTP_CONNECT_END:
//printf("[%s:%d]ret:[0x%08X]\n\n", __FUNCTION__, __LINE__, ret); //printf("[%s:%d]ret:[0x%08X]\n\n", __FUNCTION__, __LINE__, ret);
@ -1499,10 +1499,11 @@ SINT32 sf_camera_ota_ftp(void)
} }
ret = ftp_download_file(SF_CAM_UP_FILE,SF_CAM_UP_FILE_PATH,0); ret = ftp_download_file(SF_CAM_UP_FILE,SF_CAM_UP_FILE_PATH,0);
if(SUCCESS == ret){ //if(SUCCESS == ret)
sprintf(Cmd, "tar -xjvf %s -C %s", SF_CAM_UP_FILE_PATH, SF_SD_ROOT); {
MLOGD("%s\n", Cmd); // sprintf(Cmd, "tar -xjvf %s -C %s", SF_CAM_UP_FILE_PATH, SF_SD_ROOT);
ret = system(Cmd); // MLOGD("%s\n", Cmd);
// ret = system(Cmd);
if(SUCCESS == ret){ if(SUCCESS == ret){
sf_set_fw_update(1); sf_set_fw_update(1);
sf_set_key_fw_update(sf_get_fw_update()); sf_set_key_fw_update(sf_get_fw_update());
@ -1561,7 +1562,7 @@ SINT32 sf_concentrated_ftp_send(void)
// SINT64 sendStartTime = 0; // SINT64 sendStartTime = 0;
SINT64 sendEndTime = 0; SINT64 sendEndTime = 0;
sf_custom_str_get(CamNameStr); 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; // sendStartTime = sf_sys_os_utime_get()/1000;
@ -1676,7 +1677,7 @@ SF_CONCENTRATED_END:
if(ret1 != SF_FTP_ERROR_TERM) if(ret1 != SF_FTP_ERROR_TERM)
{ {
ret2 = sf_ftp_stop(ssl, gprsMode); //ret2 = sf_ftp_stop(ssl, gprsMode);
} }
#if SF_TEST_ERROR_CODE #if SF_TEST_ERROR_CODE
@ -1748,7 +1749,7 @@ SINT32 sf_hd_ftp_send(void)
sf_set_send_hd(0); sf_set_send_hd(0);
sf_custom_str_get(CamNameStr); 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; // sendStartTime = sf_sys_os_utime_get()/1000;
@ -1858,7 +1859,7 @@ SF_HD_END:
if(ret1 != SF_FTP_ERROR_TERM) if(ret1 != SF_FTP_ERROR_TERM)
{ {
ret2 = sf_ftp_stop(ssl, gprsMode); //ret2 = sf_ftp_stop(ssl, gprsMode);
} }
#if SF_TEST_ERROR_CODE #if SF_TEST_ERROR_CODE
@ -1969,7 +1970,7 @@ SINT32 sf_video_ftp_send(void)
sf_set_send_video(0); sf_set_send_video(0);
sf_custom_str_get(CamNameStr); 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; // sendStartTime = sf_sys_os_utime_get()/1000;
@ -2084,7 +2085,7 @@ SF_VIDEO_END:
if(ret1 != SF_FTP_ERROR_TERM) if(ret1 != SF_FTP_ERROR_TERM)
{ {
ret2 = sf_ftp_stop(ssl, gprsMode); //ret2 = sf_ftp_stop(ssl, gprsMode);
} }
#if SF_TEST_ERROR_CODE #if SF_TEST_ERROR_CODE
@ -2176,7 +2177,7 @@ SINT32 sf_log_send_ftp(void)
} }
if(ret != SF_FTP_ERROR_TERM) if(ret != SF_FTP_ERROR_TERM)
{ {
ret2 = sf_ftp_stop(ssl, gprsMode); //ret2 = sf_ftp_stop(ssl, gprsMode);
} }
#if SF_TEST_ERROR_CODE #if SF_TEST_ERROR_CODE
@ -2295,7 +2296,7 @@ SINT32 sf_gps_send_ftp(void)
} }
if(ret != SF_FTP_ERROR_TERM) if(ret != SF_FTP_ERROR_TERM)
{ {
ret2 = sf_ftp_stop(ssl, gprsMode); //ret2 = sf_ftp_stop(ssl, gprsMode);
} }
#if SF_TEST_ERROR_CODE #if SF_TEST_ERROR_CODE
@ -2985,11 +2986,11 @@ SINT32 sf_test_send_file_to_ftp(void)
MLOGD("start\n"); MLOGD("start\n");
sf_custom_str_get(CamNameStr); 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 */ 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 *)ftpFileName, "%sMEMPHOTO.JPG", cameraID);
sprintf((char *)filePath, "UFS:MEMPHOTO.JPG"); sprintf((char *)filePath, "UFS:MEMPHOTO.JPG");
@ -3082,7 +3083,7 @@ SINT32 sf_card_log_send_ftp(void)
} }
if(ret != SF_FTP_ERROR_TERM) 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); MLOGD(" end ret:[0x%08X],ret2:[0x%08X]\n", ret, ret2);

View File

@ -1975,12 +1975,17 @@ void sf_hd_pic_add_to_list(UINT8 *fileName)
UINT8 tempStr[20] = {0}; UINT8 tempStr[20] = {0};
SubImgList_t *pList = pSubImgListHead; SubImgList_t *pList = pSubImgListHead;
SubImgList_t *qList = pSubImgListHead; SubImgList_t *qList = pSubImgListHead;
char fname[50] = {0};
printf("[%s:%d] add to list:%s\n", __FUNCTION__, __LINE__, fileName); printf("[%s:%d] add to list:%s\n", __FUNCTION__, __LINE__, fileName);
SF_STRNCPY(tempStr, fileName+1, 3); SF_STRNCPY(tempStr, fileName+1, 3);
dirKey = atoi((const char *)tempStr); dirKey = atoi((const char *)tempStr);
fileKey = atoi((const char *)fileName+4); 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) if(pSubImgListHead == NULL)
{ {
pSubImgListHead = (SubImgList_t *)malloc(sizeof(SubImgList_t)); pSubImgListHead = (SubImgList_t *)malloc(sizeof(SubImgList_t));
@ -2088,13 +2093,40 @@ void sf_video_add_to_list(UINT8 *fileName)
SubImgList_t *qList = pSubVideoListHead; SubImgList_t *qList = pSubVideoListHead;
//sfPara_t* pSifarPara = sf_ParaGet(); //sfPara_t* pSifarPara = sf_ParaGet();
//UINT8 subscribeMaxNum = SUBSCRIBE_MAX_NUM - pSifarPara->subscribeSendCnt; //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); printf("add to list:%s\n", fileName);
SF_STRNCPY(tempStr, fileName+1, 3); SF_STRNCPY(tempStr, fileName+1, 3);
dirKey = atoi((const char *)tempStr); dirKey = atoi((const char *)tempStr);
fileKey = atoi((const char *)fileName+4); 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) if(pSubVideoListHead == NULL)
{ {
pSubVideoListHead = (SubImgList_t *)malloc(sizeof(SubImgList_t)); 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(); UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
UINT8 PowerOnMode = sf_poweron_type_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)) 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)) if((sf_check_ftp_send(1) == SF_SUCCESS))
{ {

View File

@ -355,6 +355,7 @@ SINT32 sf_app_cq_signal_to_cardv(void)
stMessageBuf.cmdId = CMD_GPRS; stMessageBuf.cmdId = CMD_GPRS;
stMessageBuf.arg1 = SF_GPRS_CMD_SIGNAL; stMessageBuf.arg1 = SF_GPRS_CMD_SIGNAL;
stMessageBuf.arg2 = sf_get_cq_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); sf_com_message_send_to_cardv(&stMessageBuf);
return SF_SUCCESS; return SF_SUCCESS;
} }
@ -383,7 +384,6 @@ void sf_signal_led_show(UINT8 signalLevel)
SINT32 app_led_net_reg_stop(SINT32 s32ret) SINT32 app_led_net_reg_stop(SINT32 s32ret)
{ {
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
//UINT8 netSearchStep = sf_get_netsearch_step(); //UINT8 netSearchStep = sf_get_netsearch_step();
UINT8 signalLevel = 0; UINT8 signalLevel = 0;
sf_app_cq_signal_to_cardv(); 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); sf_sys_status_led_set(SF_LED_SYS_STATE_SERVER_FAIL);
} }
else { 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); MLOGI("signalLevel = %d\n",signalLevel);
// sf_app_cq_signal_to_cardv(); // sf_app_cq_signal_to_cardv();
sf_signal_led_show(signalLevel); sf_signal_led_show(signalLevel);

View File

@ -141,7 +141,11 @@ SF_THREAD_S McuUpDataTskCfg =
.IsRun = 0, .IsRun = 0,
.TskId = -1, .TskId = -1,
}; };
SF_THREAD_S PowerOffTskCfg =
{
.IsRun = 0,
.TskId = -1,
};
SINT8 debugFlag = 0; SINT8 debugFlag = 0;
UINT8 McuInitFlag = 0; UINT8 McuInitFlag = 0;
@ -1499,7 +1503,36 @@ SINT32 sf_app_mcu_para_stop(void)
} }
return SF_SUCCESS; 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 Function: sf_power_off_msg_to_cardv
Description: power off Description: power off
@ -1516,6 +1549,7 @@ void sf_power_off_msg_to_cardv(void)
stMessageBuf.arg1 = SF_EVENT_KEY_SHORT_CLICK; stMessageBuf.arg1 = SF_EVENT_KEY_SHORT_CLICK;
stMessageBuf.arg2 = SF_KEY_PIN_AOTU_MODE_POWOFF;//auto mode powoff stMessageBuf.arg2 = SF_KEY_PIN_AOTU_MODE_POWOFF;//auto mode powoff
sf_com_message_send_to_cardv(&stMessageBuf); sf_com_message_send_to_cardv(&stMessageBuf);
sf_app_power_off_start();
} }
UINT8 sf_app_get_mcu_init_flag(void) UINT8 sf_app_get_mcu_init_flag(void)

View File

@ -565,11 +565,11 @@ SINT32 sf_upload_send_files_to_module(UINT8 mode)
//sf_custom_str_get(customStr); //sf_custom_str_get(customStr);
if(4 == pPara->NetGeneration) if(4 == sf_get_net_generation())
{ {
tempPicSize = pPara->SendPicSize; tempPicSize = pPara->SendPicSize;
} }
else if(3 == pPara->NetGeneration) else if(3 == sf_get_net_generation())
{ {
tempPicSize = ((1 <= pPara->SendPicSize) ? 1 : 0); tempPicSize = ((1 <= pPara->SendPicSize) ? 1 : 0);
} }
@ -601,7 +601,7 @@ SINT32 sf_upload_send_files_to_module(UINT8 mode)
} }
else if(mode == 1) 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; 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); printf("[%s:%d]before,piccount=%d\n", __FUNCTION__, __LINE__, piccount);
if(4 == pPara->NetGeneration) if(4 == sf_get_net_generation())
{ {
if(piccount >= 2) if(piccount >= 2)
{ {
@ -1008,8 +1008,8 @@ UINT32 sf_create_dailyreport_file(void)
gpsStrTemp[0] = '\0'; gpsStrTemp[0] = '\0';
}*/ }*/
//csqlevel = sf_signal_level_get(pPara->NetGeneration, sf_get_cq_signal()); //csqlevel = sf_signal_level_get(sf_get_net_generation(), sf_get_cq_signal());
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);
if(pPara->DateStyle == SF_DATE_TIME_YYMMDD) 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); 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", \ "Total Pics Sent:%ld\r\n", \
pPara->ModuleImei, \ pPara->ModuleImei, \
csqlevel, \ csqlevel, \
pPara->NetGeneration, \ sf_get_net_generation(), \
cameraID, \ cameraID, \
str, \ str, \
tmpDate, \ tmpDate, \

View File

@ -34,6 +34,7 @@
#include "sf_sms.h" #include "sf_sms.h"
#include "sf_system.h" #include "sf_system.h"
#include "sf_message_queue.h" #include "sf_message_queue.h"
#include "sf_eg91_sim.h"
#ifdef __cplusplus #ifdef __cplusplus
#if __cplusplus #if __cplusplus
extern "C" { extern "C" {
@ -882,6 +883,8 @@ unsigned char sf_mcu_reg_set(MCUParam_t attrId, unsigned char val)
if(val == 1) if(val == 1)
{ {
mcuData[i++] = (puiPara->CamArmDiable) << 6 | isUsb << 2 | isCardFull << 1 | isCard << 0 | 0x08; mcuData[i++] = (puiPara->CamArmDiable) << 6 | isUsb << 2 | isCardFull << 1 | isCard << 0 | 0x08;
mcuReg[i] = WDT_TIME;
mcuData[i++] = 16;/*16 min*/
} }
else else
{ {
@ -910,7 +913,11 @@ unsigned char sf_mcu_reg_set(MCUParam_t attrId, unsigned char val)
sf_debug_save_log(); sf_debug_save_log();
} }
#endif #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; return SUCCESS;
} }
@ -1265,9 +1272,7 @@ UINT32 sf_get_sim_insert(void)
void sf_set_cq_signal(UINT8 csq) void sf_set_cq_signal(UINT8 csq)
{ {
UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); if(((sf_get_net_generation() == 4) && (csq > 0) && (csq < 129)) || ((sf_get_net_generation() < 4) && (csq > 1) && (csq < 32)))
if(((puiPara->NetGeneration == 4) && (csq > 0) && (csq < 129)) || ((puiPara->NetGeneration < 4) && (csq > 1) && (csq < 32)))
{ {
cq_Signal = csq; cq_Signal = csq;
isSignalReady = 1; isSignalReady = 1;

View File

@ -189,4 +189,9 @@ void sf_set_msdc_clk(void);
void sf_send_message_to_create_qrcode(void); void sf_send_message_to_create_qrcode(void);
UINT8 sf_get_rtsp_flag(void); UINT8 sf_get_rtsp_flag(void);
void sf_set_rtsp_flag(UINT8 flag); 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 #endif

View File

@ -100,7 +100,8 @@ static UINT8 UiparaFlag = 0;
static SF_BLE_STATUS_E BleStatus = SF_BLE_OK; static SF_BLE_STATUS_E BleStatus = SF_BLE_OK;
static UINT8 McuUpdateFlag = 0; static UINT8 McuUpdateFlag = 0;
static SF_GPS_STATUS_E gGpsSearching = SF_GPS_SEARCHING_UNKNOW; 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 = static SF_THREAD_S UpgradeTskParam =
{ {
.IsRun = 0, .IsRun = 0,
@ -290,16 +291,17 @@ void sf_mode_detect(void)
//LCD_BACKLIGHT_OFF; //LCD_BACKLIGHT_OFF;
sf_sys_status_led_set(SF_LED_SYS_STATE_POWER_OFF); sf_sys_status_led_set(SF_LED_SYS_STATE_POWER_OFF);
printf("[power off] %s(%d) AutoOfftime:%d\n", __FUNCTION__, __LINE__, AutoOfftime); printf("[power off] %s(%d) AutoOfftime:%d\n", __FUNCTION__, __LINE__, AutoOfftime);
#define DO_NOT_SHOW_POWER_OFF 0
if(AutoOfftime >= KeepAliveTime_s) 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 else
{ {
#if defined(_MODEL_565_HUNTING_EVB_LINUX_4G_68CS_) #if defined(_MODEL_565_HUNTING_EVB_LINUX_4G_68CS_)
Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, APP_POWER_OFF_NORMAL); //shutdown start 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_) #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 #endif
} }
sf_set_power_off_flag(1); sf_set_power_off_flag(1);
@ -1350,7 +1352,11 @@ BOOL sf_cmd_ftp_ota(unsigned char argc, char **argv)
//UINT32 value; //UINT32 value;
UIMenuStoreInfo *puiPara = sf_ui_para_get(); UIMenuStoreInfo *puiPara = sf_ui_para_get();
if(4 == argc) 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->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->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])))); strncpy((char *)puiPara->OtaFtpUserName, argv[2], ((sizeof(puiPara->OtaFtpUserName) <= strlen(argv[2])) ? (sizeof(puiPara->OtaFtpUserName)) : (strlen(argv[2]))));
@ -1793,6 +1799,8 @@ static SINT32 sf_cardv_proccess_cmd_gprs(SF_MESSAGE_BUF_S *pMessageBuf)
{ {
case SF_GPRS_CMD_SIGNAL: case SF_GPRS_CMD_SIGNAL:
cq_Signal = pMessageBuf->arg2; cq_Signal = pMessageBuf->arg2;
sf_set_net_generation(pMessageBuf->arg3 & 0xFF);
sf_cardv_set_sim_insert((pMessageBuf->arg3>>16)&0x0F);
break; break;
default: default:
@ -3368,4 +3376,46 @@ void sf_send_message_to_create_qrcode(void)
stMessageBuf.arg1 = SF_EVENT_KEY_MOCK_CREATE_QR_CODE; stMessageBuf.arg1 = SF_EVENT_KEY_MOCK_CREATE_QR_CODE;
stMessageBuf.cmdId = CMD_KEY; stMessageBuf.cmdId = CMD_KEY;
sf_com_message_send_to_app(&stMessageBuf); sf_com_message_send_to_app(&stMessageBuf);
}
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;
}
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);
}
} }

View File

@ -803,7 +803,14 @@ void sf_mcu_dataready_ck(UINT8 startMode)
gModuleSleep = 0; //power off 4G module gModuleSleep = 0; //power off 4G module
sf_set_power_off_flag(1); sf_set_power_off_flag(1);
printf("[power off] %s(%d)\n", __FUNCTION__, __LINE__); 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
}
} }
} }

View File

@ -138,7 +138,6 @@ SINT32 sf_module_init(VOID)
UIMenuStoreInfo *pPara = sf_ui_para_get(); UIMenuStoreInfo *pPara = sf_ui_para_get();
needRecordLogFlag = 1; needRecordLogFlag = 1;
pPara->NetGeneration = SF_NET_NO;
sf_4g_data_buff_clear(); sf_4g_data_buff_clear();
sf_gsm_para_buff_clear(); sf_gsm_para_buff_clear();

View File

@ -1302,7 +1302,7 @@ void setet_preset_param(void)
vendor_isp_get_ae(AET_ITEM_STATUS, &ae_status_info); 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]); 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.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.id = 0;
total_gain.gain = preset_param.gain; total_gain.gain = preset_param.gain;
vendor_isp_set_common(ISPT_ITEM_TOTAL_GAIN, &total_gain); vendor_isp_set_common(ISPT_ITEM_TOTAL_GAIN, &total_gain);

View File

@ -945,7 +945,7 @@
#define HUNTING_MCU_UART ENABLE #define HUNTING_MCU_UART ENABLE
#define HUNTING_IR_LED_940 ENABLE #define HUNTING_IR_LED_940 ENABLE
#define SF_EXIF_MN_BUF_SIZE 256 #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_DIR_NAME "MEDIA" /* 100MEDIA */
#define DCF_FILE_NAME "SYGW" /* SYFW0001.JPG */ #define DCF_FILE_NAME "SYGW" /* SYFW0001.JPG */
#define PHOTO_THUMB_PATH "A:\\THUMB\\" #define PHOTO_THUMB_PATH "A:\\THUMB\\"

View File

@ -1356,10 +1356,10 @@ static INT32 MovieFast_Mode2_Get_Cont_Shot(UINT32* max_cnt, UINT32* duration)
if(SF_MULTISHOT_INTEVEL_1S == puiPara->MultiShotIntevel) 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) { 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 { else {
*duration = 1000 / *max_cnt;//SF_MULTISHOT_INTEVEL_0S *duration = 1000 / *max_cnt;//SF_MULTISHOT_INTEVEL_0S
@ -1385,11 +1385,11 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg)
//UI_SetData(FL_MOVIE_SIZE, MOVIE_SIZE_CLONE_1920x1080P30_1280x720P30); //UI_SetData(FL_MOVIE_SIZE, MOVIE_SIZE_CLONE_1920x1080P30_1280x720P30);
Set_NIGHTMODE(0, 0); 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{ else{
Set_NIGHTMODE(0, 1); Set_NIGHTMODE(0, 1);
Set_AEMODE(0); //Set_AEMODE(0);
} }
MovieFast_SetRecInfoByUISetting(); MovieFast_SetRecInfoByUISetting();
@ -1587,6 +1587,9 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg)
MovieFast_InstallID(); 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}; HD_VIDEO_FRAME frame_capture = {0};
{ {
@ -1614,8 +1617,8 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg)
ae_preset_flag = TRUE; ae_preset_flag = TRUE;
vprc_frm_cnt_ae_preset = vprc_frm_cnt; vprc_frm_cnt_ae_preset = vprc_frm_cnt;
DBG_DUMP("ae preset vprc frame cnt = %lu\n", vprc_frm_cnt_ae_preset); DBG_DUMP("ae preset vprc frame cnt = %lu\n", vprc_frm_cnt_ae_preset);
Set_AEMODE(1); Set_AEMODE(0);
setet_preset_param(); //setet_preset_param();
} }
} }

View File

@ -1500,10 +1500,10 @@ THREAD_RETTYPE PhotoFast_FlowPreviewThread(void *arg)
#if HUNTING_CAMERA_MCU == ENABLE #if HUNTING_CAMERA_MCU == ENABLE
if(SF_MULTISHOT_INTEVEL_1S == puiPara->MultiShotIntevel) 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) { 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 { else {
period = 1000 / max_cnt;//SF_MULTISHOT_INTEVEL_0S period = 1000 / max_cnt;//SF_MULTISHOT_INTEVEL_0S

View File

@ -69,7 +69,7 @@
#if SF_HW_TEST == ENABLE #if SF_HW_TEST == ENABLE
#define DEFAULT_MOVIE_SIZE MOVIE_SIZE_FRONT_1280x720P30 #define DEFAULT_MOVIE_SIZE MOVIE_SIZE_FRONT_1280x720P30
#else #else
#define DEFAULT_MOVIE_SIZE MOVIE_SIZE_CLONE_1920x1080P30_1920x1080P25 #define DEFAULT_MOVIE_SIZE MOVIE_SIZE_FRONT_1920x1080P30
#endif #endif
#endif #endif
#else #else