From: @CHENG <2393524978@qq.com> Date: Mon, 4 Mar 2024 09:02:00 +0000 (+0800) Subject: gengxin X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=4d03ecd13bc25258b414464bc0b2f35e7363041b;p=mirrors%2FASR3603_Z5.git gengxin --- diff --git a/2.sdk/sdk/gui/lv_watch/include/ui_nvm_interface.h b/2.sdk/sdk/gui/lv_watch/include/ui_nvm_interface.h index a9e8e3c0..41ccd348 100644 --- a/2.sdk/sdk/gui/lv_watch/include/ui_nvm_interface.h +++ b/2.sdk/sdk/gui/lv_watch/include/ui_nvm_interface.h @@ -300,6 +300,7 @@ typedef struct //uint8_t media_volume; //uint8_t power_on_off_volume; uint8_t white_list_switch; + uint8_t timing_location_switch; uint8_t dial_pad_switch; uint8_t low_battery_switch; uint8_t fall_down_switch; diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/setting/setting_ext.c b/2.sdk/sdk/gui/lv_watch/lv_apps/setting/setting_ext.c index 71c039da..579e66aa 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/setting/setting_ext.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/setting/setting_ext.c @@ -10,6 +10,7 @@ static nv_watch_setting_ext_t s_watch_setting_ext_value = {0}; void mmi_watch_setting_ext_data_nv_default(nv_watch_setting_ext_t * watch_settings) { watch_settings->white_list_switch = MMI_WHITE_LIST_SWITCH_DEFAULT; + watch_settings->timing_location_switch = MMI_TIMING_LOCATION_SWITCH_DEFAULT; watch_settings->dial_pad_switch = MMI_DIAL_PAD_SWITCH_DEFAULT; watch_settings->low_battery_switch = MMI_LOW_BATTERY_SWITCH_DEFAULT; watch_settings->fall_down_switch = MMI_FALL_DOWN_SWITCH_DEFAULT; @@ -68,6 +69,21 @@ void mmi_white_list_switch_set(uint8_t value) } } +// 0-close; 1-open +uint8_t mmi_timing_location_switch_get(void) +{ + return (s_watch_setting_ext_value.timing_location_switch); +} + +void mmi_timing_location_switch_set(uint8_t value) +{ + if(0 == value || 1 == value) + { + s_watch_setting_ext_value.timing_location_switch = value; + mmi_watch_setting_ext_data_nv_write(); + } +} + // 0-close; 1-open uint8_t mmi_dial_pad_switch_get(void) { diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/setting/setting_ext.h b/2.sdk/sdk/gui/lv_watch/lv_apps/setting/setting_ext.h index 291630cc..4d6f2685 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/setting/setting_ext.h +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/setting/setting_ext.h @@ -25,6 +25,9 @@ void mmi_watch_setting_ext_data_nv_read(void); uint8_t mmi_white_list_switch_get(void); void mmi_white_list_switch_set(uint8_t value); +uint8_t mmi_timing_location_switch_get(void); +void mmi_timing_location_switch_set(uint8_t value); + uint8_t mmi_dial_pad_switch_get(void); void mmi_dial_pad_switch_set(uint8_t value); diff --git a/2.sdk/sdk/gui/lv_watch/mmi_default.h b/2.sdk/sdk/gui/lv_watch/mmi_default.h index 03c44d33..77c1f842 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_default.h +++ b/2.sdk/sdk/gui/lv_watch/mmi_default.h @@ -194,6 +194,13 @@ extern "C" #define MMI_PEDOMETER_STEP_GOAL_DEFAULT (10000) #endif +// timing location +#ifdef MMI_CUSTOMER_TIMING_LOCATION_SWITCH +#define MMI_TIMING_LOCATION_SWITCH_DEFAULT MMI_CUSTOMER_TIMING_LOCATION_SWITCH +#else +#define MMI_TIMING_LOCATION_SWITCH_DEFAULT (MMI_WATCH_SWITCH_ON) // 0-close; 1-open +#endif + // dial pad #ifdef MMI_CUSTOMER_DIAL_PAD_SWITCH #define MMI_DIAL_PAD_SWITCH_DEFAULT MMI_CUSTOMER_DIAL_PAD_SWITCH 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 0e6c8b67..aacb17a5 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 @@ -429,6 +429,9 @@ bool mmi_protocol_action_send_location(MMI_WATCH_LOCATION_DATA_T * location_data bool mmi_protocol_action_location(void) { + if(0 == mmi_timing_location_switch_get()) + return false; + mmi_watch_location_mission_timed_location_action(); return true; } 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 204c346d..0a98a10f 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 @@ -2990,6 +2990,27 @@ bool mmi_protocol_fzd_parse_SERVER_SET_SLEEPTIME(unsigned char * next_buff, unsi } #endif +// 0-off; 1-on +bool mmi_protocol_fzd_parse_SERVER_SET_UD_SWITCH(unsigned char * next_buff, unsigned int next_buff_len) +{ + bool result = false; + MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_SERVER_SET_UD_SWITCH; + + 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); + mmi_timing_location_switch_set(value); + + return result; +} + bool mmi_protocol_fzd_parse_SERVER_SET_DIAL_PAD_SWITCH(unsigned char * next_buff, unsigned int next_buff_len) { bool result = false; 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 588b7312..d4e56441 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 @@ -156,6 +156,7 @@ typedef enum #ifdef __MMI_SLEEP_FUNCTION_SUPPORT__ MMI_FZD_SERVER_SET_SLEEPTIME, #endif + MMI_FZD_SERVER_SET_UD_SWITCH, MMI_FZD_SERVER_SET_DIAL_PAD_SWITCH, MMI_FZD_SERVER_SET_WHITE_LIST_SWITCH, MMI_FZD_SERVER_SET_LOW_BATTERY_SWITCH, @@ -314,6 +315,7 @@ bool mmi_protocol_fzd_action_VC_CALL_REQUEST(char * number, uint8_t call_type); #ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__ bool mmi_protocol_fzd_parse_SERVER_SET_NOT_DISTURB(unsigned char * next_buff, unsigned int next_buff_len); #endif +bool mmi_protocol_fzd_parse_SERVER_SET_UD_SWITCH(unsigned char * next_buff, unsigned int next_buff_len); 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); bool mmi_protocol_fzd_parse_SERVER_SET_LOW_BATTERY_SWITCH(unsigned char * next_buff, unsigned int next_buff_len); diff --git a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd_content.c b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd_content.c index 147dcdeb..979b6ba2 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd_content.c +++ b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd_content.c @@ -88,6 +88,7 @@ static unsigned char * mmi_protocol_fzd_action_string_get(MMI_PROTOCOL_FZD_ACTIO #ifdef __MMI_SLEEP_FUNCTION_SUPPORT__ {MMI_FZD_SERVER_SET_SLEEPTIME, "SLEEPTIME"}, #endif + {MMI_FZD_SERVER_SET_UD_SWITCH, "LOC_SWITCH"}, {MMI_FZD_SERVER_SET_DIAL_PAD_SWITCH, "KEYBRD"}, {MMI_FZD_SERVER_SET_WHITE_LIST_SWITCH, "WLKEY"}, {MMI_FZD_SERVER_SET_LOW_BATTERY_SWITCH, "LOWBAT"}, @@ -358,6 +359,10 @@ static bool mmi_protocol_fzd_content_parse(unsigned char * content_ptr, unsigned break; #endif + case MMI_FZD_SERVER_SET_UD_SWITCH: + mmi_protocol_fzd_parse_SERVER_SET_UD_SWITCH(next_buff, next_buff_len); + break; + case MMI_FZD_SERVER_SET_DIAL_PAD_SWITCH: mmi_protocol_fzd_parse_SERVER_SET_DIAL_PAD_SWITCH(next_buff, next_buff_len); break;