From: CCC <2393524978@qq.com> Date: Wed, 19 Apr 2023 09:16:56 +0000 (+0800) Subject: 修改 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=aea65b377a3cee9f07896e77c5040cc19ff9db20;p=mirrors%2FASR3603_Z5.git 修改 --- diff --git a/2.sdk/gui/lv_drivers/indev/ACNT180.c b/2.sdk/gui/lv_drivers/indev/ACNT180.c index f5b004e7..11365cd8 100644 --- a/2.sdk/gui/lv_drivers/indev/ACNT180.c +++ b/2.sdk/gui/lv_drivers/indev/ACNT180.c @@ -79,7 +79,7 @@ static void acnt180_hisr_callback(void) gpio_count = gpio_count*1232/1208;//修正与逻辑分析仪的误差 temp1 = (gpio_count * 0.0625) - 50.0625; - temp = (cant180_irq_count * 0.0625) - 50.0625; + temp = temp1; // (cant180_irq_count * 0.0625) - 50.0625; printf("hal_acnt180_process_data2:cant*180_irq_count:%d gpio_count: %d temp:%f temp1:%f",cant180_irq_count,gpio_count,temp,temp1); gpio_set_direction(GPIO16, GPIO_OUT); @@ -110,6 +110,8 @@ void acnt180_measure_stop(void) } float acnt180_get_body_temperature(void) { + printf("[@CHENG_DEBUG][%s][%d]: %f\n", __FUNCTION__, __LINE__, temp); + return temp; } static void acnt180_IRQ_callback(void) @@ -138,4 +140,4 @@ void hal_acnt180_init(void) gpio_set_value(GPIO123, GPIO_LOW); } -#endif \ No newline at end of file +#endif diff --git a/2.sdk/gui/lv_drivers/indev/gh3018.c b/2.sdk/gui/lv_drivers/indev/gh3018.c index eb927593..80055f43 100644 --- a/2.sdk/gui/lv_drivers/indev/gh3018.c +++ b/2.sdk/gui/lv_drivers/indev/gh3018.c @@ -180,6 +180,8 @@ void gh3018_measure_stop(void) static void gh3018_hr_bp_bo_value_update(uint16_t hr, uint16_t bp_high, uint16_t bp_low, uint16_t bo) { + printf("[@CHENG_DEBUG][%s][%d]: %d,%d,%d,%d\n", __FUNCTION__, __LINE__, hr, bp_high, bp_low, bo); + if(hr > 0) { gh3018_hr_bp_bo_value.hr = hr; } diff --git a/2.sdk/gui/lv_watch/CMakeLists.txt b/2.sdk/gui/lv_watch/CMakeLists.txt index d0d16960..8144f97d 100644 --- a/2.sdk/gui/lv_watch/CMakeLists.txt +++ b/2.sdk/gui/lv_watch/CMakeLists.txt @@ -131,7 +131,7 @@ set(lv_watch_sources lv_apps/lowbattery/lowbattery.c lv_apps/sos/sos.c lv_apps/search/search.c - #lv_apps/qrcode/qrcode.c + lv_apps/qrcode/qrcode.c #lv_apps/barcode/barcode.c lv_apps/make_friends/make_friends.c lv_apps/voice_msg/voice_msg.c @@ -199,6 +199,7 @@ set(lv_watch_sources mmi_protocol/mmi_protocol_api.c mmi_protocol/mmi_protocol_fzd.c mmi_location/mmi_location.c + mmi_sundry/mmi_sundry.c #wechat lv_apps/wechat/wechat_ui.c #primary menu data diff --git a/2.sdk/gui/lv_watch/app_adaptor/app_adaptor_sensor_interface.c b/2.sdk/gui/lv_watch/app_adaptor/app_adaptor_sensor_interface.c index 86ca41c5..6ceb441c 100644 --- a/2.sdk/gui/lv_watch/app_adaptor/app_adaptor_sensor_interface.c +++ b/2.sdk/gui/lv_watch/app_adaptor/app_adaptor_sensor_interface.c @@ -263,6 +263,8 @@ void asl_hr_bp_bo_value_get(uint16_t *hr, uint16_t *bp_high, uint16_t *bp_low, u #else return; #endif + + printf("[@CHENG_DEBUG][%s][%d]: %d,%d,%d,%d\n", __FUNCTION__, __LINE__, *hr, *bp_high, *bp_low, *bo); } void asl_sport_hr_record_get(sport_hr_record_t * data) diff --git a/2.sdk/gui/lv_watch/framework/language/lang_ch.c b/2.sdk/gui/lv_watch/framework/language/lang_ch.c index 528cd32f..0b080e01 100644 --- a/2.sdk/gui/lv_watch/framework/language/lang_ch.c +++ b/2.sdk/gui/lv_watch/framework/language/lang_ch.c @@ -845,6 +845,8 @@ const void * lang_text_ch[] = { "血氧", "体温", "℃", // WATCH_TEXT_ID_TEMPERATURE_UNIT + "App正在寻找此设备\n点击屏幕关闭提醒", // WATCH_TEXT_ID_SERVER_SEARCH_PROMPT + "设备二维码", // WATCH_TEXT_ID_DEVICE_QRCODE //CHENG_MODIFY diff --git a/2.sdk/gui/lv_watch/framework/language/lang_en.c b/2.sdk/gui/lv_watch/framework/language/lang_en.c index c6a18544..fe78147e 100644 --- a/2.sdk/gui/lv_watch/framework/language/lang_en.c +++ b/2.sdk/gui/lv_watch/framework/language/lang_en.c @@ -845,6 +845,8 @@ const void * lang_text_en[] = { "SPO2", "Temperature", "C", // WATCH_TEXT_ID_TEMPERATURE_UNIT ℃ + "App is looking for this device\ntap the screen to turn off the reminder", // WATCH_TEXT_ID_SERVER_SEARCH_PROMPT + "Device qrcode", // WATCH_TEXT_ID_DEVICE_QRCODE //CHENG_MODIFY diff --git a/2.sdk/gui/lv_watch/include/ui_activity_id.h b/2.sdk/gui/lv_watch/include/ui_activity_id.h index bd1ebb4f..f164df32 100644 --- a/2.sdk/gui/lv_watch/include/ui_activity_id.h +++ b/2.sdk/gui/lv_watch/include/ui_activity_id.h @@ -186,6 +186,7 @@ enum #ifdef __MMI_HEALTH_MEASURE_TEMPERATURE_SUPPORT__ ACT_ID_HEALTH_MEASURE_TEMPERATURE, #endif + ACT_ID_WATCH_SEARCHING, ACT_ID_MAX, }; diff --git a/2.sdk/gui/lv_watch/include/ui_textid.h b/2.sdk/gui/lv_watch/include/ui_textid.h index 31f71fd1..fc7f0222 100644 --- a/2.sdk/gui/lv_watch/include/ui_textid.h +++ b/2.sdk/gui/lv_watch/include/ui_textid.h @@ -852,7 +852,8 @@ enum WATCH_TEXT_ID_SPO2, /* "血氧" "SPO2" */ WATCH_TEXT_ID_TEMPERATURE, /* "体温" "Temperature" */ WATCH_TEXT_ID_TEMPERATURE_UNIT, /* "℃" "℃" */ - + WATCH_TEXT_ID_SERVER_SEARCH_PROMPT, /* "App正在寻找此设备,点击屏幕关闭提醒" "App is looking for this device, tap the screen to turn off the reminder" */ + WATCH_TEXT_ID_DEVICE_QRCODE, /* "设备二维码" "Device qrcode" */ //CHENG_MODIFY diff --git a/2.sdk/gui/lv_watch/lv_apps/health_measure/health_measure.c b/2.sdk/gui/lv_watch/lv_apps/health_measure/health_measure.c index c59ba7e6..2fddeeeb 100644 --- a/2.sdk/gui/lv_watch/lv_apps/health_measure/health_measure.c +++ b/2.sdk/gui/lv_watch/lv_apps/health_measure/health_measure.c @@ -17,27 +17,30 @@ static uint32_t s_health_measure_heart_timed_time_stamp = 0, s_health_measure_te void mmi_hsensor_close(void) { + HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); asl_hr_bp_bo_measure_stop(); } void mmi_hsensor_heart_open(void) { + HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); asl_hr_measure_start(0); } void mmi_hsensor_blood_open(void) { + HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); asl_hr_measure_start(0); } void mmi_hsensor_spo2_open(void) { + HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); asl_bo_measure_start(0); } bool mmi_hsensor_is_open(void) { - return true; } @@ -58,17 +61,18 @@ static void mmi_hsensor_spo2_value_get(uint16 * spo2_value) void mmi_tsensor_close(void) { + HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); asl_temperature_measure_stop(); } void mmi_tsensor_open(void) { + HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); asl_temperature_measure_start(); } bool mmi_tsensor_is_open(void) { - return true; } @@ -111,6 +115,7 @@ bool mmi_health_measure_heart_data_process(uint16_t * heart_value) mmi_hsensor_heart_value_get(&t_value); #endif + HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d\n", __FUNCTION__, __LINE__, t_value); * heart_value = t_value; return true; @@ -131,6 +136,7 @@ bool mmi_health_measure_temperature_data_process(float * body_value, float * wri t_wrist_value = t_body_value - 10.0; #endif + HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %f,%f\n", __FUNCTION__, __LINE__, t_body_value, t_wrist_value); * body_value = t_body_value; * wrist_value = t_wrist_value; @@ -586,6 +592,8 @@ void mmi_health_measure_process_timer_handle(void *para) mmi_health_measure_interrupt(); return; } + + HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: total=%d,count=%d\n", __FUNCTION__, __LINE__, s_measure_time_total, s_measure_time_count); s_measure_time_count++; if(s_measure_time_total <= s_measure_time_count) @@ -648,27 +656,29 @@ void mmi_health_measure_interrupt(void) void mmi_health_measure_start(MMI_HEALTH_MEASURE_TYPE_E measure_type, uint32_t time_duration) { + HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + if(0 == time_duration) { switch(measure_type) { case MMI_HEALTH_MEASURE_HEART: - s_measure_time_total = MMI_HEALTH_MEASURE_HEART_DURATION; + s_measure_time_total = MMI_HEALTH_MEASURE_HEART_DURATION / MMI_HEALTH_MEASURE_CYCLE_DURATION; mmi_hsensor_heart_open(); break; case MMI_HEALTH_MEASURE_TEMPERATURE: - s_measure_time_total = MMI_HEALTH_MEASURE_TEMPERATURE_DURATION; + s_measure_time_total = MMI_HEALTH_MEASURE_TEMPERATURE_DURATION / MMI_HEALTH_MEASURE_CYCLE_DURATION; mmi_tsensor_open(); break; case MMI_HEALTH_MEASURE_BLOOD: - s_measure_time_total = MMI_HEALTH_MEASURE_BLOOD_DURATION; + s_measure_time_total = MMI_HEALTH_MEASURE_BLOOD_DURATION / MMI_HEALTH_MEASURE_CYCLE_DURATION; mmi_hsensor_blood_open(); break; case MMI_HEALTH_MEASURE_SPO2: - s_measure_time_total = MMI_HEALTH_MEASURE_SPO2_DURATION; + s_measure_time_total = MMI_HEALTH_MEASURE_SPO2_DURATION / MMI_HEALTH_MEASURE_CYCLE_DURATION; mmi_hsensor_spo2_open(); break; @@ -678,12 +688,12 @@ void mmi_health_measure_start(MMI_HEALTH_MEASURE_TYPE_E measure_type, uint32_t t } else { - s_measure_time_total = time_duration; + s_measure_time_total = time_duration / MMI_HEALTH_MEASURE_CYCLE_DURATION; } s_health_measure_run_data.measure_type = measure_type; s_measure_time_count = 0; - s_process_timer_id = Hal_Timer_Start(1000 * 1, mmi_health_measure_process_timer_handle, NULL, true); + s_process_timer_id = Hal_Timer_Start(MMI_HEALTH_MEASURE_CYCLE_DURATION, mmi_health_measure_process_timer_handle, NULL, true); } void mmi_health_measure_timed_measure_start(MMI_HEALTH_MEASURE_TYPE_E measure_type) @@ -708,6 +718,8 @@ void mmi_health_measure_timed_measure_start(MMI_HEALTH_MEASURE_TYPE_E measure_ty void mmi_health_measure_app_measure_start(MMI_HEALTH_MEASURE_TYPE_E measure_type) { + HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + if(MMI_HEALTH_MEASURE_STATE_UI == s_health_measure_run_data.measure_state) { return; diff --git a/2.sdk/gui/lv_watch/lv_apps/health_measure/health_measure.h b/2.sdk/gui/lv_watch/lv_apps/health_measure/health_measure.h index 5893826d..fe5ddc15 100644 --- a/2.sdk/gui/lv_watch/lv_apps/health_measure/health_measure.h +++ b/2.sdk/gui/lv_watch/lv_apps/health_measure/health_measure.h @@ -36,6 +36,7 @@ extern "C" { #define MMI_HEALTH_MEASURE_BLOOD_DURATION (34 * 1000) // ms #define MMI_HEALTH_MEASURE_SPO2_DURATION (34 * 1000) // ms +#define MMI_HEALTH_MEASURE_CYCLE_DURATION (1 * 1000) // ms typedef enum diff --git a/2.sdk/gui/lv_watch/lv_apps/phone/phone.c b/2.sdk/gui/lv_watch/lv_apps/phone/phone.c index 8f72f90a..a62a658a 100644 --- a/2.sdk/gui/lv_watch/lv_apps/phone/phone.c +++ b/2.sdk/gui/lv_watch/lv_apps/phone/phone.c @@ -631,6 +631,16 @@ static void phone_dialing(lv_obj_t * content) lv_label_set_long_mode(label, LV_LABEL_LONG_SROLL); lv_obj_set_width(label, lv_obj_get_width(content) - 10); char txt[NV_CONTACTS_MAX_NAME_LEN + NV_CONTACTS_MAX_NUMBER_LEN] = {}; +#if 1 + if(LV_BIDI_DIR_RTL == bidi_dir) + lv_obj_set_base_dir(label, LV_BIDI_DIR_LTR); + + if(strlen(call_params.name) > 0) + strcpy(txt, call_params.name); + else + strcpy(txt, call_params.number); + +#else if(LV_BIDI_DIR_RTL == bidi_dir) { lv_obj_set_base_dir(label, LV_BIDI_DIR_LTR); strcat(txt, call_params.number); @@ -645,6 +655,7 @@ static void phone_dialing(lv_obj_t * content) } strcat(txt, call_params.number); } +#endif lv_label_set_text(label, txt); lv_obj_t * cont = phone_cont_create(content, LV_LAYOUT_OFF, &lv_watch_style_transp, lv_obj_get_width(content) - 40); diff --git a/2.sdk/gui/lv_watch/lv_apps/qrcode/qrcode.c b/2.sdk/gui/lv_watch/lv_apps/qrcode/qrcode.c index b99b2bfb..95f50421 100644 --- a/2.sdk/gui/lv_watch/lv_apps/qrcode/qrcode.c +++ b/2.sdk/gui/lv_watch/lv_apps/qrcode/qrcode.c @@ -102,6 +102,21 @@ static lv_obj_t * qrcode_create_content(lv_obj_t * par) lv_obj_set_click(content, false); lv_obj_align(content, par, LV_ALIGN_CENTER, 0, -20); +#ifdef __MMI_ZHSX_SUPPORT__ + + char imei[16] = {0}; + app_adp_get_imei_req(imei); + + lv_obj_t * qrcode = qrcode_gen(content, imei, 0, 0, QRCODE_WIDTH); + lv_obj_align(qrcode, content, LV_ALIGN_CENTER, 0, 0); + + lv_obj_t * label = lv_label_create(par, NULL); + lv_obj_add_style(label, LV_OBJ_PART_MAIN, &lv_watch_font20); + lv_label_set_text(label, imei); + lv_obj_set_click(label, false); + lv_obj_align(label, content, LV_ALIGN_OUT_BOTTOM_MID, 0, 6); + +#else /*cid.txt read from nvm*/ char * cid = app_adaptor_get_cid_for_qrcode(); lv_obj_t * qrcode = qrcode_gen(content, cid, 0, 0, QRCODE_WIDTH); @@ -112,6 +127,8 @@ static lv_obj_t * qrcode_create_content(lv_obj_t * par) lv_label_set_text(label, cid); lv_obj_set_click(label, false); lv_obj_align(label, content, LV_ALIGN_OUT_BOTTOM_MID, 0, 6); +#endif + return content; } diff --git a/2.sdk/gui/lv_watch/lv_apps/setting/setting.c b/2.sdk/gui/lv_watch/lv_apps/setting/setting.c index cff33c6f..4436da6c 100644 --- a/2.sdk/gui/lv_watch/lv_apps/setting/setting.c +++ b/2.sdk/gui/lv_watch/lv_apps/setting/setting.c @@ -46,7 +46,7 @@ const struct { { ICON_SETTING_VOLUME, WATCH_TEXT_ID_VOLUME_ADJUST, setting_volume_create_btn_action }, { ICON_SETTING_BRIGHTNESS, WATCH_TEXT_ID_BRIGHTNESS_ADJUST, setting_brightness_create_btn_action }, { ICON_SETTING_DATETIME, WATCH_TEXT_ID_DATE_AND_TIME, setting_date_time_create_btn_action}, - { ICON_SETTING_LANGUAGE, WATCH_TEXT_ID_LANGUAGE_SWITCH, language_create_btn_action }, + //{ ICON_SETTING_LANGUAGE, WATCH_TEXT_ID_LANGUAGE_SWITCH, language_create_btn_action }, #if USE_LV_WATCH_VOLTE_SWTICH != 0 { ICON_SETTING_VOLTE, WATCH_TEXT_ID_VOLTE, volte_switch_create_btn_action }, #endif @@ -67,7 +67,8 @@ const struct { #endif { ICON_SETTING_ABOUT, WATCH_TEXT_ID_ABOUT_WATCH, setting_about_create_btn_action }, #if USE_LV_WATCH_QRCODE != 0 - { ICON_SETTING_QRCODE, WATCH_TEXT_ID_CREATE_QRCODE, qrcode_create_event_cb }, + //{ ICON_SETTING_QRCODE, WATCH_TEXT_ID_CREATE_QRCODE, qrcode_create_event_cb }, + { ICON_SETTING_QRCODE, WATCH_TEXT_ID_DEVICE_QRCODE, qrcode_create_event_cb }, #endif //{ &icon_setting_time_zone, WATCH_TEXT_ID_TIME_ZONE, btn_action }, //{ &icon_setting_add_friends, WATCH_TEXT_ID_ADD_FRIEND_ADJUST, btn_action }, @@ -80,7 +81,7 @@ const struct { { ICON_SETTING_DUAL_SIM, WATCH_TEXT_ID_DUAL_SIM, dualsim_create_btn_action }, #endif #if USE_LV_WATCH_MOBILE_NETWORK != 0 - { ICON_SETTING_MOBILE_NETWORK, WATCH_TEXT_ID_MOBILE_NETWORK, mobile_network_create_btn_action }, + //{ ICON_SETTING_MOBILE_NETWORK, WATCH_TEXT_ID_MOBILE_NETWORK, mobile_network_create_btn_action }, #endif /**only for craneg A1**/ #if defined(USE_LV_VAD) && (USE_LV_VAD > 0) diff --git a/2.sdk/gui/lv_watch/lv_apps/shutdown/shutdown.c b/2.sdk/gui/lv_watch/lv_apps/shutdown/shutdown.c index c1aa2542..a62a4c1e 100644 --- a/2.sdk/gui/lv_watch/lv_apps/shutdown/shutdown.c +++ b/2.sdk/gui/lv_watch/lv_apps/shutdown/shutdown.c @@ -172,6 +172,7 @@ void shutdown_confirm_btn_action(lv_obj_t * btn, lv_event_t event) checksim_task_p = NULL; #endif + printf("shutdown start1\n"); if(NULL != btn) { lv_obj_clean(lv_obj_get_parent(btn)); } @@ -185,6 +186,7 @@ void shutdown_confirm_btn_action(lv_obj_t * btn, lv_event_t event) #if USE_POWER_OFF_GIF shutdown_music(); + printf("shutdown start2\n"); lv_obj_t * activity_obj = NULL; lv_watch_activity_ext_t activity_ext; memset(&activity_ext, 0, sizeof(lv_watch_activity_ext_t)); @@ -193,11 +195,13 @@ void shutdown_confirm_btn_action(lv_obj_t * btn, lv_event_t event) LV_ASSERT_MEM(activity_obj); if(activity_obj == NULL) return; + printf("shutdown start3\n"); gif_info_t * gif_info = gif_open(activity_obj, ANIM_POWER_OFF, 1); if(!gif_info) { printf("shutdown gif failed.\n"); return; } + printf("shutdown start4\n"); shutdown_task_p = lv_task_create(shutdown_task, 100, LV_TASK_PRIO_MID, (void *)gif_info); #else printf("shutdown without power off gif.\n"); @@ -212,51 +216,7 @@ void shutdown_confirm_btn_action(lv_obj_t * btn, lv_event_t event) #ifdef __MMI_ZHSX_SUPPORT__ void mmi_watch_power_off(void) { - if(WATCH_SHUTDOWN_UNPERFORMED == shutdown_performance_flg) { - shutdown_performance_flg = WATCH_SHUTDOWN_PERFORMING; - printf("shutdown start\n"); - } else { - printf("shutdown has been performed\n"); - return; - } - - lv_task_del(lowbattery_task_p); - lowbattery_task_p = NULL; -#if USE_LV_WATCH_SIMCHECK - lv_task_del(checksim_task_p); - checksim_task_p = NULL; -#endif - - lv_watch_go_home(); -#if USE_LV_BLUETOOTH != 0 - bt_power_off(); -#endif - dial_poweroff(); - watch_set_ready_state(false); - watch_set_suspend_enable(false, ACT_ID_SHUTDOWN, 0); -#if USE_POWER_OFF_GIF - shutdown_music(); - - lv_obj_t * activity_obj = NULL; - lv_watch_activity_ext_t activity_ext; - memset(&activity_ext, 0, sizeof(lv_watch_activity_ext_t)); - activity_ext.actId = ACT_ID_ANYOBJ; - activity_obj = lv_watch_creat_activity_obj(&activity_ext); - LV_ASSERT_MEM(activity_obj); - if(activity_obj == NULL) return; - - gif_info_t * gif_info = gif_open(activity_obj, ANIM_POWER_OFF, 1); - if(!gif_info) { - printf("shutdown gif failed.\n"); - return; - } - shutdown_task_p = lv_task_create(shutdown_task, 100, LV_TASK_PRIO_MID, (void *)gif_info); -#else - printf("shutdown without power off gif.\n"); - Hal_Backlight_Off(); - lv_task_del(lowbattery_task_p); - Hal_Power_Off(HAL_TYPE_POWER_OFF); -#endif + shutdown_confirm_btn_action(NULL, LV_EVENT_CLICKED); } #endif diff --git a/2.sdk/gui/lv_watch/lv_watch.h b/2.sdk/gui/lv_watch/lv_watch.h index 15911ead..975d1ad7 100644 --- a/2.sdk/gui/lv_watch/lv_watch.h +++ b/2.sdk/gui/lv_watch/lv_watch.h @@ -170,6 +170,7 @@ extern "C" { #include "mmi_location/mmi_location.h" #include "mmi_protocol/mmi_protocol_api.h" #include "mmi_protocol/mmi_protocol_fzd.h" +#include "mmi_sundry/mmi_sundry.h" #ifdef __MMI_WECHAT_SUPPORT__ #include "lv_apps/wechat/wechat.h" #endif @@ -247,7 +248,7 @@ void watch_set_lcd_status(bool wakeup); uint32_t watch_indev_get_inactive_time(const lv_indev_t * indev); void watch_suspend_by_key(void); void watch_suspend_by_ui(void); -void qrcode_create_event_cb(lv_obj_t * btn, lv_event_t event); + void watch_set_pintype(MMI_MODEM_PIN_STATUS_TYPE pinreqtype); MMI_MODEM_PIN_STATUS_TYPE watch_get_pintype(void); void watch_wakeup_lcd(bool always); diff --git a/2.sdk/gui/lv_watch/lv_watch_res.h b/2.sdk/gui/lv_watch/lv_watch_res.h index 866e2217..0bc9ab28 100644 --- a/2.sdk/gui/lv_watch/lv_watch_res.h +++ b/2.sdk/gui/lv_watch/lv_watch_res.h @@ -659,7 +659,6 @@ LV_IMG_DECLARE(img_poweron_logo); #define ICON_COMMON_BG_WHITE "R:/png/common/ICON_COMMON_BG_WHITE.png" #define ICON_COMMON_SUCCESS "R:/png/common/ICON_COMMON_SUCCESS.png" -#endif // wechat #ifdef __MMI_WECHAT_SUPPORT__ @@ -713,6 +712,13 @@ LV_IMG_DECLARE(img_poweron_logo); //#define ICON_TEMPERATURE_MEASURE_BG "R:/png/health_measure/icon_temperature_measure_bg.png" #endif +#define AUDIO_WATCH_SEARCH "R:/audio/audio_watch_search.mp3" + +//#define ICON_CALL_OUTGOING "R:/png/call/icon_heart_rate_measure_done.png" +//#define ICON_CALL_INCOMING "R:/png/call/icon_heart_rate_measure_fail.png" +//#define ICON_CALL_CONNECTING "R:/png/call/icon_heart_rate_measure_fail.png" + +#endif //font diff --git a/2.sdk/gui/lv_watch/mmi_location/mmi_location.c b/2.sdk/gui/lv_watch/mmi_location/mmi_location.c index ca306544..99993ab2 100644 --- a/2.sdk/gui/lv_watch/mmi_location/mmi_location.c +++ b/2.sdk/gui/lv_watch/mmi_location/mmi_location.c @@ -49,39 +49,51 @@ void mmi_watch_location_mission_list_node_add(MMI_WATCH_LOCATION_TYPE_E location { MMI_WATCH_LOCATION_TYPE_E * node = _lv_ll_get_head(&s_watch_location_mission_ll); + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d\n", __FUNCTION__, __LINE__, (NULL != node) ? 1 : 0); + while(NULL != node) { if(location_type == * node) { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); return ; // exist } node = _lv_ll_get_next(&s_watch_location_mission_ll, node); } + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + MMI_WATCH_LOCATION_TYPE_E * new_node = _lv_ll_ins_head(&s_watch_location_mission_ll); * new_node = location_type; } void mmi_watch_location_mission_list_data_send(void) { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + if(true == _lv_ll_is_empty(&s_watch_location_mission_ll)) return; MMI_WATCH_LOCATION_TYPE_E * node = _lv_ll_get_tail(&s_watch_location_mission_ll); + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + while(NULL != node) { switch(* node) { case MMI_WATCH_LOCATION_UD: + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); mmi_protocol_action_send_location(&s_watch_location_data); break; case MMI_WATCH_LOCATION_CRUD: + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); mmi_protocol_action_send_cur_location(&s_watch_location_data); break; case MMI_WATCH_LOCATION_WT: + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); mmi_protocol_action_send_get_weather(&s_watch_location_data); break; @@ -106,6 +118,8 @@ void mmi_watch_location_gps_finsh_cb(void *param) { if(NULL != param) { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + double gpsLon = 0, gpsLat = 0; gpsNmeaDataT * gpsNmeaData = (gpsNmeaDataT * )param; @@ -130,11 +144,15 @@ void mmi_watch_location_gps_finsh_cb(void *param) void mmi_watch_location_gps_stop(void) { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + gps_request_locate_stop(); } void mmi_watch_location_gps_start(void) { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + s_watch_location_gps_state = MMI_WATCH_LOCATION_STATE_PROCESS; gps_request_locate_start(mmi_watch_location_gps_finsh_cb); @@ -142,7 +160,7 @@ void mmi_watch_location_gps_start(void) void mmi_watch_location_cell_stop(void) { - + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); } void mmi_watch_location_lte_cell_info_ind(app_adp_lte_cells_t *cell_list) @@ -181,6 +199,8 @@ void mmi_watch_location_gsm_cell_info_ind(app_adp_gsm_cells_t *cell_list) void mmi_watch_location_cell_start(void) { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + s_watch_location_cell_state = MMI_WATCH_LOCATION_STATE_PROCESS; app_adaptor_lte_cell_info_ind_bind(mmi_watch_location_lte_cell_info_ind); @@ -190,6 +210,8 @@ void mmi_watch_location_cell_start(void) void mmi_watch_location_wifi_stop(void) { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + wifi_scan_destroy(); } @@ -222,6 +244,8 @@ void mmi_watch_location_wifi_scan_cb(WIFI_SCAN_ID_DEF msgid, WifiInfoT *wifi_inf //if(WIFI_SCAN_MSG_COMPLETE == msgid) if(0 != wifi_info->HotspotNum) { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + s_watch_location_wifi_state = MMI_WATCH_LOCATION_STATE_SUCCESS; s_watch_location_data.wifi_data.count = wifi_info->HotspotNum; @@ -246,6 +270,8 @@ void mmi_watch_location_wifi_scan_cb(WIFI_SCAN_ID_DEF msgid, WifiInfoT *wifi_inf void mmi_watch_location_wifi_start(void) { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + s_watch_location_wifi_state = MMI_WATCH_LOCATION_STATE_PROCESS; wifi_scan_init(); @@ -255,6 +281,8 @@ void mmi_watch_location_wifi_start(void) void mmi_watch_location_mission_stop(void) { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + s_watch_location_state = 0; if(NULL != s_watch_location_timer_id) { @@ -269,18 +297,26 @@ void mmi_watch_location_mission_stop(void) void mmi_watch_location_mission_timer_cb(void * para) { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: total=%d,count=%d\n", __FUNCTION__, __LINE__, MMI_WATCH_LOCATION_CHECK_TIMES_COUNT_MAX, s_watch_location_times_check_count); + s_watch_location_times_check_count++; if(MMI_WATCH_LOCATION_CHECK_TIMES_COUNT_MAX <= s_watch_location_times_check_count) { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + mmi_watch_location_mission_list_data_send(); mmi_watch_location_mission_stop(); } else { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + if(MMI_WATCH_LOCATION_STATE_SUCCESS == s_watch_location_cell_state - &&MMI_WATCH_LOCATION_STATE_SUCCESS == s_watch_location_gps_state + && MMI_WATCH_LOCATION_STATE_SUCCESS == s_watch_location_gps_state ) { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + mmi_watch_location_mission_list_data_send(); mmi_watch_location_mission_stop(); } @@ -289,8 +325,12 @@ void mmi_watch_location_mission_timer_cb(void * para) void mmi_watch_location_mission_start(void) { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + if(0 == s_watch_location_state) { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + s_watch_location_state = 1; _lv_memset_00(&s_watch_location_data, sizeof(MMI_WATCH_LOCATION_DATA_T)); s_watch_location_times_check_count = 0; @@ -304,18 +344,24 @@ void mmi_watch_location_mission_start(void) void mmi_watch_location_mission_timed_location_action(void) { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + mmi_watch_location_mission_list_node_add(MMI_WATCH_LOCATION_UD); mmi_watch_location_mission_start(); } void mmi_watch_location_mission_current_location_action(void) { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + mmi_watch_location_mission_list_node_add(MMI_WATCH_LOCATION_CRUD); mmi_watch_location_mission_start(); } void mmi_watch_location_mission_get_weather_action(void) { + LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + mmi_watch_location_mission_list_node_add(MMI_WATCH_LOCATION_WT); mmi_watch_location_mission_start(); } diff --git a/2.sdk/gui/lv_watch/mmi_location/mmi_location.h b/2.sdk/gui/lv_watch/mmi_location/mmi_location.h index 04ddbb21..1ce66485 100644 --- a/2.sdk/gui/lv_watch/mmi_location/mmi_location.h +++ b/2.sdk/gui/lv_watch/mmi_location/mmi_location.h @@ -30,7 +30,7 @@ typedef void (*FUNC_CB)(int); #define LOCATION_MIN(a, b) (((a) > (b)) ? (b) : (a)) #define MMI_WATCH_LOCATION_PROCESS_DURATION (1000 * 10) // ms -#define MMI_WATCH_LOCATION_CHECK_TIMES_COUNT_MAX (4) // 4000 ms +#define MMI_WATCH_LOCATION_CHECK_TIMES_COUNT_MAX (4) // 40000 ms typedef enum diff --git a/2.sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.c b/2.sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.c index 99302ccc..070e40b3 100644 --- a/2.sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.c +++ b/2.sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.c @@ -185,11 +185,6 @@ bool mmi_protocol_action_link(void) return mmi_protocol_fzd_action_link(); } -bool mmi_protocol_action_bind(void) -{ - return mmi_protocol_fzd_action_bind(); -} - bool mmi_protocol_check_state_before_send_action(void) { if((false == watch_modem_sim_present_check_req()) diff --git a/2.sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.h b/2.sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.h index 19f0d23a..65a19cd0 100644 --- a/2.sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.h +++ b/2.sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.h @@ -46,8 +46,6 @@ void mmi_protocol_watch_timed_mission_action(void); void mmi_protocol_watch_heartbeat_stop(void); void mmi_protocol_watch_heartbeat_action(void); -bool mmi_protocol_action_bind(void); - bool mmi_protocol_action_link(void); bool mmi_protocol_action_send_temperature(float temp_value); diff --git a/2.sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c b/2.sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c index dcec12ef..77e7e85c 100644 --- a/2.sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c +++ b/2.sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c @@ -281,6 +281,7 @@ void mmi_protocol_fzd_send_space_deinit(MMI_PROTOCOL_FZD_ACTION_ENUM action) { PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: ptr=0x%x\n", __FUNCTION__, __LINE__, s_send_space_struct[action].ptr); lv_mem_free(s_send_space_struct[action].ptr); + s_send_space_struct[action].ptr = NULL; s_send_space_struct[action].size = 0; } } @@ -411,7 +412,7 @@ bool mmi_protocol_fzd_receive_buff_store(unsigned char * recv_buffer, int recv_l bool result = false; unsigned char * temp_ptr = NULL; - PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: receive_ptr=0x%x\n", __FUNCTION__, __LINE__, s_receive_space_struct.receive_ptr); + //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: receive_ptr=0x%x\n", __FUNCTION__, __LINE__, s_receive_space_struct.receive_ptr); if(NULL == recv_buffer || 0 == recv_len) { @@ -420,7 +421,7 @@ bool mmi_protocol_fzd_receive_buff_store(unsigned char * recv_buffer, int recv_l } else if(NULL != s_receive_space_struct.incomplete_ptr && 0 != s_receive_space_struct.incomplete_len) { - PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: incomplete buffer is not null\n", __FUNCTION__, __LINE__); + //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: incomplete buffer is not null\n", __FUNCTION__, __LINE__); temp_ptr = lv_mem_alloc(recv_len + s_receive_space_struct.incomplete_len); if (NULL != temp_ptr) @@ -445,7 +446,7 @@ bool mmi_protocol_fzd_receive_buff_store(unsigned char * recv_buffer, int recv_l } else { - PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: incomplete buffer is null\n", __FUNCTION__, __LINE__); + //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: incomplete buffer is null\n", __FUNCTION__, __LINE__); temp_ptr = lv_mem_alloc(recv_len); if (NULL != temp_ptr) @@ -481,6 +482,7 @@ bool mmi_protocol_fzd_receive_data_parse(void) int offset_head_bracket = 0, offset_device_name = 0, offset_first_sep = 0, offset_device_id = 0, offset_second_sep = 0, offset_content_len = 0, offset_third_sep = 0, offset_tail_bracket = 0; + PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%d]: len=%d, buff=%s\n", __LINE__, recv_len, recv_buffer); //check @@ -642,6 +644,8 @@ static unsigned char * mmi_protocol_fzd_action_string_get(MMI_PROTOCOL_FZD_ACTIO #endif "WT", //MMI_FZD_ACTION_GET_WEATHER + "SOS", //MMI_FZD_SERVER_SET_SOS_NUMBER + "CENTER", //MMI_FZD_SERVER_SET_CENTER_NUMBER @@ -784,6 +788,14 @@ static bool mmi_protocol_fzd_content_parse(unsigned char * content_ptr, unsigned mmi_protocol_fzd_parse_ACTION_GET_WEATHER(next_buff, next_buff_len); break; + case MMI_FZD_SERVER_SET_SOS_NUMBER: + mmi_protocol_fzd_parse_SERVER_SET_SOS_NUMBER(next_buff, next_buff_len); + break; + + case MMI_FZD_SERVER_SET_CENTER_NUMBER: + mmi_protocol_fzd_parse_SERVER_SET_CENTER_NUMBER(next_buff, next_buff_len); + break; + default: @@ -979,6 +991,7 @@ bool mmi_protocol_fzd_parse_SERVER_SET_POWEROFF(unsigned char * next_buff, unsig result = true; mmi_protocol_fzd_respond_without_data(action); uos_sleep(30); + app_adaptor_wake_up_short_time(); mmi_watch_power_off(); return result; @@ -992,14 +1005,7 @@ bool mmi_protocol_fzd_parse_SERVER_FIND_WATCH(unsigned char * next_buff, unsigne result = true; mmi_protocol_fzd_respond_without_data(action); - ////////// - ////////// - ////////// - //function - ////////// - ////////// - ////////// - //mmi_watch_server_find_screen_create(); + mmi_watch_server_search_screen_create(NULL); return result; } @@ -1782,735 +1788,62 @@ bool mmi_protocol_fzd_parse_ACTION_GET_WEATHER(unsigned char * next_buff, unsign return result; } - - - - - - - -#if 0 -signed char* km_strcpy(char* des,const char* source) +bool mmi_protocol_fzd_parse_SERVER_SET_SOS_NUMBER(unsigned char * next_buff, unsigned int next_buff_len) { - signed char* r=des; - - if (source == NULL) - { - - if (des) - { - *(des) = '\0'; - } - - return r; - } - - if (source == NULL || des == NULL) - { - return NULL; - } - - while((*des++ = *source++)!='\0'); - - return r; - -} + bool result = false; + MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_SERVER_SET_SOS_NUMBER; -void km_FZD_filename_delete_invalid_symbol(signed char *nameout,signed char *filename) -{ - int i=0; - int j=0; - - if(nameout==NULL||filename==NULL) - { - return; - } - - for(i=0;i'|| filename[i]=='|')) - { - nameout[j]= filename[i]; - j++; - } + PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + return false; } - - KM_FZD_TRACE_INFO("%s",nameout); -} -/***************************************************************************** - * FUNCTION - * applib_dt_decrease_time - * DESCRIPTION - * Decrease a reference time by some time - * PARAMETERS - * timeToDecrement [IN] Time to be decreased - * decrement [IN] Time to decrease - * Result [IN/OUT] Result of compuatation - * RETURNS - * void - *****************************************************************************/ -void applib_dt_decrease_time( - applib_time_struct *timeToDecrement, - applib_time_struct *decrement, - applib_time_struct *Result) -{ - /*----------------------------------------------------------------*/ - /* Local Variables */ - /*----------------------------------------------------------------*/ - applib_time_struct decrement_local; - applib_time_struct *decrement_local_ptr = &decrement_local; - - /*----------------------------------------------------------------*/ - /* Code Body */ - /*----------------------------------------------------------------*/ - memset(&decrement_local, 0x00, sizeof(applib_time_struct)); - memcpy(&decrement_local, decrement, sizeof(applib_time_struct)); - - if (decrement_local_ptr->nSec != 0) - { - if (timeToDecrement->nSec >= decrement_local_ptr->nSec) - { - Result->nSec = timeToDecrement->nSec - decrement_local_ptr->nSec; - } - else - { - Result->nSec = DT_MIN_PER_HR + timeToDecrement->nSec - decrement_local_ptr->nSec; - decrement_local_ptr->nMin++; - } - } - else - { - Result->nSec = timeToDecrement->nSec; - } - - if (decrement_local_ptr->nMin != 0) - { - if (timeToDecrement->nMin >= decrement_local_ptr->nMin) - { - Result->nMin = timeToDecrement->nMin - decrement_local_ptr->nMin; - } - else - { - Result->nMin = DT_MIN_PER_HR + timeToDecrement->nMin - decrement_local_ptr->nMin; - decrement_local_ptr->nHour++; - } - } - else - { - Result->nMin = timeToDecrement->nMin; - } - - if (decrement_local_ptr->nHour != 0) - { - if (timeToDecrement->nHour >= decrement_local_ptr->nHour) - { - Result->nHour = timeToDecrement->nHour - decrement_local_ptr->nHour; - } - else - { - Result->nHour = DT_HRS_PRE_DAY + timeToDecrement->nHour - decrement_local_ptr->nHour; - decrement_local_ptr->nDay++; - } - } - else - { - Result->nHour = timeToDecrement->nHour; - } - - if (decrement_local_ptr->nDay != 0) - { - if (timeToDecrement->nDay > decrement_local_ptr->nDay) - { - Result->nDay = timeToDecrement->nDay - decrement_local_ptr->nDay; - } - else - { - decrement_local_ptr->nMonth++; - if (timeToDecrement->nMonth != 1) - { - Result->nDay = applib_dt_last_day_of_mon( - (kal_uint8) (timeToDecrement->nMonth - 1), - timeToDecrement->nYear) + timeToDecrement->nDay - decrement_local_ptr->nDay; - } - else - { - Result->nDay = 31 + timeToDecrement->nDay - decrement_local_ptr->nDay; - } - } - } - else - { - Result->nDay = timeToDecrement->nDay; - } - - if (decrement_local_ptr->nMonth != 0) - { - if (timeToDecrement->nMonth > decrement_local_ptr->nMonth) - { - Result->nMonth = timeToDecrement->nMonth - decrement_local_ptr->nMonth; - } - else - { - Result->nMonth = DT_MONTH_PER_YEAR + timeToDecrement->nMonth - decrement_local_ptr->nMonth; - decrement_local_ptr->nYear++; - } - } - else - { - Result->nMonth = timeToDecrement->nMonth; - } - - Result->nYear = timeToDecrement->nYear - decrement_local_ptr->nYear; - - Result->DayIndex = applib_dt_dow(Result->nYear, Result->nMonth, Result->nDay); - -} -/***************************************************************************** - * FUNCTION - * applib_dt_increase_time - * DESCRIPTION - * Increase a reference time by some time - * PARAMETERS - * timeToIncrement [IN] Time to be increased - * increment [?] - * Result [?] - * decrement(?) [IN] Time to increase - * RETURNS - * result of computation(?) - *****************************************************************************/ -void applib_dt_increase_time( - applib_time_struct *timeToIncrement, - applib_time_struct *increment, - applib_time_struct *Result) -{ - /*----------------------------------------------------------------*/ - /* Local Variables */ - /*----------------------------------------------------------------*/ - kal_int16 NumOfDays; - - /*----------------------------------------------------------------*/ - /* Code Body */ - /*----------------------------------------------------------------*/ - /* second */ - Result->nSec = (timeToIncrement->nSec + increment->nSec); - - /* minute */ - Result->nMin = (timeToIncrement->nMin + increment->nMin); - if (Result->nSec >= DT_MIN_PER_HR) - { - Result->nSec -= DT_MIN_PER_HR; - Result->nMin += 1; - } - - /* hour */ - Result->nHour = (timeToIncrement->nHour + increment->nHour); - if (Result->nMin >= DT_MIN_PER_HR) - { - Result->nMin -= DT_MIN_PER_HR; - Result->nHour += 1; - } - - /* day */ - Result->nDay = (timeToIncrement->nDay + increment->nDay); - if (Result->nHour >= DT_HRS_PRE_DAY) - { - Result->nHour -= DT_HRS_PRE_DAY; - Result->nDay += +1; - } - - /* month, year */ - Result->nMonth = timeToIncrement->nMonth + increment->nMonth; - Result->nYear = timeToIncrement->nYear + increment->nYear; - - if (Result->nMonth > DT_MONTH_PER_YEAR) - { - Result->nMonth -= DT_MONTH_PER_YEAR; - Result->nYear++; - } - - /* correct day */ - NumOfDays = applib_dt_last_day_of_mon(timeToIncrement->nMonth, timeToIncrement->nYear); - - if (Result->nDay > NumOfDays) - { - Result->nDay -= NumOfDays; - if (Result->nMonth != 12) - { - Result->nMonth += 1; - } - else - { - Result->nMonth = 1; - Result->nYear += 1; - } - } + result = true; + mmi_protocol_fzd_respond_without_data(action); - Result->DayIndex = applib_dt_dow(Result->nYear, Result->nMonth, Result->nDay); -} + ////////// + ////////// + ////////// + //function + ////////// + ////////// + ////////// -static int km_FZD_net_parse_TK(signed char *next_buf,int next_buf_len,signed char seq) -{ - signed char send_temp[20] = {0}; - signed int content_lenth = 0; - uint16 record_id = 0; - - if(next_buf_len == 1) - { - //SG*5678901234*0004*TK,1 - //this is rsp. - unsigned char send_result = (*next_buf == '1')?1:0; - MMIAPI_SetSendWechatContentResult(send_result); - } - else - { - #if defined(MMI_C51_NO_LCD_DISPLAY_SUPPORT) - sprintf(send_temp, ",%d", record_id); - content_lenth = strlen(send_temp); - km_FZD_net_construct_and_do_rsp(KM_FZD_NET_PT_ACTION_TK, send_temp, content_lenth, seq); - - #else - //SG*5678901234*0256*TK,data - //convert send buff to TK buff. - next_buf_len = km_FZD_net_untextdata_decrypt((unsigned char *)next_buf, (unsigned int)next_buf_len); - record_id = MMIAPI_SaveWechatAudioData(next_buf, next_buf_len, PNULL); - - //send rsp. - sprintf(send_temp, ",%d", (0xFFFF != record_id)); - content_lenth = strlen(send_temp); - km_FZD_net_construct_and_do_rsp(KM_FZD_NET_PT_ACTION_TK, send_temp, content_lenth, seq); - - if(FALSE == km_FZD_currtime_is_in_dnd_cfg()) - { - #if defined(DRV_RGB_LED_SUPPORT) - MMIAPI_SetRgbledEvent(RGBLED_PRIORITY_WECHAT_NEW_MSG, TRUE); - #endif - #if defined(MMI_D10_NO_LCD_DISPLAY_SUPPORT) - MMIAPI_PlayNewVoice(); - MMIAPI_StartWechatMsgNoReadTimer(); - #else - MMIAPI_PlayWechatNewMsgRing(); - #endif - } - #endif - } -} -static int km_FZD_net_parse_TKOne(signed char *next_buf,int next_buf_len,signed char seq) -{ - //Todolist - KM_TRACE_INFO("km_FZD_net_parse_TKOne: is need parse !"); - - if(FALSE == km_FZD_currtime_is_in_dnd_cfg()) - { - #if !defined(MMI_C51_NO_LCD_DISPLAY_SUPPORT) - #if defined(MMI_D10_NO_LCD_DISPLAY_SUPPORT) - MMIAPI_PlayNewVoice(); - MMIAPI_StartWechatMsgNoReadTimer(); - #else - MMIAPI_PlayWechatNewMsgRing(); - #endif - #endif - } -} -static int km_FZD_net_parse_TKIMG(signed char *next_buf,int next_buf_len,signed char seq) -{ - signed char send_temp[20] = {0}; - signed int content_lenth = 0; - uint16 record_id = 0; - - KM_TRACE_INFO("km_FZD_net_parse_TKIMG: next_buf_len = %d, next_buf = %s !", next_buf_len, next_buf); - - if(next_buf_len == 1) - { - //SG*5678901234*0004*TKIMG,1 - //this is rsp. - unsigned char send_result = (*next_buf == '1')?1:0; - MMIAPI_SetSendWechatContentResult(send_result); - } - else - { - #if defined(MMI_C51_NO_LCD_DISPLAY_SUPPORT) - sprintf(send_temp, ",%d", record_id); - content_lenth = strlen(send_temp); - km_FZD_net_construct_and_do_rsp(KM_FZD_NET_PT_ACTION_TKIMG, send_temp, content_lenth, seq); - - #else - //SG*5678901234*0256*TKIMG,data - //convert send buff to TKIMG buff. - next_buf_len = km_FZD_net_untextdata_decrypt((unsigned char *)next_buf, (unsigned int)next_buf_len); - record_id = MMIAPI_SaveWechatImageData(next_buf, next_buf_len, PNULL); - - //send rsp. - sprintf(send_temp, ",%d", (0xFFFF != record_id)); - content_lenth = strlen(send_temp); - km_FZD_net_construct_and_do_rsp(KM_FZD_NET_PT_ACTION_TKIMG, send_temp, content_lenth, seq); - - if(FALSE == km_FZD_currtime_is_in_dnd_cfg()) - { - #if defined(MMI_D10_NO_LCD_DISPLAY_SUPPORT) - MMIAPI_PlayNewVoice(); - MMIAPI_StartWechatMsgNoReadTimer(); - #else - MMIAPI_PlayWechatNewMsgRing(); - #endif - } - #endif - } + return result; } -void ic_fzd_net_parse_wt(signed char *next_buf,int next_buf_len,signed char seq) +bool mmi_protocol_fzd_parse_SERVER_SET_CENTER_NUMBER(unsigned char * next_buff, unsigned int next_buff_len) { - //[XT*334588000000156*009F*WT,Äê-ÔÂ-ÈÕ,ʱ:·Ö:Ãë,ÌìÆøÃèÊö,ÌìÆø±àºÅ,µ±Ç°Î¶È,×îµÍÎÂ,×î¸ß ÎÂ,³ÇÊÐÃû] - signed char *phead = NULL; - signed char *ptail = NULL; - signed char *p1 = NULL; - signed char *p2 = NULL; - WEATHER_NVRAM_STRUCT fzd_weather = {0}; - signed char len = 0; - unsigned char i = 0; - - if ((NULL == next_buf) || (next_buf_len <= 0)) - { - KM_FZD_TRACE_ERROR("parameter error!"); - return ; - } - - KM_FZD_TRACE_INFO("WT: (%s)(%d)", next_buf, next_buf_len); - - phead = ptail = next_buf; - - //parse date - if (ptail = strstr(phead, ",")) - { - *(ptail++) = '\0'; - - //year - p2 = p1 = phead; - if (p2 = strstr(p1, "-")) - { - *(p2++) = '\0'; - fzd_weather.weather_desc[0].time.nYear = atoi(p1); - } - - //month - p1 = p2; - if (p2 = strstr(p1, "-")) - { - *(p2++) = '\0'; - fzd_weather.weather_desc[0].time.nMonth = atoi(p1); - } - - //day - p1 = p2; - fzd_weather.weather_desc[0].time.nDay = atoi(p1); - } - - //parse time - phead = ptail; - if (ptail = strstr(phead, ",")) - { - *(ptail++) = '\0'; - - //hour - p2 = p1 = phead; - if (p2 = strstr(p1, ":")) - { - *(p2++) = '\0'; - fzd_weather.weather_desc[0].time.nHour = atoi(p1); - } - - //min - p1 = p2; - if (p2 = strstr(p1, ":")) - { - *(p2++) = '\0'; - fzd_weather.weather_desc[0].time.nMin = atoi(p1); - } - - //sec - p1 = p2; - fzd_weather.weather_desc[0].time.nSec = atoi(p1); - } - - //parse weather decription - phead = ptail; - if (ptail = strstr(phead, ",")) - { - *(ptail++) = '\0'; - } - - //parse weather num - phead = ptail; - if (ptail = strstr(phead, ",")) - { - *(ptail++) = '\0'; - fzd_weather.weather_desc[0].weater_No = atoi(phead); - } - - //parse current temperature - phead = ptail; - if (ptail = strstr(phead, ",")) - { - uint8 is_negative = 0; - if(*phead == '-') - { - is_negative = 1; - phead++; - } - - *(ptail++) = '\0'; - fzd_weather.weather_desc[0].curr_temperature = is_negative ? (0 - atoi(phead)) : atoi(phead); - } - - //parse min temperature - phead = ptail; - if (ptail = strstr(phead, ",")) - { - uint8 is_negative = 0; - if(*phead == '-') - { - is_negative = 1; - phead++; - } - - *(ptail++) = '\0'; - fzd_weather.weather_desc[0].min_temperature = is_negative ? (0 - atoi(phead)) : atoi(phead); - } + bool result = false; + MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_SERVER_SET_CENTER_NUMBER; - //parse max temperature - phead = ptail; - if (ptail = strstr(phead, ",")) + if(NULL == next_buff || 0 == next_buff_len) { - uint8 is_negative = 0; - if(*phead == '-') - { - is_negative = 1; - phead++; - } - - *(ptail++) = '\0'; - fzd_weather.weather_desc[0].max_temperature = is_negative ? (0 - atoi(phead)) : atoi(phead); + PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + return false; } - //parse city - phead = ptail; - len = strlen(phead); - for(i = 0; i*4 < len; i++){ - fzd_weather.city_name[i] = km_str_hex_string_to_number(phead+i*4,4); - KM_FZD_TRACE_INFO("fzd_weather.city_name[%d]:%04x", i, fzd_weather.city_name[i]); - } + result = true; + mmi_protocol_fzd_respond_without_data(action); - KM_FZD_TRACE_INFO("{\n"); - KM_FZD_TRACE_INFO("\t date: %02d-%02d-%02d", \ - fzd_weather.weather_desc[0].time.nYear, \ - fzd_weather.weather_desc[0].time.nMonth,\ - fzd_weather.weather_desc[0].time.nDay); - KM_FZD_TRACE_INFO("\t time: %02d:%02d:%02d", \ - fzd_weather.weather_desc[0].time.nMonth, \ - fzd_weather.weather_desc[0].time.nMin, \ - fzd_weather.weather_desc[0].time.nSec); - KM_FZD_TRACE_INFO("\t weather code: %d", fzd_weather.weather_desc[0].weater_No); - KM_FZD_TRACE_INFO("\t current temperature : %d", fzd_weather.weather_desc[0].curr_temperature); - KM_FZD_TRACE_INFO("\t min temperature : %d", fzd_weather.weather_desc[0].min_temperature); - KM_FZD_TRACE_INFO("\t max temperature : %d", fzd_weather.weather_desc[0].max_temperature); - KM_FZD_TRACE_INFO("\t city : %s", fzd_weather.city_name); - KM_FZD_TRACE_INFO("\t city_name_len : %d", fzd_weather.city_name_len); - KM_FZD_TRACE_INFO("\t real_data_num : %d", fzd_weather.real_data_num); - KM_FZD_TRACE_INFO("}\n"); - - if((3 > s_parse_wt_count) - && (0 == fzd_weather.weather_desc[0].curr_temperature && 0 == fzd_weather.weather_desc[0].min_temperature && 0 == fzd_weather.weather_desc[0].max_temperature)) - { - s_parse_wt_count++; - MMIAPI_StartWeatherFreshFromNet(); - } - else - { - s_parse_wt_count = 0; - MMIAPI_SetWeatherDataToNv(&fzd_weather); - } + ////////// + ////////// + ////////// + //function + ////////// + ////////// + ////////// - return; + return result; } -/***************************************************************************** - Prototype : ic_fzd_convert_and_save_to_file - Description £º×ª»»½ÓÊÕµ½µÄÊý¾Ý£¬±£´æµ½Îļþ - Input : None - Output : None - Return Value : - Calls : - Called By : - - History : - 1.Date : 2019/3/2 - Author : leihj - Modification : Created function - - 0X7D 0X01 --> 0X7D - 0X7D 0X02 --> 0X5B - 0X7D 0X03 --> 0X5D - 0X7D 0X04 --> 0X2C - 0X7D 0X05 --> 0X2A - -*****************************************************************************/ -char ic_fzd_convert_and_save_to_file(wchar *file_path, char *buf, int buf_len) -{ - int dir_fd = 0; - int fd = 0; - int i = 0; - char tmp1 = 0; - char tmp2 = 0; - char value = 0; - char w_data[100] = {0}; - char w_len = 0; - MMIFILE_HANDLE file_handle; - uint32 bytes_to_write = 0; - if ((NULL == file_path) || (NULL == buf) || (buf_len <= 0)) - { - KM_FZD_TRACE_ERROR("parameter error"); - return -1; - } - file_handle = MMIFILE_CreateFile(file_path, SFS_MODE_CREATE_ALWAYS | SFS_MODE_WRITE, NULL, NULL); - for (i = 0; i < buf_len - 1; i++) - { - tmp1 = buf[i]; - tmp2 = buf[i + 1]; - w_data[w_len] = tmp1; - if ((0x7d == tmp1) && ((tmp2 >= 0x01) && (tmp2 <= 0x05))) - { - switch (tmp2) - { - case 0x01: - value = 0x7d; - break; - - case 0x02: - value = 0x5b; - break; - - case 0x03: - value = 0x5d; - break; - - case 0x04: - value = 0x2c; - break; - - case 0x05: - value = 0x2a; - break; - } - - //save new value and skip tmp2 - w_data[w_len] = value; - i++; - } - - //when buffer w_data is full, it need to write buffer to specific file. - w_len++; - if (sizeof(w_data) == w_len) - { - MMIFILE_WriteFile(file_handle, (void *)w_data, (uint32)w_len, &bytes_to_write, NULL); - w_len = 0; - } - } - KM_FZD_TRACE_INFO("ic_fzd_convert_and_save_to_file -111: buf_len = %d, i = %d",buf_len,i); - //save the last data - //×îºóµÄÁ½¸öÊý¾ÝÊÇÎÞÐè×ªÒÆµÄ£¬ÐèÒª°Ñ×îºóµÄÒ»¸öÊý¾Ý±£´æÆðÀ´ - //µ±i == next_buf_lenʱ£¬±íʾ×îºóÒ»¸öÊý¾ÝÊÇÐèҪתÒåµÄ£¬ÎÞÐè±£´æÕâ¸öÊý¾Ý - if (i == buf_len - 1) - { - w_data[w_len++] = buf[buf_len - 1]; - } - - //±£´æÊ£ÓàµÄÊý¾Ý - if (w_len > 0) - { - MMIFILE_WriteFile(file_handle, (void *)w_data, (uint32)w_len, &bytes_to_write, NULL); - w_len = 0; - } - MMIFILE_CloseFile(file_handle); - KM_FZD_TRACE_ERROR("cid: %s", file_path); - return 0; -} -/***************************************************************************** - Prototype : ic_fzd_net_parse_cid - Description : - Input : None - Output : None - Return Value : - len of receiver data: 2048bytes - - // 0X7D 0X01 --> 0x7D - // 0X7D 0X02 --> 0x5B - // 0X7D 0X03 --> 0x5D - // 0X7D 0X04 --> 0x2C - // 0X7D 0X05 --> 0x2A -*****************************************************************************/ -void ic_fzd_net_parse_cid(signed char *next_buf,int next_buf_len,signed char seq) -{ - if(MMIFILE_IsFileExist((wchar *)MMI_FZD_FLODER_FILE_PNG, MMIAPICOM_Wstrlen((wchar *)MMI_FZD_FLODER_FILE_PNG))) - { - MMIFILE_DeleteFile ((wchar *)MMI_FZD_FLODER_FILE_PNG, NULL); - } - ic_fzd_convert_and_save_to_file((wchar *)MMI_FZD_FLODER_FILE_PNG, next_buf, next_buf_len); -} -/***************************************************************************** - Prototype : ic_fzd_net_parse_cid_jpg - Description : - Input : None - Output : None - Return Value : - len of receiver data: 1378bytes - - // 0X7D 0X01 --> 0x7D - // 0X7D 0X02 --> 0x5B - // 0X7D 0X03 --> 0x5D - // 0X7D 0X04 --> 0x2C - // 0X7D 0X05 --> 0x2A -*****************************************************************************/ -void ic_fzd_net_parse_cid_jpg(signed char *next_buf,int next_buf_len,signed char seq) -{ - if(MMIFILE_IsFileExist((wchar *)MMI_FZD_FLODER_FILE_JPG, MMIAPICOM_Wstrlen((wchar *)MMI_FZD_FLODER_FILE_JPG))) - { - MMIFILE_DeleteFile ((wchar *)MMI_FZD_FLODER_FILE_JPG, NULL); - } - ic_fzd_convert_and_save_to_file((wchar *)MMI_FZD_FLODER_FILE_JPG, next_buf, next_buf_len); -} -/***************************************************************************** - Prototype : ic_fzd_net_parse_voice - Description : parse response - Input : None - Output : None - Return Value : - Calls : - Called By : - - ƽ̨»ØÓ¦ÓïÒô: - ½âÎöÓïÒôʧ°Ü£¬·µ»Ø[XT*YYYYYYYYYYYYYYY*0007*VOICE,´íÎóÂë] - ´íÂëÂë·Ö±ðΪ 0,1,2£º0 ±íʾ·Ç amr ÒôƵÊý¾Ý¡¢1 ±íʾÓïÒôʶ±ð²»³ö¡¢2 ±íʾÓïÒô²»¶ÔÓ¦ÈκÎÖ¸Áî - -*****************************************************************************/ -void ic_fzd_net_parse_voice(signed char *next_buf,int next_buf_len,signed char seq) -{ - signed char value = 0; - if ((NULL == next_buf) || (next_buf_len <= 0)) - { - KM_FZD_TRACE_ERROR("parameter error"); - return ; - } - //value ·Ö±ðΪ 0,1,2£º0 ±íʾ·Ç amr ÒôƵÊý¾Ý¡¢1 ±íʾÓïÒôʶ±ð²»³ö¡¢2 ±íʾÓïÒô²»¶ÔÓ¦ÈκÎÖ¸Áî - value = atoi(next_buf); -} -#endif #endif diff --git a/2.sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h b/2.sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h index ffebe29b..0dbf0c86 100644 --- a/2.sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h +++ b/2.sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h @@ -105,13 +105,13 @@ typedef enum MMI_FZD_SERVER_SET_FACTORY, MMI_FZD_SERVER_SET_POWEROFF, - MMI_FZD_SERVER_FIND_WATCH, + MMI_FZD_SERVER_FIND_WATCH, // 11 MMI_FZD_SERVER_GET_VERSION, MMI_FZD_SERVER_SET_PHONEBOOK, MMI_FZD_SERVER_SET_CALL, MMI_FZD_SERVER_SET_REMIND, - MMI_FZD_SERVER_SET_HEART_INTERVAL, + MMI_FZD_SERVER_SET_HEART_INTERVAL, // 16 MMI_FZD_ACTION_SEND_HEART, MMI_FZD_SERVER_SET_TEMPERATURE_INTERVAL, MMI_FZD_ACTION_SEND_TEMPERATURE, @@ -126,6 +126,9 @@ typedef enum MMI_FZD_ACTION_GET_WEATHER, + MMI_FZD_SERVER_SET_SOS_NUMBER, // 26 + MMI_FZD_SERVER_SET_CENTER_NUMBER, + /*******add before this line*******/ @@ -198,6 +201,9 @@ bool mmi_protocol_fzd_action_send_cur_location(MMI_WATCH_LOCATION_DATA_T * locat bool mmi_protocol_fzd_action_send_get_weather(MMI_WATCH_LOCATION_DATA_T * location_data); bool mmi_protocol_fzd_parse_ACTION_GET_WEATHER(unsigned char * next_buff, unsigned int next_buff_len); +bool mmi_protocol_fzd_parse_SERVER_SET_SOS_NUMBER(unsigned char * next_buff, unsigned int next_buff_len); + +bool mmi_protocol_fzd_parse_SERVER_SET_CENTER_NUMBER(unsigned char * next_buff, unsigned int next_buff_len); diff --git a/2.sdk/gui/lv_watch/mmi_sundry/mmi_sundry.c b/2.sdk/gui/lv_watch/mmi_sundry/mmi_sundry.c new file mode 100644 index 00000000..4d9c523b --- /dev/null +++ b/2.sdk/gui/lv_watch/mmi_sundry/mmi_sundry.c @@ -0,0 +1,143 @@ + + + +#include "lv_watch.h" + +#ifdef __MMI_ZHSX_SUPPORT__ + +static TIMER_ID s_watch_search_timer_id = NULL; + + +void mmi_watch_search_timer_stop(void) +{ + if(NULL != s_watch_search_timer_id) + { + Hal_Timer_Stop(s_watch_search_timer_id); + s_watch_search_timer_id = NULL; + } +} + +static void mmi_watch_search_audio_ctrl_callback(AUDIO_CTRL_PRIORITY priority) +{ + SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: priority=%d\n", __FUNCTION__, __LINE__, priority); + + if(AUDIO_CTRL_PRIORITY_SEARCH == priority) + { + if (AUDIO_CTRL_PRIORITY_SEARCH == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_SEARCH, mmi_watch_search_audio_ctrl_callback)) + { + Hal_NFFS_File_Play_Repeat(AUDIO_SEARCH, HAL_AUDIO_SPK_LEVEL_MAX); + } + } + else if(AUDIO_CTRL_PRIORITY_SEARCH > priority) + { + mmi_watch_search_screen_destroy(); + } +} + +void mmi_watch_search_timeout_cb(void * para) +{ + mmi_watch_search_screen_destroy(); +} + +void mmi_watch_search_timer_start(void) +{ + mmi_watch_search_timer_stop(); + s_watch_search_timer_id = Hal_Timer_Start(MMI_WATCH_SEARCH_DURATION, mmi_watch_search_timeout_cb, NULL, false); +} + +void mmi_watch_search_screen_destroy(void) +{ + //lv_watch_search_ext_t * ext = lv_obj_get_ext_attr(lv_watch_get_activity_obj(ACT_ID_WATCH_SEARCHING)); + + mmi_watch_search_timer_stop(); + + //if (AUDIO_CTRL_PRIORITY_SEARCH == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_SEARCH, mmi_watch_search_audio_ctrl_callback)) + //{ + // Hal_Tone_Play_End(); + //} + Hal_Audio_Manage_End_Ind(AUDIO_CTRL_PRIORITY_SEARCH); + Hal_Vibrator_Play_End(); + + lv_watch_png_cache_all_free(); + lv_obj_del_async(lv_watch_get_activity_obj(ACT_ID_WATCH_SEARCHING)); + + watch_set_suspend_enable(true, ACT_ID_WATCH_SEARCHING, 0); +} + +void mmi_watch_search_screen_event_cb(lv_obj_t * obj, lv_event_t e) +{ + SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: event=%d\n", __FUNCTION__, __LINE__, e); + + if(LV_EVENT_PRESSED == e || LV_EVENT_CLICKED == e) + { + mmi_watch_search_screen_destroy(); // lv_watch_del_interface(ACT_ID_WATCH_SEARCHING); + } +} + +lv_obj_t * mmi_watch_server_search_screen_create(lv_obj_t * activity_obj) +{ + SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + + if(NULL == activity_obj) + { + lv_watch_activity_ext_t activity_ext = {0}; + + activity_ext.actId = ACT_ID_WATCH_SEARCHING; + activity_ext.create = (lv_watch_activity_create_f_t)mmi_watch_server_search_screen_create; + activity_ext.prepare_destory = mmi_watch_search_screen_destroy; + activity_obj = lv_watch_creat_activity_obj(&activity_ext); + LV_ASSERT_MEM(activity_obj); + } + + lv_obj_t * obj = lv_watch_obj_create(activity_obj); + LV_ASSERT_MEM(obj); + + lv_watch_search_ext_t * searching_ext = lv_obj_allocate_ext_attr(obj, sizeof(lv_watch_search_ext_t)); + + lv_obj_t * cont = lv_cont_create(obj, NULL); + lv_obj_set_size(cont, lv_obj_get_width(obj), lv_obj_get_height(obj)); + lv_obj_align(cont, obj, LV_ALIGN_CENTER, 0, 0); + lv_obj_set_style_local_bg_color(cont, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(0, 0, 0)); + lv_obj_set_click(cont, true); + lv_obj_set_event_cb(cont, mmi_watch_search_screen_event_cb); + //lv_obj_add_protect(cont, LV_PROTECT_PRESS_LOST); + + lv_obj_t * label = lv_label_create(cont, NULL); + lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font20); + lv_label_set_text_id(label, WATCH_TEXT_ID_SERVER_SEARCH_PROMPT); //lv_lang_get_text(WATCH_TEXT_ID_SERVER_SEARCH_PROMPT) + lv_obj_align(label, cont, LV_ALIGN_CENTER, 0, 0); + + //prompt + if (AUDIO_CTRL_PRIORITY_SEARCH == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_SEARCH, mmi_watch_search_audio_ctrl_callback)) + { + Hal_NFFS_File_Play_Repeat(AUDIO_WATCH_SEARCH, HAL_AUDIO_SPK_LEVEL_MAX); // query_current_volume() + } + Hal_Vibrator_Play_Repeat(); + + mmi_watch_search_timer_start(); + + //watch_wakeup_lcd(true); + if(0 == Hal_Pm_Get_State()) + { + Hal_Pm_WakeUp(); + watch_set_lcd_status(true); + } + else + { + watch_set_lcd_status(true); + watch_wakeup_time_reset(); + } + watch_set_suspend_enable(false, ACT_ID_WATCH_SEARCHING, 0); + + return obj; +} + + + + + + + +#endif + + diff --git a/2.sdk/gui/lv_watch/mmi_sundry/mmi_sundry.h b/2.sdk/gui/lv_watch/mmi_sundry/mmi_sundry.h new file mode 100644 index 00000000..9e86fbdf --- /dev/null +++ b/2.sdk/gui/lv_watch/mmi_sundry/mmi_sundry.h @@ -0,0 +1,49 @@ + + + +#ifdef __MMI_ZHSX_SUPPORT__ + +#ifndef __MMI_SUNDRY_H__ +#define __MMI_SUNDRY_H__ + +#ifdef __cplusplus +extern "C" +{ +#endif //__cplusplus + + +#include "lv_watch.h" + + +#define __MMI_SUNDRY_DEBUG__ +#ifdef __MMI_SUNDRY_DEBUG__ +#define SUNDRY_DEBUG_PRINTF(fmt, ...) printf("[SUNDRY]"fmt, ##__VA_ARGS__) +#else +#define SUNDRY_DEBUG_PRINTF(fmt, ...) +#endif + + +#define MMI_WATCH_SEARCH_DURATION (1000 * 60) // ms + +typedef struct +{ + lv_watch_obj_ext_t old_ext; + lv_obj_t * label; +} lv_watch_search_ext_t; + +void mmi_watch_search_screen_destroy(void); +lv_obj_t * mmi_watch_server_search_screen_create(lv_obj_t * activity_obj); + + + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif //__cplusplus + +#endif + +#endif + + diff --git a/2.sdk/gui/lv_watch/modem/mmi_modem_tcp/mmi_modem_tcp_msg_handler_impl.c b/2.sdk/gui/lv_watch/modem/mmi_modem_tcp/mmi_modem_tcp_msg_handler_impl.c index 81dd327d..02b20b27 100644 --- a/2.sdk/gui/lv_watch/modem/mmi_modem_tcp/mmi_modem_tcp_msg_handler_impl.c +++ b/2.sdk/gui/lv_watch/modem/mmi_modem_tcp/mmi_modem_tcp_msg_handler_impl.c @@ -185,7 +185,7 @@ void read_tcp_cmdmsg_handler_impl(void *msg) mmi_protocol_receive_data_process(recv_str, recv_len); } - printf("[@CHENG_DEBUG][%s][%d]: recv_str=0x%x\n", __FUNCTION__, __LINE__, recv_str); + //printf("[@CHENG_DEBUG][%s][%d]: recv_str=0x%x\n", __FUNCTION__, __LINE__, recv_str); //free(recv_str); Hal_Mem_Free(recv_str); return; diff --git a/2.sdk/gui/lv_watch/resource/audio/audio_watch_search.mp3 b/2.sdk/gui/lv_watch/resource/audio/audio_watch_search.mp3 new file mode 100644 index 00000000..673a9977 Binary files /dev/null and b/2.sdk/gui/lv_watch/resource/audio/audio_watch_search.mp3 differ diff --git a/2.sdk/product/craneg_modem/config/watch/lv_watch_conf.h b/2.sdk/product/craneg_modem/config/watch/lv_watch_conf.h index a9aecc61..38dd8d85 100644 --- a/2.sdk/product/craneg_modem/config/watch/lv_watch_conf.h +++ b/2.sdk/product/craneg_modem/config/watch/lv_watch_conf.h @@ -53,13 +53,13 @@ #define USE_LV_WATCH_DIAL_ROCKET 1 #define USE_LV_WATCH_DIAL_BEAR 1 #define USE_LV_WATCH_MAKE_FRIENDS 0 // 1 -#define USE_LV_WATCH_QRCODE 0 +#define USE_LV_WATCH_QRCODE 1 // 0 #define USE_LV_WATCH_QRCODE_SCAN 0 #define USE_LV_WATCH_STOPWATCH 1 #define USE_LV_WATCH_SOS 1 #define USE_LV_WATCH_LOWBATTERY 1 #define USE_LV_WATCH_SEARCH 1 -#define USE_LV_WATCH_SEARCH_SWTICH 1 +#define USE_LV_WATCH_SEARCH_SWTICH 0 // 1 #define USE_LV_WATCH_SEARCH_PHONE 0 #define USE_LV_WATCH_DIALPAD 1 #define USE_LV_WATCH_ALARM 1 @@ -74,7 +74,7 @@ #define USE_LV_WATCH_ALBUM 1 #define USE_LV_WATCH_ENGINEER_MODE 1 #define USE_LV_WATCH_CTA 1 -#define USE_LV_WATCH_VOLTE_SWTICH 1 +#define USE_LV_WATCH_VOLTE_SWTICH 0 // 1 #define USE_LV_WATCH_VIDEOCALL 1 #define USE_LV_WATCH_CALENDAR 1 #define USE_LV_WATCH_AUDIO_PLAYER 1