From 37f7cd148145d9cefe19a99dfdf5011944e3099c Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Fri, 10 Nov 2023 16:37:10 +0800 Subject: [PATCH 1/5] Add sending picture message in ui. --- .../cardv/SrcCode/UIApp/Photo/UIAppPhoto.h | 8 +++ .../UIFlowPhoto/UIFlowPhotoEventCallback.c | 56 ++++++++++++++++++- .../source/sf_app/code/source/4gMng/sf_ftp.c | 1 + .../lib/source/sifar/code/include/sf_common.h | 9 +++ .../sifar/code/source/common/sf_common.c | 20 +++++++ 5 files changed, 92 insertions(+), 2 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto.h b/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto.h index 765bf8335..4f7017cf6 100755 --- a/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto.h +++ b/code/application/source/cardv/SrcCode/UIApp/Photo/UIAppPhoto.h @@ -270,11 +270,19 @@ typedef enum { /* INSERT NEW EVENT HRER */ //Event post from WifTask CB UIAPPPHOTO_CB_UCTRL_UPDATE_UI = 0x14002f40, + NVT_SIFAR_MSG_SCREEN, /* INSERT NEW EVENT HRER */ NVTEVT_PHOTO_EVT_END = APPUSER_PHOTO_BASE + 0x1000 - 1, ///< Max value = 0x14002fff } CUSTOM_PHOTO_EVENT; +// typedef enum { +// NVT_SIFAR_START = NVTEVT_PHOTO_EVT_END, +// NVT_SIFAR_MSG_SCREEN, +// NVT_SIFAR_END +// } NVT_SIFAR_EVENT; + + #define UIAPPPHOTO_CB_MAX UIAPPPHOTO_CB_NULL #if(PHOTO_MODE==ENABLE) 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 388f8c573..a0c59718d 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 @@ -55,6 +55,10 @@ static void task_update_icons_timer_cb(lv_task_t* task); static unsigned long KeyLeftPressingTimeMs = 0; static unsigned long KeyDownPressingTimeMs = 0; +#define SENDING_KEEP_SHOW -1 +#define SENDING_NOT_SHOW 0 +static int SendMsgShow = SENDING_NOT_SHOW; + static BOOL g_PhotoBgInitFileSys = FALSE; @@ -388,7 +392,15 @@ static void update_4g_module_icon(void) { // Nothing changed. // printf(" nothing changed.\n"); - } + } + if (SENDING_NOT_SHOW < SendMsgShow) + { + SendMsgShow--; + if (SENDING_NOT_SHOW == SendMsgShow) + { + lv_obj_set_hidden(label_sim_scr_uiflowphoto, true); + } + } const int EMPTY_IMAGE = 0; lv_plugin_res_id res[] = { EMPTY_IMAGE, @@ -1430,7 +1442,42 @@ void UIFlowPhoto_UpdateInfo(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* msg) return ; } - +static void sf_show_send_text(lv_obj_t* obj, const unsigned short status) +{ + #define SENDING_KEEP_SHOW_TIME_S 3 + switch (status) + { + case FILE_SENDING_GUI_START_SENDING: + { + lv_obj_set_hidden(label_sim_scr_uiflowphoto, false); + lv_label_set_text(label_sim_scr_uiflowphoto, "Sending ... "); + SendMsgShow = SENDING_KEEP_SHOW; + break; + } + case FILE_SENDING_GUI_STOP_SENDING: + { + lv_obj_set_hidden(label_sim_scr_uiflowphoto, true); + SendMsgShow = SENDING_NOT_SHOW; + break; + } + case FILE_SENDING_GUI_SEND_SUCCEED: + { + lv_obj_set_hidden(label_sim_scr_uiflowphoto, false); + lv_label_set_text(label_sim_scr_uiflowphoto, "Success"); + SendMsgShow = SENDING_KEEP_SHOW_TIME_S; + break; + } + case FILE_SENDING_GUI_SEND_FAILED: + { + lv_obj_set_hidden(label_sim_scr_uiflowphoto, false); + lv_label_set_text(label_sim_scr_uiflowphoto, "Fail"); + SendMsgShow = SENDING_KEEP_SHOW_TIME_S; + break; + } + default: + break; + } +} static void UIFlowPhoto_NVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* msg) { @@ -1480,6 +1527,11 @@ static void UIFlowPhoto_NVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* m break; } } + case NVT_SIFAR_MSG_SCREEN: + { + sf_show_send_text(obj, msg->paramArray[0]); + break; + } default: break; 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 db6f2b4a7..b33b3b98b 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 @@ -17,6 +17,7 @@ * Ver: 1.0.0 2021.04.12 * Description: creat **************************************************************************/ +#include "NvtUser/NvtUser.h" #include #include #include diff --git a/code/lib/source/sifar/code/include/sf_common.h b/code/lib/source/sifar/code/include/sf_common.h index e577e8e5a..01dff5240 100755 --- a/code/lib/source/sifar/code/include/sf_common.h +++ b/code/lib/source/sifar/code/include/sf_common.h @@ -23,6 +23,14 @@ typedef enum sfBLE_STATUS_E SF_BLE_BUTT, } SF_BLE_STATUS_E; +typedef enum{ + FILE_SENDING_GUI_START_SENDING = 0, + FILE_SENDING_GUI_STOP_SENDING, + FILE_SENDING_GUI_SEND_SUCCEED, + FILE_SENDING_GUI_SEND_FAILED, + FILE_SENDING_GUI_END +} FILE_SENDING_GUI_E; + void sf_mode_detect(void); int sf_pir_statu_read(void); void sf_set_pir_power_off_flag(BOOL flag); @@ -110,6 +118,7 @@ UINT8 sf_cardv_get_is_esim(void); void sf_cardv_set_operationSelectResp(UINT8 resp); UINT8 sf_cardv_get_operationSelectResp(void); void sf_set_send_statu(BOOL is); +void sf_ui_sending_show(unsigned short status); BOOL sf_get_send_statu(void); void sf_cardv_set_mcu_rtc_flag(void); void sf_hd_flag_init(void); 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 992467000..c35b43845 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -1780,6 +1780,9 @@ static SINT32 sf_cardv_proccess_cmd_file(SF_MESSAGE_BUF_S *pMessageBuf) case SF_PARA_CMD_UPDATE: sf_share_mem_file_init(); sf_set_send_statu(FALSE); + #define SEND_SUCCEED 0 + #define SEND_FAILED -1 + sf_ui_sending_show(SEND_SUCCEED == pMessageBuf->arg1 ? FILE_SENDING_GUI_SEND_SUCCEED : FILE_SENDING_GUI_SEND_FAILED); if(sf_get_mode_flag()) { sf_wifi_server_stop_shoot_respond((UINT8)pMessageBuf->arg2); @@ -2010,8 +2013,25 @@ BOOL sf_is_preview(void) void sf_set_send_statu(BOOL is) { IsSend = is; + if (TRUE == is) + { + sf_ui_sending_show(FILE_SENDING_GUI_START_SENDING); + } + else + { + sf_ui_sending_show(FILE_SENDING_GUI_STOP_SENDING); + } printf("[%s]:%d IsSend:%d\n", __FUNCTION__, __LINE__,IsSend); } +void sf_ui_sending_show(unsigned short status) +{ +// #define GUI_SHOW_SENDING 1 +// if (TRUE == is) + { + Ux_PostEvent(NVT_SIFAR_MSG_SCREEN, 1, status); + // Ux_PostEvent(NVTEVT_CB_ZOOM, 1, status); + } +} BOOL sf_get_send_statu(void) { From 5481dd9b5fa942347ddbe095b41e5463a2163fc5 Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Fri, 10 Nov 2023 17:05:45 +0800 Subject: [PATCH 2/5] Fixed bug about play screen. --- .../UIFlowPlay/UIFlowPlayEventCallback.c | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c index 87e66b24b..b245bfe0d 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c @@ -1450,6 +1450,33 @@ static void UIFlowPlay_OnKeySelect(lv_obj_t* obj) static void UIFlowPlay_Exit(lv_obj_t* obj) { // Ux_SendEvent(&UISetupObjCtrl, NVTEVT_PREVIEWMODE, 0); + if(PLB_ST_PLAY_MOV == g_PlbData.State) + { + printf("now stop play the video.\n"); + g_PlbData.State = PLB_ST_FULL; + lv_plugin_img_set_src(image_play_scr_uiflowplay, LV_PLUGIN_IMG_ID_SF_STOP); + lv_label_set_text_fmt(label_playtime_scr_uiflowplay, "%02d:%02d", 0, 0); + g_PlbData.VideoPBSpeed = PLB_FWD_MOV_1x; + + // Close MoviePlay module. + Ux_SendEvent(0, NVTEVT_EXE_CLOSEPLAY, 0); + Ux_SetActiveApp(&CustomPlayObjCtrl); + + // Wakeup playback task and ImageApp_Play module. + Ux_SendEvent(0, NVTEVT_EXE_OPEN, 0); + KeyScan_EnableMisc(TRUE); + if (gphUIFlowMovPlay_Filehdl) + { + FileSys_CloseFile(gphUIFlowMovPlay_Filehdl); + gphUIFlowMovPlay_Filehdl = NULL; + } + PBView_DrawErrorView(); + + // Play 1st video frame image + UIPlay_PlaySingle(PB_SINGLE_CURR); + update_playicons(g_PlbData.State); + // return; + } UINT32 uiChangeTo; uiChangeTo = System_GetBootFirstMode(); UINT32 uiCurrMode; From c3ba572d50b3184b0cca5190ff0fd1731fa94b94 Mon Sep 17 00:00:00 2001 From: zyj Date: Fri, 10 Nov 2023 18:22:48 +0800 Subject: [PATCH 3/5] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=9A=84=E9=83=A8=E5=88=86=E9=97=AE=E9=A2=98?= =?UTF-8?q?=202.=E5=AE=8C=E6=88=90=E7=94=9F=E6=88=90CAM=5FINFO.txt?= =?UTF-8?q?=E5=92=8CQR.BMP=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIFlowLVGL/UIFlowMenuCommonItem/MenuQR.c | 5 ++++- .../UIFlowMenuCommonItemEventCallback.c | 5 ++++- .../source/sf_app/code/source/app/sf_common.c | 8 ++++---- .../source/sf_app/code/source/qrcodeMng/sf_qrcode.c | 12 +++++++++++- code/lib/source/sifar/code/source/common/sf_common.c | 4 ++-- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuQR.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuQR.c index cf3c24ac4..90df5e263 100644 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuQR.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuQR.c @@ -911,7 +911,10 @@ static void update_Camera_Info_msg(lv_obj_t* obj) strcat(CamInfoStr, tmpStr); } else if(!CameraInfoisHidden) - strcat(CamInfoStr, SF_BASE_VERSION); + { + sprintf(tmpStr, "%s\n",SF_BASE_VERSION); + strcat(CamInfoStr, tmpStr); + } else strcat(CamInfoStr, "\n"); break; 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 c2745f7a0..37e83cab3 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 @@ -585,7 +585,10 @@ static void LV_MenuCommonItem_UpdateContent(TM_MENU *pMenu) lv_plugin_img_set_src(image_option_1_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT1); } //#NT#2023/11/03#Eric - end - lv_plugin_label_set_text(label_option_1_scr_uiflowmenucommonitem, pOption->TextId); + if(pItem->ItemId == IDM_NETWORK_SELECTION) + lv_plugin_label_set_text(label_option_1_scr_uiflowmenucommonitem, IDS_END); + else + lv_plugin_label_set_text(label_option_1_scr_uiflowmenucommonitem, pOption->TextId); lv_plugin_label_update_font(label_option_1_scr_uiflowmenucommonitem, LV_OBJ_PART_MAIN); lv_obj_set_hidden(container_option_1_scr_uiflowmenucommonitem, false); }else if(i == 1){ diff --git a/code/application/source/sf_app/code/source/app/sf_common.c b/code/application/source/sf_app/code/source/app/sf_common.c index 78b8edba7..2c06b9f31 100755 --- a/code/application/source/sf_app/code/source/app/sf_common.c +++ b/code/application/source/sf_app/code/source/app/sf_common.c @@ -179,7 +179,7 @@ static void create_qrcode(void) { SF_CHAR version[12] = {0}; SF_CHAR iccidStr[22] = {0}; - SF_PDT_PARAM_STATISTICS_S *pStaticParam = sf_statistics_param_get(); + UIMenuStoreInfo *pStaticParam = sf_app_ui_para_get(); sf_sys_software_version_get(version); if(pStaticParam->SimType == SF_SIM_OTHER) { @@ -187,12 +187,12 @@ static void create_qrcode(void) } else { - sprintf(iccidStr, "%s", pStaticParam->SimID); + sprintf(iccidStr, "%s", pStaticParam->SimIccid); } printf(" create_qrcode\n"); - sf_qrcode_create(pStaticParam->IMEI, iccidStr, version); - sf_sys_camera_about(); + sf_qrcode_create(pStaticParam->ModuleImei, iccidStr, version); + // sf_sys_camera_about(); } } diff --git a/code/application/source/sf_app/code/source/qrcodeMng/sf_qrcode.c b/code/application/source/sf_app/code/source/qrcodeMng/sf_qrcode.c index 88188e706..8f5b35ef1 100644 --- a/code/application/source/sf_app/code/source/qrcodeMng/sf_qrcode.c +++ b/code/application/source/sf_app/code/source/qrcodeMng/sf_qrcode.c @@ -23,6 +23,7 @@ #include "sf_log.h" #include "sf_base64.h" #include "sf_qrcode.h" +#include "sf_4g_lpa.h" #ifdef __cplusplus #if __cplusplus @@ -95,7 +96,7 @@ SINT16 sf_qrcode_create(SF_CHAR *pIMEI,SF_CHAR *pSimID ,SF_CHAR* pVersion) SLOGE("the current Version is null!!!\n"); return SF_FAILURE; } - +#if 0 sprintf(qrsrc_Str, "m2m-%s-%s-%s-%s-T11000001", pIMEI, pSimID,ACCESS_KEY,pVersion); MLOGI("qrStr = %s\n",qrsrc_Str); @@ -105,6 +106,15 @@ SINT16 sf_qrcode_create(SF_CHAR *pIMEI,SF_CHAR *pSimID ,SF_CHAR* pVersion) sf_qrcode_encode(qrdst_Str, strlen(qrdst_Str), "/mnt/mmc/addCam.bmp"); MLOGI("addCam.bmp have existed \n"); +#endif + + UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); + sprintf(qrsrc_Str, "{\"imei\":\"%s\",\"verizonICCID\":\"%s\",\"attICCID\":\"%s\",\"isEsim\":%s}", + puiPara->ModuleImei, puiPara->SimIccidV, puiPara->SimIccidA, sf_is_esim_card() ? "true" : "false"); + MLOGI("qrStr = %s\n",qrsrc_Str); + sf_qrcode_encode(qrsrc_Str, strlen(qrsrc_Str), "/mnt/sd/QR.BMP"); + MLOGI("QR.BMP have existed \n"); + return ret; } 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 c35b43845..dc1c6c078 100755 --- a/code/lib/source/sifar/code/source/common/sf_common.c +++ b/code/lib/source/sifar/code/source/common/sf_common.c @@ -2575,7 +2575,7 @@ void sf_save_camera_info(void) return; fristRun = 0; - temp = malloc(200); + temp = malloc(300); if (temp == NULL) { MLOGE("temp malloc err\n"); return; @@ -2600,7 +2600,7 @@ void sf_save_camera_info(void) }*/ sf_get_wifi_ssid(wifissid); - SF_SPRINTF(temp, "IMEI:%s\r\nSoftwareVER:%s\r\nModuleVER:%s\r\nMcuVER:%s\r\nICCID:%s\r\nICCID-A:%s\r\nICCID-V:%s\r\nSSID:%s\r\nBLE:%s\r\n", + snprintf(temp, 300, "IMEI:%s\r\nSoftwareVER:%s\r\nModuleVER:%s\r\nMcuVER:%s\r\nICCID:%s\r\nICCID-A:%s\r\nICCID-V:%s\r\nSSID:%s\r\nBLE:%s\r\n", puiPara->ModuleImei, localver, puiPara->ModuleSubver, mcuver, puiPara->SimIccid, puiPara->SimIccidA, puiPara->SimIccidV, wifissid,puiPara->BluSsid); if(access((char*)SF_CAMERA_INFO_FILENAME, F_OK) == 0) From 13665cca5e9d6725f10cc89e093add36d36a4363 Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Fri, 10 Nov 2023 18:49:11 +0800 Subject: [PATCH 4/5] Sync Branch_S550. --- code/application/sifarsdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/application/sifarsdk b/code/application/sifarsdk index d1b456a00..d94ce5f28 160000 --- a/code/application/sifarsdk +++ b/code/application/sifarsdk @@ -1 +1 @@ -Subproject commit d1b456a005d163d4716388c97d54a79fbe251e1c +Subproject commit d94ce5f287f07a559543c35385d84c6f34ceeab2 From 634b2e06f6567b62dc3d5e9ea0575ee49b873f82 Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Fri, 10 Nov 2023 19:00:00 +0800 Subject: [PATCH 5/5] Sync branch_s550_to_s530 --- code/application/sifarsdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/application/sifarsdk b/code/application/sifarsdk index d94ce5f28..8e5bc4220 160000 --- a/code/application/sifarsdk +++ b/code/application/sifarsdk @@ -1 +1 @@ -Subproject commit d94ce5f287f07a559543c35385d84c6f34ceeab2 +Subproject commit 8e5bc42200744278717e429ce6c35bb951939535