From: CCC <2393524978@qq.com> Date: Fri, 20 Oct 2023 03:44:04 +0000 (+0800) Subject: hengai X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=08e624f4c7e31044d4cbc5aaee5270a24babd63f;p=mirrors%2FASR3603_Z5.git hengai --- diff --git a/2.sdk/project/Z5_K7/gui/lv_watch/resource/audio/AUDIO_REMIND_SLEEP.mp3 b/2.sdk/project/Z5_K7/gui/lv_watch/resource/audio/AUDIO_REMIND_SLEEP.mp3 new file mode 100644 index 00000000..120958c6 Binary files /dev/null and b/2.sdk/project/Z5_K7/gui/lv_watch/resource/audio/AUDIO_REMIND_SLEEP.mp3 differ diff --git a/2.sdk/project/Z5_K7/gui/lv_watch/resource/audio/AUDIO_REMIND_WAKE_UP.mp3 b/2.sdk/project/Z5_K7/gui/lv_watch/resource/audio/AUDIO_REMIND_WAKE_UP.mp3 new file mode 100644 index 00000000..94d2c4d7 Binary files /dev/null and b/2.sdk/project/Z5_K7/gui/lv_watch/resource/audio/AUDIO_REMIND_WAKE_UP.mp3 differ diff --git a/2.sdk/project/Z5_K7/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h b/2.sdk/project/Z5_K7/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h index c3877053..1f56d3f4 100644 --- a/2.sdk/project/Z5_K7/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h +++ b/2.sdk/project/Z5_K7/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h @@ -186,6 +186,10 @@ #define __MMI_WEATHER_MENU_SUPPORT__ #endif +#define __MMI_CUSTOM_HENG_AI__ +#ifdef __MMI_CUSTOM_HENG_AI__ +#define __MMI_REMIND_WAKE_UP_SUPPORT__ +#endif #endif diff --git a/2.sdk/sdk/gui/lv_watch/CMakeLists.txt b/2.sdk/sdk/gui/lv_watch/CMakeLists.txt index b43bad3c..b345de78 100644 --- a/2.sdk/sdk/gui/lv_watch/CMakeLists.txt +++ b/2.sdk/sdk/gui/lv_watch/CMakeLists.txt @@ -219,6 +219,8 @@ set(lv_watch_sources lv_apps/health_measure/health_temperature.c lv_apps/setting/setting_main_menu_switch.c lv_apps/tool/tool.c + lv_apps/alarm_remind/alarm_remind.c + lv_apps/custom_function/custom_function.c ) set(lv_watch_font_sources diff --git a/2.sdk/sdk/gui/lv_watch/app_adaptor/app_adaptor_sensor_interface.c b/2.sdk/sdk/gui/lv_watch/app_adaptor/app_adaptor_sensor_interface.c index 881e753e..1a3cdc1f 100644 --- a/2.sdk/sdk/gui/lv_watch/app_adaptor/app_adaptor_sensor_interface.c +++ b/2.sdk/sdk/gui/lv_watch/app_adaptor/app_adaptor_sensor_interface.c @@ -30,7 +30,8 @@ // pedometer static nv_watch_pedometer_step_t s_pedometer_data = {0}; -uint32_t s_sensor_last_steps = 0; +static uint32_t s_sensor_last_steps = 0; +static uint8_t s_step_clear_flag = 0; uint8_t mmi_gsensor_sensor_id_get(void) { @@ -90,6 +91,23 @@ void asl_pedometer_steps_clear(void) hal_xmotion_steps_clear(); } +void mmi_pedometer_steps_mission(hal_rtc_t cur_time) +{ + if(0 == cur_time.tm_min && 0 == cur_time.tm_hour) + { + if(0 == s_step_clear_flag) + { + s_step_clear_flag = 1; + asl_pedometer_steps_clear(); + } + } + else + { + s_step_clear_flag = 0; + } + asl_pedometer_steps_save(false); +} + // heart sensor void mmi_hsensor_measure_value_clear(void) diff --git a/2.sdk/sdk/gui/lv_watch/app_adaptor/app_adaptor_sensor_interface.h b/2.sdk/sdk/gui/lv_watch/app_adaptor/app_adaptor_sensor_interface.h index 22b1b588..0e4ddcc7 100644 --- a/2.sdk/sdk/gui/lv_watch/app_adaptor/app_adaptor_sensor_interface.h +++ b/2.sdk/sdk/gui/lv_watch/app_adaptor/app_adaptor_sensor_interface.h @@ -74,6 +74,7 @@ void asl_pedometer_steps_update(uint32_t steps); uint32_t asl_pedometer_steps_get(void); #ifdef __MMI_ZHSX_SUPPORT__ void asl_pedometer_steps_save(bool to_nv); +void mmi_pedometer_steps_mission(hal_rtc_t cur_time); #else void asl_pedometer_steps_save(void); #endif diff --git a/2.sdk/sdk/gui/lv_watch/app_adaptor/app_adaptor_timing_control.c b/2.sdk/sdk/gui/lv_watch/app_adaptor/app_adaptor_timing_control.c index ddf8e92a..c3d2b12a 100644 --- a/2.sdk/sdk/gui/lv_watch/app_adaptor/app_adaptor_timing_control.c +++ b/2.sdk/sdk/gui/lv_watch/app_adaptor/app_adaptor_timing_control.c @@ -13,41 +13,42 @@ #ifdef __MMI_ZHSX_SUPPORT__ -static void * timing_control_timer = NULL; -static uint8_t s_step_clear_flag = 0; +static void * s_timing_control_timer = NULL; +static int8_t s_timing_control_last_min = -1; +#define TIMING_FIRST_TIMER_INTERVAL (3 * 1000) // ms #define TIMING_TIMER_INTERVAL (20 * 1000) // ms static void timing_timer_callback(uint32_t param) { - hal_rtc_t time; - Hal_Rtc_Gettime(&time); - printf("[@CHENG_DEBUG][%s][%d]: %d,%d,%d\n", __FUNCTION__, __LINE__, time.tm_hour, time.tm_min, time.tm_sec); + hal_rtc_t cur_time = {0}; + Hal_Rtc_Gettime(&cur_time); + printf("[@CHENG_DEBUG][%s][%d]: %d,%d,%d\n", __FUNCTION__, __LINE__, cur_time.tm_hour, cur_time.tm_min, cur_time.tm_sec); + + uos_timer_stop(s_timing_control_timer); + uos_timer_start(s_timing_control_timer, MS_TO_TICKS(TIMING_TIMER_INTERVAL), 0, timing_timer_callback, NULL); // pedometer - if(0 == time.tm_min && 0 == time.tm_hour) - { - if(0 == s_step_clear_flag) - { - s_step_clear_flag = 1; - asl_pedometer_steps_clear(); - } - } - else + mmi_pedometer_steps_mission(cur_time); + + // every minuter check mission + if(cur_time.tm_min != s_timing_control_last_min) { - s_step_clear_flag = 0; - } - asl_pedometer_steps_save(false); + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + + s_timing_control_last_min = cur_time.tm_min; + + // check remind + mmi_remind_mission(cur_time); + - uos_timer_stop(timing_control_timer); - uos_timer_start(timing_control_timer, MS_TO_TICKS(TIMING_TIMER_INTERVAL), 0, timing_timer_callback, NULL); + } } void app_adaptor_timing_control_init(void) { - uos_timer_create(&timing_control_timer); - uos_timer_start(timing_control_timer, MS_TO_TICKS(TIMING_TIMER_INTERVAL), 0, timing_timer_callback, NULL); - + uos_timer_create(&s_timing_control_timer); + uos_timer_start(s_timing_control_timer, MS_TO_TICKS(TIMING_FIRST_TIMER_INTERVAL), 0, timing_timer_callback, NULL); } #else diff --git a/2.sdk/sdk/gui/lv_watch/framework/message/mmi_msg_zhsx.c b/2.sdk/sdk/gui/lv_watch/framework/message/mmi_msg_zhsx.c index eb96dea7..d4ac76d9 100644 --- a/2.sdk/sdk/gui/lv_watch/framework/message/mmi_msg_zhsx.c +++ b/2.sdk/sdk/gui/lv_watch/framework/message/mmi_msg_zhsx.c @@ -120,6 +120,17 @@ void mmi_ui_msg_action_pedometer_update(void) } #endif +void mmi_ui_msg_action_remind(void) +{ + mmi_ui_msg_action_no_para_msg(MMI_MSG_REMIND); +} + +#ifdef __MMI_CUSTOM_HENG_AI__ +void mmi_ui_msg_action_heng_ai_wake_now(void) +{ + mmi_ui_msg_action_no_para_msg(MMI_MSG_HENG_AI_WAKE_NOW); +} +#endif diff --git a/2.sdk/sdk/gui/lv_watch/framework/message/mmi_msg_zhsx.h b/2.sdk/sdk/gui/lv_watch/framework/message/mmi_msg_zhsx.h index 4ee82d36..03133846 100644 --- a/2.sdk/sdk/gui/lv_watch/framework/message/mmi_msg_zhsx.h +++ b/2.sdk/sdk/gui/lv_watch/framework/message/mmi_msg_zhsx.h @@ -75,6 +75,10 @@ void mmi_ui_msg_action_do_not_disturb(uint8_t flag); #if USE_LV_WATCH_PEDOMETER != 0 void mmi_ui_msg_action_pedometer_update(void); #endif +void mmi_ui_msg_action_remind(void); +#ifdef __MMI_CUSTOM_HENG_AI__ +void mmi_ui_msg_action_heng_ai_wake_now(void); +#endif diff --git a/2.sdk/sdk/gui/lv_watch/framework/message/watch_msg_handle.c b/2.sdk/sdk/gui/lv_watch/framework/message/watch_msg_handle.c index 88e40539..aaddeba8 100644 --- a/2.sdk/sdk/gui/lv_watch/framework/message/watch_msg_handle.c +++ b/2.sdk/sdk/gui/lv_watch/framework/message/watch_msg_handle.c @@ -426,6 +426,17 @@ void watch_ui_message_handle(uint16_t msgid, void * msg) break; #endif + case MMI_MSG_REMIND: + mmi_ui_msg_update_remind(); + break; + + #ifdef __MMI_CUSTOM_HENG_AI__ + case MMI_MSG_HENG_AI_WAKE_NOW: + mmi_ui_msg_update_heng_ai_wake_now(); + break; + #endif + + #endif diff --git a/2.sdk/sdk/gui/lv_watch/framework/message/watch_msg_handle.h b/2.sdk/sdk/gui/lv_watch/framework/message/watch_msg_handle.h index 8ceb78a3..cb425775 100644 --- a/2.sdk/sdk/gui/lv_watch/framework/message/watch_msg_handle.h +++ b/2.sdk/sdk/gui/lv_watch/framework/message/watch_msg_handle.h @@ -121,6 +121,10 @@ enum #if USE_LV_WATCH_PEDOMETER != 0 MMI_MSG_PEDOMETER_UPDATE, #endif + MMI_MSG_REMIND, +#ifdef __MMI_CUSTOM_HENG_AI__ + MMI_MSG_HENG_AI_WAKE_NOW, +#endif #endif diff --git a/2.sdk/sdk/gui/lv_watch/include/ui_activity_id.h b/2.sdk/sdk/gui/lv_watch/include/ui_activity_id.h index 872cef08..491571a6 100644 --- a/2.sdk/sdk/gui/lv_watch/include/ui_activity_id.h +++ b/2.sdk/sdk/gui/lv_watch/include/ui_activity_id.h @@ -207,6 +207,7 @@ enum #ifdef __MMI_WEATHER_MENU_SUPPORT__ ACT_ID_WEATHER_MENU, #endif + ACT_ID_REMIND, ACT_ID_MAX, diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/alarm_remind/alarm_remind.c b/2.sdk/sdk/gui/lv_watch/lv_apps/alarm_remind/alarm_remind.c new file mode 100644 index 00000000..a2ada7e0 --- /dev/null +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/alarm_remind/alarm_remind.c @@ -0,0 +1,376 @@ + + + +#include +#include "lv_watch.h" + +#ifdef __MMI_ZHSX_SUPPORT__ + +static mmi_remind_type_e s_remind_type = MMI_REMIND_TYPE_MAX; +static uint32_t s_remind_txt_id = 0; +static char * s_remind_ring_path = NULL; +static mmi_remind_screen_info_t s_remind_info[] = +{ + { MMI_REMIND_TYPE_WAKE_UP, WATCH_TEXT_ID_WAKE_UP_PROMPT, AUDIO_REMIND_WAKE_UP}, + { MMI_REMIND_TYPE_SLEEP, 0, NULL}, + + { MMI_REMIND_TYPE_MAX, 0, NULL}, +}; + + + +#ifdef __MMI_REMIND_WAKE_UP_SUPPORT__ +static nv_watch_remind_wake_up_t s_rimind_wake_up_data = {0}; + +void mmi_remind_wake_up_nv_write(void) +{ + uint32_t nv_data_length = sizeof(nv_watch_remind_wake_up_t); + + if(nv_data_length != UI_NV_Write_Req(NV_SECTION_UI_REMIND_WAKE_UP_DATA, 0, nv_data_length, (uint8_t *)&s_rimind_wake_up_data)) + { + printf("[@CHENG_DEBUG][%s][%d]: nv write fail\n", __FUNCTION__, __LINE__); + } +} + +void mmi_remind_wake_up_nv_read(void) +{ + uint32_t nv_data_length = sizeof(nv_watch_remind_wake_up_t); + + if(nv_data_length != UI_NV_Read_Req(NV_SECTION_UI_REMIND_WAKE_UP_DATA, 0, nv_data_length, (uint8_t *)&s_rimind_wake_up_data)) + { + printf("[@CHENG_DEBUG][%s][%d]: nv read fail\n", __FUNCTION__, __LINE__); + _lv_memset_00(&s_rimind_wake_up_data, sizeof(nv_watch_remind_wake_up_t)); + } +} + +void mmi_remind_wake_up_data_set(nv_watch_remind_wake_up_t * data) +{ + if(NULL != data) + { + _lv_memset_00(&s_rimind_wake_up_data, sizeof(nv_watch_remind_wake_up_t)); + _lv_memcpy(&s_rimind_wake_up_data, data, sizeof(nv_watch_remind_wake_up_t)); + mmi_remind_wake_up_nv_write(); + } +} + +bool mmi_remind_wake_up_is_trigger(hal_rtc_t cur_time) +{ + uint8_t i = 0; + for(i = 0; i < NV_REMIND_WAKE_UP_MAX_NUM; i++) + { + if(s_rimind_wake_up_data.remind_info[i].valid && s_rimind_wake_up_data.remind_info[i].on_off) + { + if(cur_time.tm_hour == s_rimind_wake_up_data.remind_info[i].hour + && cur_time.tm_min == s_rimind_wake_up_data.remind_info[i].min + ) + { + if(0 == (s_rimind_wake_up_data.remind_info[i].repeat_bitmap & 0x80)) // once + { + s_rimind_wake_up_data.remind_info[i].on_off = 0; + mmi_remind_wake_up_nv_write(); + + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + return true; + } + else // repeat + { + if((0x01 << (cur_time.tm_wday)) & s_rimind_wake_up_data.remind_info[i].repeat_bitmap) + { + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + return true; + } + } + } + } + } + + return false; +} + +void mmi_remind_wake_up_screen_active(void) +{ + s_remind_type = MMI_REMIND_TYPE_WAKE_UP; + mmi_remind_screen_active(); +} +#endif + +#ifdef __MMI_REMIND_SLEEP_SUPPORT__ +static nv_watch_remind_sleep_t s_rimind_sleep_data = {0}; + +void mmi_remind_sleep_nv_write(void) +{ + +} + +void mmi_remind_sleep_nv_read(void) +{ + +} + +void mmi_remind_sleep_data_set(nv_watch_remind_sleep_t * data) +{ + if(NULL != data) + { + _lv_memset_00(&s_rimind_sleep_data, sizeof(nv_watch_remind_sleep_t)); + _lv_memcpy(&s_rimind_sleep_data, data, sizeof(nv_watch_remind_sleep_t)); + mmi_remind_sleep_nv_write(); + } +} + +bool mmi_remind_sleep_is_trigger(hal_rtc_t cur_time) +{ + + + return false; +} + +void mmi_remind_sleep_screen_active(void) +{ + s_remind_type = MMI_REMIND_TYPE_SLEEP; + mmi_remind_screen_active(); +} +#endif + + +bool mmi_remind_screen_is_active(void) +{ + lv_obj_t * activity_obj = lv_watch_get_activity_obj(ACT_ID_REMIND); + if(NULL != activity_obj) + return true; + + return false; +} + +static lv_remind_obj_ext_t * mmi_remind_screen_ext_get(void) +{ + lv_obj_t * activity_obj = lv_watch_get_activity_obj(ACT_ID_REMIND); + if(NULL == activity_obj) + return NULL; + + lv_obj_t * watch_obj = NULL; + lv_watch_get_child_obj(activity_obj, lv_watch_obj_signal, &watch_obj); + if(NULL != watch_obj) + { + void * ext = lv_obj_get_ext_attr(watch_obj); + return ext; + } + + return NULL; +} + +static void mmi_remind_screen_prepare_destory(lv_obj_t * activity_obj) +{ + lv_watch_png_cache_all_free(); + + Hal_Vibrator_Play_End(); + + Hal_Tone_Play_End(); + Hal_Audio_Manage_End_Ind(AUDIO_CTRL_PRIORITY_REMIND); + + lv_remind_obj_ext_t * ext = mmi_remind_screen_ext_get(); + if(ext) + { + if(NULL != ext->timer_id) + { + Hal_Timer_Stop(ext->timer_id); + ext->timer_id = NULL; + } + } + + watch_set_suspend_enable(true, ACT_ID_REMIND, 0); +} + +void mmi_remind_screen_clean(void) +{ + lv_obj_t * activity_obj = lv_watch_get_activity_obj(ACT_ID_REMIND); + if(NULL != activity_obj) + { + mmi_remind_screen_prepare_destory(activity_obj); + lv_obj_del(activity_obj); + } +} + +void mmi_remind_btn_event_cb(lv_obj_t * obj, lv_event_t e) +{ + if(LV_EVENT_CLICKED == e) + { + mmi_remind_screen_clean(); + + #ifdef __MMI_CUSTOM_HENG_AI__ + mmi_heng_ai_camera_open(); + #endif + } +} + +static void mmi_remind_screen_timeout(void * para) +{ + mmi_remind_screen_clean(); +} + +static lv_obj_t * mmi_remind_screen_create(lv_obj_t * activity_obj) +{ + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + if(NULL == activity_obj) + { + lv_watch_activity_ext_t activity_ext; + memset(&activity_ext, 0, sizeof(lv_watch_activity_ext_t)); + activity_ext.actId = ACT_ID_REMIND; + activity_ext.create = mmi_remind_screen_create; + activity_ext.prepare_destory = mmi_remind_screen_prepare_destory; + activity_obj = lv_watch_creat_activity_obj(&activity_ext); + if(NULL == activity_obj) + return NULL; + } + + /* watch obj */ + lv_obj_t * obj = lv_watch_obj_create(activity_obj); + lv_watch_obj_set_anim_mode(obj, LV_WATCH_ANIM_NO); + lv_remind_obj_ext_t * ext = (lv_remind_obj_ext_t *)lv_obj_allocate_ext_attr(obj, sizeof(lv_remind_obj_ext_t)); + + lv_obj_t * cont = lv_cont_create(obj, NULL); + lv_obj_set_size(cont, LV_HOR_RES, LV_VER_RES); + lv_obj_set_style_local_bg_color(cont, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); + //lv_obj_set_style_local_bg_color(cont, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); + lv_obj_set_click(cont, false); + + hal_rtc_t cur_time; + char time_str[8] = {0}; + + Hal_Rtc_Gettime(&cur_time); + sprintf(time_str, "%02d:%02d", cur_time.tm_hour, cur_time.tm_min); + + lv_obj_t * label_time = lv_label_create(cont, NULL); + lv_obj_add_style(label_time, LV_LABEL_PART_MAIN, &lv_watch_font26); + lv_label_set_text(label_time, time_str); + lv_label_set_align(label_time, LV_LABEL_ALIGN_CENTER); + lv_obj_align(label_time, NULL, LV_ALIGN_IN_TOP_MID, 0, 50); + + lv_obj_t * label_prompt = lv_label_create(cont, label_time); + lv_label_set_text_id(label_prompt, s_remind_txt_id); + lv_obj_align(label_prompt, label_time, LV_ALIGN_OUT_BOTTOM_MID, 0, 10); + + lv_obj_t * btn = lv_btn_create(cont, NULL); + lv_obj_set_size(btn, 100, 56); + lv_obj_set_style_local_bg_color(btn, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(0x47, 0xA6, 0xFF)); + lv_obj_set_style_local_radius(btn, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 30); + lv_obj_set_style_local_bg_color(btn, LV_BTN_PART_MAIN, LV_STATE_PRESSED, lv_color_make(0x47, 0xA6, 0xFF)); + lv_obj_set_style_local_radius(btn, LV_BTN_PART_MAIN, LV_STATE_PRESSED, 30); + lv_obj_align(btn, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, -20); + lv_obj_set_event_cb(btn, mmi_remind_btn_event_cb); + + lv_obj_t * label = lv_label_create(btn, NULL); + lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font26); + lv_label_set_text_id(label, WATCH_TEXT_ID_OK); + + /* start timer (1 min) */ + ext->timer_id = Hal_Timer_Start(1000 * 60, mmi_remind_screen_timeout, NULL, false); + + watch_set_suspend_enable(false, ACT_ID_REMIND, 0); + + return obj; +} + +void mmi_remind_audio_ctrl_callback(AUDIO_CTRL_PRIORITY priority) +{ + printf("[@CHENG_DEBUG][%s][%d]: priority=%d\n", __FUNCTION__, __LINE__, priority); + + if(AUDIO_CTRL_PRIORITY_REMIND == priority) + { + // + } + else if(AUDIO_CTRL_PRIORITY_REMIND > priority) + { + mmi_remind_screen_clean(); + } +} + +void mmi_ui_msg_update_remind(void) +{ + if(AUDIO_CTRL_PRIORITY_REMIND == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_REMIND, mmi_remind_audio_ctrl_callback)) + { + #ifdef __MMI_CUSTOM_HENG_AI__ + if(0 == mmi_heng_ai_wake_ring_type_get()) + Hal_NFFS_File_Play_Repeat(s_remind_ring_path, query_current_volume()); + else + Hal_Vibrator_Play_Repeat(); + #else + Hal_NFFS_File_Play_Repeat(s_remind_ring_path, query_current_volume()); + Hal_Vibrator_Play_Repeat(); + #endif + + mmi_remind_screen_create(NULL); + } +} + +void mmi_remind_screen_active(void) +{ + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + + if(true == mmi_active_screen_is_prohibit_interrupted() + #ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__ + || true == mmi_watch_is_in_do_not_disturb_time() + #endif + ) + { + return; + } + + if(true == mmi_remind_screen_is_active()) + { + return; + } + + uint8_t i = 0; + while(1) + { + if(s_remind_info[i].remind_type == MMI_REMIND_TYPE_MAX) + break; + + if(s_remind_info[i].remind_type == s_remind_type) + { + s_remind_txt_id = s_remind_info[i].remind_txt_id; + s_remind_ring_path = s_remind_info[i].remind_ring_path; + break; + } + + i++; + }; + + mmi_watch_wake_up(); + mmi_ui_msg_action_remind(); +} + +void mmi_remind_mission(hal_rtc_t cur_time) +{ + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); +#ifdef __MMI_REMIND_WAKE_UP_SUPPORT__ + if(mmi_remind_wake_up_is_trigger(cur_time)) + { + mmi_remind_wake_up_screen_active(); + return ; + } +#endif +#ifdef __MMI_REMIND_SLEEP_SUPPORT__ + if(mmi_remind_sleep_is_trigger(cur_time)) + { + mmi_remind_sleep_screen_active(); + return ; + } +#endif + + +} + +void mmi_remind_data_init(void) +{ +#ifdef __MMI_REMIND_WAKE_UP_SUPPORT__ + mmi_remind_wake_up_nv_read(); +#endif +#ifdef __MMI_REMIND_SLEEP_SUPPORT__ + mmi_remind_sleep_nv_read(); +#endif + + +} +#endif + diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/alarm_remind/alarm_remind.h b/2.sdk/sdk/gui/lv_watch/lv_apps/alarm_remind/alarm_remind.h new file mode 100644 index 00000000..2dd0877d --- /dev/null +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/alarm_remind/alarm_remind.h @@ -0,0 +1,73 @@ + + + +#ifndef __ALARM_REMIND_H__ +#define __ALARM_REMIND_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ + +#ifdef LV_CONF_INCLUDE_SIMPLE +#include "lvgl.h" +#include "lv_watch_conf.h" +#else +#include "../../../lvgl/lvgl.h" +#include "../../../lv_watch_conf.h" +#endif + + +#ifdef __MMI_ZHSX_SUPPORT__ + +typedef enum +{ + MMI_REMIND_TYPE_WAKE_UP, + MMI_REMIND_TYPE_SLEEP, + + MMI_REMIND_TYPE_MAX +}mmi_remind_type_e; + +typedef struct +{ + mmi_remind_type_e remind_type; + uint32_t remind_txt_id; + char * remind_ring_path; +}mmi_remind_screen_info_t; + +typedef struct +{ + lv_watch_obj_ext_t lv_watch_obj; + /*New data for this type */ + TIMER_ID timer_id; +} lv_remind_obj_ext_t; + + + +#ifdef __MMI_REMIND_WAKE_UP_SUPPORT__ +void mmi_remind_wake_up_data_set(nv_watch_remind_wake_up_t * data); +void mmi_remind_wake_up_screen_active(void); +#endif +#ifdef __MMI_REMIND_SLEEP_SUPPORT__ +void mmi_remind_sleep_data_set(nv_watch_remind_sleep_t * data); +void mmi_remind_sleep_screen_active(void); +#endif + +bool mmi_remind_screen_is_active(void); +void mmi_ui_msg_update_remind(void); +void mmi_remind_screen_active(void); +void mmi_remind_mission(hal_rtc_t cur_time); +void mmi_remind_data_init(void); + + +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif + diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/custom_function.c b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/custom_function.c new file mode 100644 index 00000000..a306c07d --- /dev/null +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/custom_function.c @@ -0,0 +1,16 @@ + + + +#include "lv_watch.h" + +#ifdef __MMI_ZHSX_SUPPORT__ + +#ifdef __MMI_CUSTOM_HENG_AI__ +#include "heng_ai.c" +#endif + + + + +#endif + diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/custom_function.h b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/custom_function.h new file mode 100644 index 00000000..c97a84b0 --- /dev/null +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/custom_function.h @@ -0,0 +1,36 @@ + + + +#ifndef __CUSTOM_FUNCTION_H__ +#define __CUSTOM_FUNCTION_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef LV_CONF_INCLUDE_SIMPLE +#include "lvgl.h" +#include "lv_ex_conf.h" +#else +#include "../../../lvgl/lvgl.h" +#include "../../../lv_ex_conf.h" +#endif + + +#ifdef __MMI_ZHSX_SUPPORT__ + +#ifdef __MMI_CUSTOM_HENG_AI__ +#include "heng_ai.h" +#endif + + + +#endif + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif + diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai.c b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai.c new file mode 100644 index 00000000..18cdd1c9 --- /dev/null +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai.c @@ -0,0 +1,501 @@ + + + +#include "lv_watch.h" + +#ifdef __MMI_CUSTOM_HENG_AI__ + +#if USE_LV_WATCH_CAMERA != 0 + +#include +#include +#include "lv_drv_conf.h" +#include "lvgl/hal/hal.h" +#include "lv_drivers/camera/camera_api.h" +#include "lv_drivers/camera/camera_hal_core.h" + + + +static lv_img_dsc_t img_camera; +//static lv_img_dsc_t img_capture; +static lv_task_t * preview_task = NULL; + +static char s_heng_ai_photo_path[32] = {0}; + + +static lv_obj_t * mmi_heng_ai_camera_obj_get(void) +{ + lv_obj_t * activity_obj = lv_watch_get_activity_obj(ACT_ID_CAMERA); + if(NULL == activity_obj) + return NULL; + + lv_obj_t * watch_obj = NULL; + lv_watch_get_child_obj(activity_obj, lv_watch_obj_signal, &watch_obj); + + return watch_obj; +} + +static lv_heng_ai_camera_obj_ext_t * mmi_heng_ai_camera_ext_get(void) +{ + lv_obj_t * watch_obj = mmi_heng_ai_camera_obj_get(); + if(NULL != watch_obj) + { + void * ext = lv_obj_get_ext_attr(watch_obj); + return ext; + } + + return NULL; +} + +static void mmi_heng_ai_camera_destroy_task(lv_task_t * task) +{ + Hal_Camera_Stop_Preview(0); +} + +static void mmi_heng_ai_camera_prepare_destory(lv_obj_t * activity_obj) +{ + lv_heng_ai_camera_obj_ext_t * ext = mmi_heng_ai_camera_ext_get(); + if(ext->timer) { + Hal_Timer_Stop(ext->timer); + ext->timer = NULL; + } + lv_task_t * des_task = lv_task_create(mmi_heng_ai_camera_destroy_task, 20, LV_TASK_PRIO_HIGH, NULL); + lv_task_once(des_task); + lv_watch_png_cache_all_free(); + lv_mem_free(img_camera.data); + img_camera.data = NULL; + if(preview_task) + { + lv_task_del(preview_task); + preview_task = NULL; + } + + if(strlen(s_heng_ai_photo_path)) + { + lv_fs_remove(s_heng_ai_photo_path); + _lv_memset_00(s_heng_ai_photo_path, sizeof(s_heng_ai_photo_path)); + } + + watch_set_suspend_enable(true, ACT_ID_CAMERA, 0); +} + +static void mmi_heng_ai_camera_preview_task(lv_task_t * task) +{ + lv_obj_t * cam_obj = lv_watch_get_activity_obj(ACT_ID_CAMERA); + lv_obj_t * top_obj = lv_watch_get_top_activity_obj(); + if(top_obj != cam_obj) + { + if(Hal_Camera_Get_On_Flag()) + { + Hal_Camera_Stop_Preview(0); + } + } + else + { + if(!Hal_Camera_Get_On_Flag()) + { + cam_start_preview_t cam_params; + cam_params.width = 240; + cam_params.height = 240; + cam_params.sensor_id = 0; + Hal_Camera_Start_Preview(&cam_params); + } + lv_img_cache_invalidate_src(&img_camera); + if(Hal_Camera_Preview((uint8_t *)img_camera.data)) + { + lv_heng_ai_camera_obj_ext_t * ext = mmi_heng_ai_camera_ext_get(); + //update the src of img. + lv_img_set_src(ext->img, &img_camera); + } + lv_task_set_period(preview_task, 30); + } +} + +void mmi_heng_ai_camera_send_cancel_btn_event_cb(lv_obj_t * btn, lv_event_t e) +{ + if(LV_EVENT_CLICKED == e) + { + if(strlen(s_heng_ai_photo_path)) + { + lv_fs_remove(s_heng_ai_photo_path); + _lv_memset_00(s_heng_ai_photo_path, sizeof(s_heng_ai_photo_path)); + } + + if(lv_watch_get_activity_obj(ACT_ID_CAMERA) == NULL) + return; + + lv_obj_del(lv_obj_get_parent(btn)); + lv_task_set_prio(preview_task, LV_TASK_PRIO_HIGH); + lv_camera_obj_ext_t * ext = mmi_heng_ai_camera_ext_get(); + ext->timer = NULL; + + } +} + +void mmi_heng_ai_camera_send_ok_btn_event_cb(lv_obj_t * btn, lv_event_t e) +{ + if(LV_EVENT_CLICKED == e) + { + if(strlen(s_heng_ai_photo_path)) + { + lv_fs_file_t file_p; + lv_fs_res_t res; + uint32_t file_size = 0, bytes_read = 0; + char * file_buf = NULL; + + res = lv_fs_open(&file_p, s_heng_ai_photo_path, LV_FS_MODE_RD); + if(LV_FS_RES_OK != res) + { + printf("[@CHENG_DEBUG][%s][%d]: errno=%d\n", __FUNCTION__, __LINE__, res); + lv_fs_close(&file_p); + return; + } + + lv_fs_size(&file_p, &file_size); + file_buf = (char *)lv_mem_alloc(file_size + 1); + _lv_memset_00(file_buf, file_size + 1); + res = lv_fs_read(&file_p, file_buf, file_size, &bytes_read); + lv_fs_close(&file_p); + if(LV_FS_RES_OK != res) + { + printf("[@CHENG_DEBUG][%s][%d]: errno=%d\n", __FUNCTION__, __LINE__, res); + lv_mem_free(file_buf); + return; + } + printf("[@CHENG_DEBUG][%s][%d]: file_size=%d,bytes_read=%d\n", __FUNCTION__, __LINE__, file_size, bytes_read); + mmi_protocol_action_send_photo(0, NULL, file_buf, file_size); + lv_mem_free(file_buf); + + lv_fs_remove(s_heng_ai_photo_path); + _lv_memset_00(s_heng_ai_photo_path, sizeof(s_heng_ai_photo_path)); + } + + mmi_heng_ai_camera_prepare_destory(NULL); + lv_obj_t * activity_obj = lv_watch_get_activity_obj(ACT_ID_CAMERA); + if(NULL != activity_obj) + { + lv_obj_del(activity_obj); + } + } +} + +static void mmi_heng_ai_camera_send_create(void) +{ + lv_obj_t * obj = mmi_heng_ai_camera_obj_get(); + lv_obj_t * cont_bg = lv_cont_create(obj, NULL); + lv_obj_set_size(cont_bg, LV_HOR_RES, LV_VER_RES); + lv_obj_set_style_local_bg_color(cont_bg, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); + + lv_obj_t * label = lv_label_create(cont_bg, NULL); + lv_label_set_text_id(label, WATCH_TEXT_ID_UPLOAD_PHOTO_Q); + lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font26); // &lv_watch_font30); + lv_label_set_align(label, LV_LABEL_ALIGN_CENTER); + lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, -30); + + lv_obj_t * btn_cancel = lv_btn_create(cont_bg, NULL); + lv_obj_set_size(btn_cancel, 100, 56); + lv_obj_set_style_local_bg_color(btn_cancel, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x47, 0xA6, 0xFF)); + lv_obj_set_style_local_radius(btn_cancel, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 30); + lv_obj_set_style_local_bg_color(btn_cancel, LV_BTN_PART_MAIN, LV_STATE_PRESSED, LV_COLOR_MAKE(0x47, 0xA6, 0xFF)); + lv_obj_set_style_local_radius(btn_cancel, LV_BTN_PART_MAIN, LV_STATE_PRESSED, 30); + lv_obj_align(btn_cancel, NULL, LV_ALIGN_IN_BOTTOM_LEFT, 10, -20); + lv_obj_set_event_cb(btn_cancel, mmi_heng_ai_camera_send_cancel_btn_event_cb); + lv_obj_t * label_cancel = lv_label_create(btn_cancel, NULL); + lv_label_set_text_id(label_cancel, WATCH_TEXT_ID_RECAPTURE); + lv_obj_add_style(label_cancel, LV_LABEL_PART_MAIN, &lv_watch_font26_black); // &lv_watch_font30); + + lv_obj_t * btn_ok = lv_btn_create(cont_bg, btn_cancel); + lv_obj_set_style_local_bg_color(btn_ok, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xFF, 0x6F, 0x91)); + lv_obj_set_style_local_radius(btn_ok, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 30); + lv_obj_set_style_local_bg_color(btn_ok, LV_BTN_PART_MAIN, LV_STATE_PRESSED, LV_COLOR_MAKE(0xFF, 0x6F, 0x91)); + lv_obj_set_style_local_radius(btn_ok, LV_BTN_PART_MAIN, LV_STATE_PRESSED, 30); + lv_obj_align(btn_ok, NULL, LV_ALIGN_IN_BOTTOM_RIGHT, -10, -20); + lv_obj_set_event_cb(btn_ok, mmi_heng_ai_camera_send_ok_btn_event_cb); + lv_obj_t * label_ok = lv_label_create(btn_ok, label_cancel); + lv_label_set_text_id(label_ok, WATCH_TEXT_ID_OK); +} + +static void mmi_heng_ai_camera_outmem_btn_event_cb(lv_obj_t * btn, lv_event_t e) +{ + (void)btn; + if(LV_EVENT_CLICKED == e) + { + lv_obj_del(lv_obj_get_parent(btn)); + lv_task_set_prio(preview_task, LV_TASK_PRIO_HIGH); + } +} +static void mmi_heng_ai_camera_out_of_memory_create(lv_obj_t * obj) +{ + lv_obj_t * cont_bg = lv_cont_create(obj, NULL); + lv_obj_set_size(cont_bg, LV_HOR_RES, LV_VER_RES); + lv_obj_add_style(cont_bg, LV_CONT_PART_MAIN, &lv_watch_black_tight); + + lv_obj_t * label = lv_label_create(cont_bg, NULL); + lv_label_set_text_id(label, WATCH_TEXT_ID_OUT_OF_MEM); + lv_label_set_long_mode(label, LV_LABEL_LONG_BREAK); + lv_obj_set_width(label, LV_HOR_RES - 50); + lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font26); + lv_label_set_align(label, LV_LABEL_ALIGN_CENTER); + lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_MID, 0, 20); + + lv_obj_t * btn = lv_btn_create(cont_bg, NULL); + lv_obj_set_style_local_bg_color(btn, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x47, 0xA6, 0xFF)); + lv_obj_set_style_local_radius(btn, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 30); + lv_obj_set_style_local_bg_color(btn, LV_BTN_PART_MAIN, LV_STATE_PRESSED, LV_COLOR_MAKE(0x47, 0xA6, 0xFF)); + lv_obj_set_style_local_radius(btn, LV_BTN_PART_MAIN, LV_STATE_PRESSED, 30); + lv_obj_set_size(btn, 100, 56); + lv_obj_set_event_cb(btn, mmi_heng_ai_camera_outmem_btn_event_cb); + lv_obj_align(btn, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, -20); + lv_obj_t * btn_label = lv_label_create(btn, NULL); + lv_label_set_text_id(btn_label, WATCH_TEXT_ID_OK); + lv_obj_add_style(btn_label,LV_LABEL_PART_MAIN, &lv_watch_font26); // &lv_watch_font30); +} + + +static void camera_save_failed_timer_cb(void * param) +{ + if(lv_watch_get_activity_obj(ACT_ID_CAMERA) == NULL) + return; + + lv_obj_t * obj = mmi_heng_ai_camera_obj_get(); + lv_obj_del((lv_obj_t *)param); + lv_task_set_prio(preview_task, LV_TASK_PRIO_HIGH); + lv_camera_obj_ext_t * ext = lv_obj_get_ext_attr(obj); + ext->timer = NULL; +} + +static void mmi_heng_ai_camera_save_failed_create(int32_t error) +{ + lv_obj_t * obj = mmi_heng_ai_camera_obj_get(); + lv_obj_t * cont_bg = lv_cont_create(obj, NULL); + lv_obj_set_size(cont_bg, LV_HOR_RES, LV_VER_RES); + lv_obj_add_style(cont_bg, LV_CONT_PART_MAIN, &lv_watch_black_tight); + + lv_obj_t * label = lv_label_create(cont_bg, NULL); + lv_label_set_text_id(label, WATCH_TEXT_ID_SAVE_FAILED); + lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font26); // &lv_watch_font30); + lv_label_set_align(label, LV_LABEL_ALIGN_CENTER); + lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_MID, 0, 20); + + lv_obj_t * r_label = lv_label_create(cont_bg, label); + if(error == CRANE_CAMERA_ERROR_OUTOFMEMORY) + lv_label_set_text_id(r_label, WATCH_TEXT_ID_OUT_OF_MEM); + else if(error == CRANE_CAMERA_ERROR_BADARGUMENT) + lv_label_set_text_id(r_label, WATCH_TEXT_ID_FILE_ERROR); + else if(error == CRANE_CAMERA_ERROR_INVALIDOPERATION) + lv_label_set_text_id(r_label, WATCH_TEXT_ID_OPERATION_ERROR); + else + lv_label_set_text_id(r_label, WATCH_TEXT_ID_UNKONWN); + lv_obj_align(r_label, label, LV_ALIGN_OUT_BOTTOM_MID, 0, 10); + + lv_heng_ai_camera_obj_ext_t * ext = mmi_heng_ai_camera_ext_get(); + ext->timer = Hal_Timer_Start(1000, camera_save_failed_timer_cb, cont_bg, false); +} + +static void mmi_heng_ai_camera_shoot_btn_event_cb(lv_obj_t * btn, lv_event_t e) +{ + (void)btn; + if(LV_EVENT_CLICKED == e) + { + lv_heng_ai_camera_obj_ext_t * ext = mmi_heng_ai_camera_ext_get(); + uint32_t fs_total = 0; + uint32_t fs_free = 0; + lv_fs_free_space('C', &fs_total, &fs_free); + printf("%s: space total = %dB, free = %dB!!\n", __FUNCTION__, fs_total, fs_free); + if(fs_free < 100 * 1024) + { + lv_obj_t * obj = mmi_heng_ai_camera_obj_get(); + mmi_heng_ai_camera_out_of_memory_create(obj); + return; + } + + cam_capture_t cap_param; + int32_t error = CRANE_CAMERA_ERROR_NONE; + cap_param.width = 240; // LV_HOR_RES + cap_param.height = 240; // LV_VER_RES + + Hal_Rtc_Gettime(&(ext->time)); + sprintf(s_heng_ai_photo_path, "C:/hengai_%02d%02d%02d.jpg", ext->time.tm_hour, ext->time.tm_min, ext->time.tm_sec); + + lv_fs_file_t file; + lv_fs_res_t res = lv_fs_open(&file, s_heng_ai_photo_path, LV_FS_MODE_WR); + if(res == LV_FS_RES_OK) + { + lv_task_set_prio(preview_task, LV_TASK_PRIO_OFF); + lv_obj_set_hidden(ext->cont, false); + lv_refr_now(NULL); + + int32_t * fd = (int32_t*)file.file_d; + error = Hal_Camera_Capture(&cap_param, *fd); + lv_fs_close(&file); + if (error == CRANE_CAMERA_ERROR_NONE) + { + mmi_heng_ai_camera_send_create(); + } + else + { + mmi_heng_ai_camera_save_failed_create(error); + } + lv_obj_set_hidden(ext->cont, true); + lv_refr_now(NULL); + } + else + { + + } + } +} + +static void mmi_heng_ai_camera_create_shoot(lv_obj_t * obj) +{ + lv_heng_ai_camera_obj_ext_t * ext = mmi_heng_ai_camera_ext_get(); + + //update the src of img. + lv_img_set_src(ext->img, &img_camera); + + lv_obj_t * btn; + btn = lv_imgbtn_create(obj, NULL); + lv_imgbtn_set_src(btn, LV_BTN_STATE_RELEASED, ICON_CAMERA_SHOOT); + lv_imgbtn_set_src(btn, LV_BTN_STATE_PRESSED, ICON_CAMERA_SHOOT); + //lv_btn_set_toggle(btn, false); + lv_obj_set_event_cb(btn, mmi_heng_ai_camera_shoot_btn_event_cb); + lv_watch_obj_add_element(btn); + lv_obj_align(btn, obj, LV_ALIGN_IN_BOTTOM_MID, 0, -20); +} + +static lv_obj_t * mmi_heng_ai_camera_create(lv_obj_t * activity_obj) +{ + if(activity_obj == NULL) + { + lv_watch_activity_ext_t activity_ext; + _lv_memset_00(&activity_ext, sizeof(lv_watch_activity_ext_t)); + activity_ext.actId = ACT_ID_CAMERA; + activity_ext.create = mmi_heng_ai_camera_create; + activity_ext.prepare_destory = mmi_heng_ai_camera_prepare_destory; + activity_obj = lv_watch_creat_activity_obj(&activity_ext); + LV_ASSERT_MEM(activity_obj); + if(activity_obj == NULL) + return NULL; + } + + lv_obj_t * obj = lv_watch_obj_create(activity_obj); + LV_ASSERT_MEM(obj); + if(obj == NULL) + return NULL; + lv_watch_obj_set_anim_mode(obj, LV_WATCH_ANIM_NO); + + lv_heng_ai_camera_obj_ext_t * ext = lv_obj_allocate_ext_attr(obj, sizeof(lv_heng_ai_camera_obj_ext_t)); + LV_ASSERT_MEM(ext); + if(ext == NULL) + return NULL; + ext->img = lv_obj_get_parent(obj); + ext->timer = NULL; + + ext->cont = lv_cont_create(obj, NULL); + lv_obj_set_size(ext->cont, LV_HOR_RES, LV_VER_RES); + lv_obj_set_style_local_bg_color(ext->cont, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); + lv_obj_set_hidden(ext->cont, true); + + lv_img_cache_invalidate_src(&img_camera); + img_camera.header.always_zero = 0; + img_camera.header.w = lv_obj_get_width(lv_obj_get_parent(obj)); + img_camera.header.h = lv_obj_get_height(lv_obj_get_parent(obj)); + img_camera.data_size = img_camera.header.w * img_camera.header.h * LV_COLOR_SIZE / 8; + img_camera.header.cf = LV_IMG_CF_TRUE_COLOR; + img_camera.data = lv_mem_alloc(img_camera.header.w * img_camera.header.h * LV_COLOR_SIZE / 8); + LV_ASSERT_MEM(img_camera.data); + if(img_camera.data == NULL) return NULL; + memset((void *)img_camera.data, 0, img_camera.header.w * img_camera.header.h * LV_COLOR_SIZE / 8); + + mmi_heng_ai_camera_create_shoot(obj); + + cam_start_preview_t cam_params; + + cam_params.width = LV_HOR_RES; // 240; + cam_params.height = LV_VER_RES; // 240; + cam_params.sensor_id = 0; + Hal_Camera_Start_Preview(&cam_params); + + preview_task = lv_task_create(mmi_heng_ai_camera_preview_task, 150, LV_TASK_PRIO_HIGH, NULL); + + watch_set_suspend_enable(false, ACT_ID_CAMERA, 0); + + return obj; +} + +void mmi_heng_ai_camera_open(void) +{ + if(strlen(s_heng_ai_photo_path)) + { + lv_fs_remove(s_heng_ai_photo_path); + _lv_memset_00(s_heng_ai_photo_path, sizeof(s_heng_ai_photo_path)); + } + + lv_obj_t * obj = mmi_heng_ai_camera_create(NULL); +} +#endif + + +void mmi_ui_msg_update_heng_ai_wake_now(void) +{ + mmi_remind_wake_up_screen_active(); +} + +void mmi_heng_ai_wake_now_aciton(void) +{ + printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + + if(true == mmi_active_screen_is_prohibit_interrupted() + #ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__ + || true == mmi_watch_is_in_do_not_disturb_time() + #endif + ) + { + return ; + } + if(true == wechat_msg_voice_is_recording() + || true == wechat_msg_item_is_sending() + || true == wechat_msg_voice_is_playing() + ) + { + return; + } + + if(true == mmi_remind_screen_is_active()) + { + return ; + } + + // ui + mmi_watch_wake_up(); + mmi_ui_msg_action_heng_ai_wake_now(); +} + + +// 0-ring; 1-vibrator +void mmi_heng_ai_wake_ring_type_set(uint8_t ring_type) +{ + nv_watch_switch_t ring_type_data = {0}; + uint32_t nv_data_length = sizeof(nv_watch_switch_t); + + ring_type_data.switch_flag = ring_type; + if(nv_data_length != UI_NV_Write_Req(NV_SECTION_UI_HENG_AI_WAKE_RING_TYPE, 0, nv_data_length, (uint8_t *)&ring_type_data)) + { + printf("[@CHENG_DEBUG][%s][%d]: nv write fail\n", __FUNCTION__, __LINE__); + } +} + +uint8_t mmi_heng_ai_wake_ring_type_get(void) +{ + nv_watch_switch_t ring_type_data = {0}; + uint32_t nv_data_length = sizeof(nv_watch_switch_t); + + if(nv_data_length != UI_NV_Read_Req(NV_SECTION_UI_HENG_AI_WAKE_RING_TYPE, 0, nv_data_length, (uint8_t *)&ring_type_data)) + { + printf("[@CHENG_DEBUG][%s][%d]: nv read fail\n", __FUNCTION__, __LINE__); + } + + return (ring_type_data.switch_flag); +} + +#endif diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai.h b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai.h new file mode 100644 index 00000000..fc211855 --- /dev/null +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai.h @@ -0,0 +1,43 @@ + + + +#ifndef __HENG_AI_H__ +#define __HENG_AI_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef LV_CONF_INCLUDE_SIMPLE +#include "lvgl.h" +#include "lv_ex_conf.h" +#else +#include "../../../lvgl/lvgl.h" +#include "../../../lv_ex_conf.h" +#endif + +#ifdef __MMI_CUSTOM_HENG_AI__ + +typedef struct +{ + lv_watch_obj_ext_t lv_watch_obj; + /*New data for this type */ + lv_obj_t * img; + lv_obj_t * cont; + hal_rtc_t time; + TIMER_ID timer; +} lv_heng_ai_camera_obj_ext_t; + + +void mmi_heng_ai_camera_open(void); +void mmi_heng_ai_wake_ring_type_set(uint8_t ring_type); +uint8_t mmi_heng_ai_wake_ring_type_get(void); + +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif + diff --git a/2.sdk/sdk/gui/lv_watch/lv_watch.c b/2.sdk/sdk/gui/lv_watch/lv_watch.c index d3083760..0358eccf 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_watch.c +++ b/2.sdk/sdk/gui/lv_watch/lv_watch.c @@ -82,6 +82,53 @@ static bool watch_ambient = false; **********************/ //extern void do_upay_init(void); + +#ifdef __MMI_ZHSX_SUPPORT__ +static void mmi_data_init_before_watch_create(void) +{ +#ifdef __MMI_WECHAT_SUPPORT__ + mmi_wechat_msg_info_init(); +#endif + mmi_sos_number_nv_read(); + mmi_center_number_nv_read(); +#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL__ + mmi_video_call_jrtc_config_init_00(); + mmi_video_call_contact_nv_read(); +#endif +#ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__ + mmi_watch_do_not_disturb_nv_read(); +#endif + + + +} + +static void mmi_data_init_after_watch_create(void) +{ + // timing mission + app_adaptor_timing_control_init(); + +#ifdef __MMI_ZHSX_SUPPORT_ALIPAY__ + mmi_watch_alipay_info_init(); +#endif +#ifdef __MMI_ZHSX_SUPPORT_NO_SIM_POWER_OFF__ + mmi_watch_no_sim_power_off_check_mission(); +#endif +#ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__ + mmi_watch_do_not_disturb_mission_check(); +#endif + mmi_dial_pad_switch_nv_read(); + mmi_white_list_switch_nv_read(); +#ifdef __MMI_ZHSX_SUPPORT_CHECK_SIM_UNBIND__ + mmi_watch_sim_unbind_switch_nv_read(); +#endif + mmi_remind_data_init(); + + + +} +#endif + /********************** * GLOBAL FUNCTIONS **********************/ @@ -175,20 +222,7 @@ void watch_power_on_req(void) asl_pedometer_poweron_on_init(); #ifdef __MMI_ZHSX_SUPPORT__ -#ifdef __MMI_WECHAT_SUPPORT__ - mmi_wechat_msg_info_init(); -#endif - mmi_sos_number_nv_read(); - mmi_center_number_nv_read(); -#ifdef __MMI_ZHSX_SUPPORT_VIDEO_CALL__ - mmi_video_call_jrtc_config_init_00(); - mmi_video_call_contact_nv_read(); -#endif -#ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__ - mmi_watch_do_not_disturb_nv_read(); -#endif - - + mmi_data_init_before_watch_create(); #endif if((HAL_POWERUP_ONKEY == reason) || (HAL_POWERUP_REBOOT == reason)) { @@ -507,25 +541,9 @@ static lv_obj_t * watch_create(bool silentReset) //app_adaptor_pedometer_record_t record; //app_adaptor_get_pedometer_info_req(&record); - app_adaptor_timing_control_init(); + //app_adaptor_timing_control_init(); #ifdef __MMI_ZHSX_SUPPORT__ -#ifdef __MMI_ZHSX_SUPPORT_ALIPAY__ - mmi_watch_alipay_info_init(); -#endif -#ifdef __MMI_ZHSX_SUPPORT_NO_SIM_POWER_OFF__ - mmi_watch_no_sim_power_off_check_mission(); -#endif -#ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__ - mmi_watch_do_not_disturb_mission_check(); -#endif - mmi_dial_pad_switch_nv_read(); - mmi_white_list_switch_nv_read(); -#ifdef __MMI_ZHSX_SUPPORT_CHECK_SIM_UNBIND__ - mmi_watch_sim_unbind_switch_nv_read(); -#endif - - - + mmi_data_init_after_watch_create(); #endif return obj; diff --git a/2.sdk/sdk/gui/lv_watch/lv_watch.h b/2.sdk/sdk/gui/lv_watch/lv_watch.h index 1add4497..1f4ff627 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_watch.h +++ b/2.sdk/sdk/gui/lv_watch/lv_watch.h @@ -184,6 +184,8 @@ extern "C" { #include "lv_apps/health_measure/health_spo2.h" #include "lv_apps/health_measure/health_temperature.h" #include "lv_apps/tool/tool.h" +#include "lv_apps/alarm_remind/alarm_remind.h" +#include "lv_apps/custom_function/custom_function.h" #endif diff --git a/2.sdk/sdk/gui/lv_watch/lv_watch_res.h b/2.sdk/sdk/gui/lv_watch/lv_watch_res.h index f124f463..7d047d83 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_watch_res.h +++ b/2.sdk/sdk/gui/lv_watch/lv_watch_res.h @@ -28,6 +28,13 @@ extern "C" { #define AUDIO_WATCH_SEARCH "R:/audio/audio_watch_search.mp3" +#ifdef __MMI_REMIND_WAKE_UP_SUPPORT__ +#define AUDIO_REMIND_WAKE_UP "R:/audio/AUDIO_REMIND_WAKE_UP.mp3" +#endif +#ifdef __MMI_REMIND_SLEEP_SUPPORT__ +#define AUDIO_REMIND_SLEEP "R:/audio/AUDIO_REMIND_SLEEP.mp3" +#endif + //******** audio resource end ******** diff --git a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.c b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.c index 27672990..5183487d 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.c +++ b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.c @@ -376,6 +376,14 @@ bool mmi_protocol_action_send_talk(char * data_buff, int data_buff_len) return mmi_protocol_fzd_ACTION_TALK(data_buff, data_buff_len); } +bool mmi_protocol_action_send_photo(uint8_t type, char * time_str, char * data_buff, int data_buff_len) +{ + if(false == mmi_protocol_check_state_before_send_action()) + return false; + + return mmi_protocol_fzd_action_send_photo(type, time_str, data_buff, data_buff_len); +} + bool mmi_protocol_action_send_location(MMI_WATCH_LOCATION_DATA_T * location_data) { if(false == mmi_protocol_check_state_before_send_action()) diff --git a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c index 4dc086f8..1b762fe6 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c +++ b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c @@ -530,7 +530,9 @@ static unsigned char * mmi_protocol_fzd_action_string_get(MMI_PROTOCOL_FZD_ACTIO {MMI_FZD_ACTION_TALK, "TK"}, {MMI_FZD_ACTION_TALK_MESSAGE, "MESSAGE"}, #endif - + #if USE_LV_WATCH_CAMERA != 0 + {MMI_FZD_ACTION_SEND_PHOTO, "img"}, + #endif {MMI_FZD_ACTION_GET_WEATHER, "WT"}, // {MMI_FZD_SERVER_SET_SOS_NUMBER, "SOS"}, // {MMI_FZD_SERVER_SET_CENTER_NUMBER, "CENTER"}, // @@ -562,6 +564,13 @@ static unsigned char * mmi_protocol_fzd_action_string_get(MMI_PROTOCOL_FZD_ACTIO #endif {MMI_FZD_SERVER_SET_DIAL_PAD_SWITCH, "KEYBRD"}, {MMI_FZD_SERVER_SET_WHITE_LIST_SWITCH, "WLKEY"}, + #ifdef __MMI_REMIND_WAKE_UP_SUPPORT__ + {MMI_FZD_SERVER_SET_REMIND_WAKE_UP, "REMIND_CH_WAKEUP"}, + #endif + #ifdef __MMI_CUSTOM_HENG_AI__ + {MMI_FZD_SERVER_SET_HENG_AI_WAKE_NOW, "HENG_AI_WAKE_NOW"}, + {MMI_FZD_SERVER_SET_HENG_AI_WAKE_RING_TYPE, "HENG_AI_WAKE_RING_TYPE"}, + #endif /*******add before this line*******/ @@ -707,6 +716,11 @@ static bool mmi_protocol_fzd_content_parse(unsigned char * content_ptr, unsigned break; #endif + #if USE_LV_WATCH_CAMERA != 0 + case MMI_FZD_ACTION_SEND_PHOTO: + break; + #endif + case MMI_FZD_ACTION_GET_WEATHER: mmi_protocol_fzd_parse_ACTION_GET_WEATHER(next_buff, next_buff_len); break; @@ -767,6 +781,21 @@ static bool mmi_protocol_fzd_content_parse(unsigned char * content_ptr, unsigned mmi_protocol_fzd_parse_SERVER_SET_WHITE_LIST_SWITCH(next_buff, next_buff_len); break; + #ifdef __MMI_REMIND_WAKE_UP_SUPPORT__ + case MMI_FZD_SERVER_SET_REMIND_WAKE_UP: + mmi_protocol_fzd_parse_SERVER_SET_REMIND_WAKE_UP(next_buff, next_buff_len); + break; + #endif + + #ifdef __MMI_CUSTOM_HENG_AI__ + case MMI_FZD_SERVER_SET_HENG_AI_WAKE_NOW: + mmi_protocol_fzd_parse_SERVER_SET_HENG_AI_WAKE_NOW(next_buff, next_buff_len); + break; + + case MMI_FZD_SERVER_SET_HENG_AI_WAKE_RING_TYPE: + mmi_protocol_fzd_parse_SERVER_SET_HENG_AI_WAKE_RING_TYPE(next_buff, next_buff_len); + break; + #endif default: @@ -1400,12 +1429,11 @@ bool mmi_protocol_fzd_parse_SERVER_SET_SPO2_INTERVAL(unsigned char * next_buff, return result; } -#ifdef __MMI_WECHAT_SUPPORT__ #define ENCRYPT_EXT_MIN 100 #define ENCRYPT_EXT_COEF 10 -int mmi_protocol_fzd_voice_data_encrypt(char * data_buff, int data_buff_len, char * encrypt_data) +static int mmi_protocol_fzd_voice_data_encrypt(char * data_buff, int data_buff_len, char * encrypt_data) { uint32_t curr_p = 0, i = 0; @@ -1451,7 +1479,7 @@ int mmi_protocol_fzd_voice_data_encrypt(char * data_buff, int data_buff_len, cha return curr_p; } -int mmi_protocol_fzd_voice_data_decrypt(char * data_buff, int data_buff_len) +static int mmi_protocol_fzd_voice_data_decrypt(char * data_buff, int data_buff_len) { int offset = 0; @@ -1506,6 +1534,7 @@ int mmi_protocol_fzd_voice_data_decrypt(char * data_buff, int data_buff_len) return offset; } +#ifdef __MMI_WECHAT_SUPPORT__ bool mmi_protocol_fzd_ACTION_TALK(char * data_buff, int data_buff_len) { bool result = false; @@ -1601,6 +1630,64 @@ bool mmi_protocol_fzd_parse_ACTION_TALK_MESSAGE(unsigned char * next_buff, unsig } #endif +#if USE_LV_WATCH_CAMERA != 0 +bool mmi_protocol_fzd_action_send_photo(uint8_t type, char * time_str, char * data_buff, int data_buff_len) +{ + bool result = false; + MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_ACTION_SEND_PHOTO; + unsigned char * content_buff = NULL; + unsigned int content_lenth = 0; + unsigned char * t_content_buff = NULL; + unsigned int t_content_lenth = 0; + unsigned int memory_size = 0; + + if(NULL == data_buff || 0 == data_buff_len) + { + PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + return false; + } + + memory_size = data_buff_len; + memory_size += LV_MATH_MAX((data_buff_len * ENCRYPT_EXT_COEF/100), LV_MATH_MIN(ENCRYPT_EXT_MIN, data_buff_len)); + PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: memory_size=%d\n", __FUNCTION__, __LINE__, memory_size); + + // image data + t_content_buff = (unsigned char *)lv_mem_alloc(memory_size); + if(NULL == t_content_buff) + { + PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + return false; + } + _lv_memset_00(t_content_buff, memory_size); + t_content_lenth = mmi_protocol_fzd_voice_data_encrypt(data_buff, data_buff_len, t_content_buff); + + // all data + content_buff = (unsigned char *)lv_mem_alloc(memory_size + 24); + if(NULL == content_buff) + { + PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + + lv_mem_free(t_content_buff); + return false; + } + _lv_memset_00(content_buff, (memory_size + 24)); + + sprintf(content_buff, ",0,0"); + content_lenth = strlen(content_buff); + + _lv_memcpy(content_buff + content_lenth, t_content_buff, t_content_lenth); + content_lenth += t_content_lenth; + lv_mem_free(t_content_buff); + + PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: content_lenth=%d\n", __FUNCTION__, __LINE__, content_lenth); + + result = mmi_protocol_fzd_send_with_data(action, content_buff, content_lenth); + lv_mem_free(content_buff); + + return result; +} +#endif + static void mmi_location_gps_data_process(MMI_WATCH_GPS_DATA_T * gps_data, char * data_str) { char state_str[2] = {0}; @@ -2956,7 +3043,123 @@ bool mmi_protocol_fzd_parse_SERVER_SET_WHITE_LIST_SWITCH(unsigned char * next_bu return result; } +#ifdef __MMI_REMIND_WAKE_UP_SUPPORT__ +//[XX*YYYY*0018*REMIND,08:10-1-1,08:10-1-2, 08:10-1-3-0111110] +//[SZKW*860132060004801*0034*REMIND,10:00-1-1,10:02-1-3-0111000,10:03-1-3-0111111] +bool mmi_protocol_fzd_parse_SERVER_SET_REMIND_WAKE_UP(unsigned char * next_buff, unsigned int next_buff_len) +{ + bool result = false; + MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_SERVER_SET_REMIND_WAKE_UP; + + if(NULL == next_buff || 0 == next_buff_len) + { + PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + return false; + } + + result = true; + mmi_protocol_fzd_send_without_data(action); + + nv_watch_remind_wake_up_t t_data = {0}; + char * group_str = NULL; + char * group_last = NULL; + char * temp_ptr = NULL; + char * last = NULL; + uint8_t i = 0; + + //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: next_buff=%s\n", __FUNCTION__, __LINE__, next_buff); + group_str = km_strtok_r(next_buff, ",", &group_last); + //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: temp_ptr1=%s,next_buff=%s\n", __FUNCTION__, __LINE__, group_str, next_buff); + while(NULL != group_str) + { + t_data.remind_info[i].valid = 1; + + temp_ptr = km_strtok_r(group_str, ":", &last); + t_data.remind_info[i].hour = atoi(temp_ptr); + + temp_ptr = km_strtok_r(NULL, "-", &last); + t_data.remind_info[i].min = atoi(temp_ptr); + + temp_ptr = km_strtok_r(NULL, "-", &last); + t_data.remind_info[i].on_off = atoi(temp_ptr); + + temp_ptr = km_strtok_r(NULL, "-", &last); + //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: temp_ptr=%s,last=%s\n", __FUNCTION__, __LINE__, temp_ptr, last); + if(1 == atoi(temp_ptr)) + { + t_data.remind_info[i].repeat_bitmap = 0; + } + else if(2 == atoi(temp_ptr)) + { + t_data.remind_info[i].repeat_bitmap = 0xff; + } + else + { + //server_set_alarm[i].repeat_bitmap = 0xff; + t_data.remind_info[i].repeat_bitmap = 0x80; + if(NULL != last) + { + uint8_t j = 0; + for(j = 0; j < 7; j++) + { + //server_set_alarm[i].repeat_bitmap &= ((('0' == *(last + j)) ? 0 : 1) << j); + t_data.remind_info[i].repeat_bitmap |= ((('0' == *(last + j)) ? 0 : 1) << j); + } + } + } + + i++; + if(NV_REMIND_WAKE_UP_MAX_NUM <= i) + { + break; + } + + group_str = km_strtok_r(NULL, ",", &group_last); + } + + mmi_remind_wake_up_data_set(&t_data); + + return result; +} +#endif + +#ifdef __MMI_CUSTOM_HENG_AI__ +bool mmi_protocol_fzd_parse_SERVER_SET_HENG_AI_WAKE_NOW(unsigned char * next_buff, unsigned int next_buff_len) +{ + bool result = false; + MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_SERVER_SET_HENG_AI_WAKE_NOW; + + result = true; + mmi_protocol_fzd_send_without_data(action); + + mmi_heng_ai_wake_now_aciton(); + + return result; +} + +bool mmi_protocol_fzd_parse_SERVER_SET_HENG_AI_WAKE_RING_TYPE(unsigned char * next_buff, unsigned int next_buff_len) +{ + bool result = false; + MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_SERVER_SET_HENG_AI_WAKE_RING_TYPE; + + if(NULL == next_buff || 0 == next_buff_len) + { + PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); + return false; + } + + result = true; + mmi_protocol_fzd_send_without_data(action); + uint32_t value = atoi(next_buff); + if(0 == value || 1 == value) + { + mmi_heng_ai_wake_ring_type_set(value); + } + + return result; +} +#endif diff --git a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h index 12967391..97243be1 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h +++ b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h @@ -123,10 +123,12 @@ typedef enum MMI_FZD_ACTION_TALK, // wechat MMI_FZD_ACTION_TALK_MESSAGE, // text message #endif - +#if USE_LV_WATCH_CAMERA != 0 + MMI_FZD_ACTION_SEND_PHOTO, +#endif MMI_FZD_ACTION_GET_WEATHER, - MMI_FZD_SERVER_SET_SOS_NUMBER, // 26 + MMI_FZD_SERVER_SET_SOS_NUMBER, MMI_FZD_SERVER_SET_CENTER_NUMBER, MMI_FZD_SERVER_SET_MONITOR, MMI_FZD_ACTION_UNBIND, @@ -147,7 +149,14 @@ typedef enum #endif MMI_FZD_SERVER_SET_DIAL_PAD_SWITCH, MMI_FZD_SERVER_SET_WHITE_LIST_SWITCH, +#ifdef __MMI_REMIND_WAKE_UP_SUPPORT__ + MMI_FZD_SERVER_SET_REMIND_WAKE_UP, +#endif +#ifdef __MMI_CUSTOM_HENG_AI__ + MMI_FZD_SERVER_SET_HENG_AI_WAKE_NOW, + MMI_FZD_SERVER_SET_HENG_AI_WAKE_RING_TYPE, +#endif /*******add before this line*******/ @@ -232,11 +241,14 @@ bool mmi_protocol_fzd_action_send_blood(uint16_t blood_high_value, uint16_t bloo bool mmi_protocol_fzd_action_send_spo2(uint16_t spo2_value); +#ifdef __MMI_WECHAT_SUPPORT__ bool mmi_protocol_fzd_ACTION_TALK(char * data_buff, int data_buff_len); - bool mmi_protocol_fzd_parse_ACTION_TALK(unsigned char * next_buff, unsigned int next_buff_len); - bool mmi_protocol_fzd_parse_ACTION_TALK_MESSAGE(unsigned char * next_buff, unsigned int next_buff_len); +#endif +#if USE_LV_WATCH_CAMERA != 0 +bool mmi_protocol_fzd_action_send_photo(uint8_t type, char * time_str, char * data_buff, int data_buff_len); +#endif bool mmi_protocol_fzd_action_send_location(MMI_WATCH_LOCATION_DATA_T * location_data); @@ -264,6 +276,13 @@ bool mmi_protocol_fzd_parse_SERVER_SET_NOT_DISTURB(unsigned char * next_buff, un #endif bool mmi_protocol_fzd_parse_SERVER_SET_DIAL_PAD_SWITCH(unsigned char * next_buff, unsigned int next_buff_len); bool mmi_protocol_fzd_parse_SERVER_SET_WHITE_LIST_SWITCH(unsigned char * next_buff, unsigned int next_buff_len); +#ifdef __MMI_REMIND_WAKE_UP_SUPPORT__ +bool mmi_protocol_fzd_parse_SERVER_SET_REMIND_WAKE_UP(unsigned char * next_buff, unsigned int next_buff_len); +#endif +#ifdef __MMI_CUSTOM_HENG_AI__ +bool mmi_protocol_fzd_parse_SERVER_SET_HENG_AI_WAKE_NOW(unsigned char * next_buff, unsigned int next_buff_len); +bool mmi_protocol_fzd_parse_SERVER_SET_HENG_AI_WAKE_RING_TYPE(unsigned char * next_buff, unsigned int next_buff_len); +#endif #endif diff --git a/2.sdk/sdk/gui/lvgl/hal/hal.h b/2.sdk/sdk/gui/lvgl/hal/hal.h index aa56c3f9..f85f20a6 100644 --- a/2.sdk/sdk/gui/lvgl/hal/hal.h +++ b/2.sdk/sdk/gui/lvgl/hal/hal.h @@ -790,6 +790,7 @@ typedef enum AUDIO_CTRL_PRIORITY_SEARCH, //search watch AUDIO_CTRL_PRIORITY_TIMER, //timer AUDIO_CTRL_PRIORITY_3, //alarm + AUDIO_CTRL_PRIORITY_REMIND, //remind AUDIO_CTRL_PRIORITY_4, //speech recog AUDIO_CTRL_PRIORITY_5, //voice msg AUDIO_CTRL_PRIORITY_6, //audio player