diff --git a/build_all.sh b/build_all.sh index 913af95c1..4616e2a42 100755 --- a/build_all.sh +++ b/build_all.sh @@ -1,7 +1,7 @@ #!/bin/bash #用于gitlab-ci.yml编译使用 -make app_clean +#make app_clean echo "Start compile." export ROOT_PATH=$PWD @@ -9,7 +9,7 @@ export ROOT_PATH=$PWD cd rtos source build/envsetup.sh lunch rtos cfg_565_HUNTING_EVB_LINUX_4G_S550 gcc-6.5-newlib-2.4-2019.11-arm-ca9-eabihf -make clean +#make clean make all > /dev/null cp output/application.bin ../ cp output/rtos-main.bin ../ @@ -18,7 +18,7 @@ cp output/rtos-main.bin ../ cd $ROOT_PATH source build/envsetup.sh lunch Linux cfg_565_HUNTING_EVB_LINUX_4G_S550 arm-ca9-linux-uclibcgnueabihf-8.4.01 -make clean +#make clean make all > /dev/null cd $ROOT_PATH 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 1c8d09f13..17adf2d29 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 @@ -654,41 +654,76 @@ static lv_task_t* qr_page_task = NULL; static void qr_page_task_cb(lv_task_t* task){ lv_obj_t* obj = (lv_obj_t*)task->user_data; - UIMenuStoreInfo *puiPara = sf_ui_para_get(); + #define QR_DATA_LENGTH 1024 char qr_date[QR_DATA_LENGTH] = {0}; - if(sf_cardv_get_sim_insert() == 0){ + //printf("[qr_page_task_cb]qr task start...\n"); + int ret = -1; + + if (NULL != qr) + { + return; + } + + if (obj) + { + ret = sf_cardv_get_is_esim(); + if (sf_cardv_get_sim_insert() == 0) + { + //printf("[qr_page_task_cb]no sim card...\n"); lv_label_set_text(labelInit, "Please insert the SIM card and restart the camera"); - } - else if(sf_cardv_4G_status_get() == SF_4G_SEARCHING) - { + return; + }/* + else if(sf_cardv_4G_status_get() == SF_4G_SEARCHING) + { + printf("[qr_page_task_cb][*x]loading...\n"); lv_label_set_text(labelInit, "\nQR code loading..."); - } - else if (sf_cardv_get_is_esim() == 1) - { + }*/ + else if (ret == 1) + { + UIMenuStoreInfo *puiPara = sf_ui_para_get(); + printf("[qr_page_task_cb]is esim card...%s\n", puiPara->ModuleImei); snprintf(qr_date, QR_DATA_LENGTH, qr_code_str, puiPara->ModuleImei, puiPara->SimIccidV, puiPara->SimIccidA, "true"); - if(obj){ - /*Create a 100x100 QR code*/ - qr = lv_qrcode_create(obj, 120, (lv_color_t) { .full = 0x02}, (lv_color_t) { .full = 0x23}); - if(qr) - { - /*Set data*/ - lv_obj_set_hidden(qr_info_msgbox, true); - lv_qrcode_update(qr, qr_date, strlen(qr_date)); - lv_obj_set_pos(qr, 32, 70); - lv_obj_set_hidden(QRImage, false); - lv_obj_set_pos(label, 180, 80); - lv_obj_set_size(label, 130, 70); - lv_label_set_text(labelInit, ""); - lv_label_set_text(label, "Add Camera to Tactacam APP"); - } + } + else if (ret == 0) + { + UIMenuStoreInfo *puiPara = sf_ui_para_get(); + printf("[qr_page_task_cb]is sim card...%s\n", puiPara->ModuleImei); + snprintf(qr_date, QR_DATA_LENGTH, qr_code_str, puiPara->ModuleImei, puiPara->SimIccidV, puiPara->SimIccidA, "false"); + } + else if (ret == -1) + { + if(sf_cardv_4G_status_get() == SF_4G_SEARCHING) + { + lv_label_set_text(labelInit, "\nQR code loading..."); } - } - else if (sf_cardv_get_is_esim() == 0) - { - snprintf(qr_date, QR_DATA_LENGTH, qr_code_str, puiPara->ModuleImei, puiPara->SimIccidA, puiPara->SimIccidA, "false"); + else if (sf_cardv_4G_status_get() == SF_4G_FAIL) + { + lv_label_set_text(labelInit, "\nPlease restart the camera"); + } + return; + } + else{ lv_label_set_text(labelInit, "\nPlease restart the camera"); + return; + } + /*Create a 100x100 QR code*/ + + printf("[qr_page_task_cb]qr code create...\n"); + qr = lv_qrcode_create(obj, 115, (lv_color_t) { .full = 0x02}, (lv_color_t) { .full = 0x23});//23 + + lv_obj_set_pos(qr, 42, 75); + lv_qrcode_update(qr, qr_date, strlen(qr_date)); + + lv_obj_set_hidden(qr_info_msgbox, true); + lv_label_set_text(labelInit, ""); + + lv_obj_set_hidden(QRImage, false); + + lv_obj_set_pos(label, 180, 80); + lv_obj_set_size(label, 130, 70); + lv_label_set_text(label, "Add Camera to Tactacam APP"); } } @@ -721,17 +756,18 @@ void show_qr_picture_page(lv_obj_t* obj) lv_color_t color = {0}; STYLE_COLOR_PROP(0xff, 0xff, 0xff, 0xff); lv_style_set_text_color(&labelStyle, LV_STATE_DEFAULT, color); - lv_style_set_text_font(&labelStyle,LV_STATE_DEFAULT,&sf_ui_text_medium_16_1bpp); + lv_style_set_text_font(&labelStyle,LV_STATE_DEFAULT,&sf_ui_text_medium_18_1bpp); lv_obj_add_style(label, 0, &labelStyle); //text qr msgbox qr_info_msgbox = lv_btn_create(obj, button_msg_bg_scr_uiflowwrnmsg); lv_obj_set_hidden(qr_info_msgbox, false); labelInit = lv_label_create(qr_info_msgbox, label_msg_scr_uiflowwrnmsg); - lv_obj_align(labelInit, qr_info_msgbox, LV_ALIGN_CENTER, 0, -30); - lv_label_set_align(labelInit, LV_LABEL_ALIGN_CENTER); lv_obj_add_style(labelInit, 0, &gMatrixStylebtn); - if(sf_cardv_get_sim_insert() == 0){ + lv_label_set_align(labelInit, LV_LABEL_ALIGN_CENTER); + lv_obj_align(labelInit, qr_info_msgbox, LV_ALIGN_CENTER, 0, -30); + + if (sf_cardv_get_sim_insert() == 0){ lv_label_set_text(labelInit, "Please insert the SIM card and restart the camera"); } else{ @@ -744,10 +780,19 @@ void show_qr_picture_page(lv_obj_t* obj) lv_obj_set_hidden(QRImage, true); lv_obj_set_click(QRImage, false); lv_obj_set_drag(QRImage, false); - lv_obj_set_pos(QRImage, 207, 122); + lv_obj_set_pos(QRImage, 210, 141); lv_obj_set_size(QRImage, 32, 32); lv_img_set_src(QRImage, &sf_qr_page); + if(NULL != qr){ + lv_obj_set_hidden(qr, false); + lv_obj_set_hidden(QRImage, false); + lv_obj_set_pos(label, 180, 80); + lv_obj_set_size(label, 130, 70); + lv_label_set_text(label, "Add Camera to Tactacam APP"); + lv_obj_set_hidden(qr_info_msgbox, true); + } + if(qr_page_task == NULL){ qr_page_task = lv_task_create(qr_page_task_cb, 1000, LV_TASK_PRIO_HIGHEST, (void*)obj); } @@ -757,32 +802,38 @@ void show_qr_picture_page(lv_obj_t* obj) void hidde_qr_picture_page(void) { qr_page_task_end(); - printf("[hidde_qr_picture_page]hidde qr page\n"); if(NULL != qr) { - lv_qrcode_delete(qr); - qr = NULL; + //printf("[hidde_qr_picture_page]delete qr\n"); + lv_obj_set_hidden(qr, true); + //lv_qrcode_delete(qr); + //qr = NULL; } if(NULL != label) { + //printf("[hidde_qr_picture_page]delete label\n"); lv_obj_del(label); label = NULL; } if(NULL != labelInit) { + //printf("[hidde_qr_picture_page]delete label msgbox\n"); lv_obj_del(labelInit); labelInit = NULL; } if(NULL != QRImage) { + //printf("[hidde_qr_picture_page]delete icon\n"); lv_obj_del(QRImage); QRImage = NULL; } if(NULL != qr_info_msgbox){ + //printf("[hidde_qr_picture_page]delete msgbox\n"); lv_obj_del(qr_info_msgbox); qr_info_msgbox = NULL; } + } void Option_qr_picture_Key(lv_obj_t* obj, uint32_t key) @@ -798,16 +849,19 @@ void Option_qr_picture_Key(lv_obj_t* obj, uint32_t key) break; case LV_USER_KEY_LEFT: - lv_plugin_scr_close(obj, gen_nvtmsg_data(NVTRET_ENTER_MENU, 0)); + { hidde_qr_picture_page(); + lv_plugin_scr_close(obj, gen_nvtmsg_data(NVTRET_ENTER_MENU, 0)); break; + } case LV_USER_KEY_RIGHT: - break; case LV_KEY_ENTER: - lv_plugin_scr_close(obj, gen_nvtmsg_data(NVTRET_ENTER_MENU, 0)); + { hidde_qr_picture_page(); + lv_plugin_scr_close(obj, gen_nvtmsg_data(NVTRET_ENTER_MENU, 0)); break; + } default: break; } diff --git a/code/application/source/sf_app/code/source/4gMng/sf_4g_lpa.c b/code/application/source/sf_app/code/source/4gMng/sf_4g_lpa.c index 17e9750fb..2d6fd26e7 100755 --- a/code/application/source/sf_app/code/source/4gMng/sf_4g_lpa.c +++ b/code/application/source/sf_app/code/source/4gMng/sf_4g_lpa.c @@ -2036,7 +2036,7 @@ void sf_sample_lpa_thread(void) if(res) { - sf_set_esim_card(1); + #if 1 SampleLPA_GetSMDPAddress(); @@ -2073,6 +2073,7 @@ void sf_sample_lpa_thread(void) //ESIM Init finished sf_set_esim_init_finish(1); + sf_set_esim_card(1); char choice[SCANF_MAX_LEN]; choice[0]= '0'; @@ -2335,11 +2336,12 @@ void sf_sample_lpa_thread(void) else { //not esim - sf_set_esim_card(0); + lpaUninitialize(); //ESIM Init finished sf_set_esim_init_finish(1); + sf_set_esim_card(0); } }