gengxin
author@CHENG <2393524978@qq.com>
Mon, 4 Mar 2024 09:02:00 +0000 (17:02 +0800)
committer@CHENG <2393524978@qq.com>
Mon, 4 Mar 2024 09:02:00 +0000 (17:02 +0800)
2.sdk/sdk/gui/lv_watch/include/ui_nvm_interface.h
2.sdk/sdk/gui/lv_watch/lv_apps/setting/setting_ext.c
2.sdk/sdk/gui/lv_watch/lv_apps/setting/setting_ext.h
2.sdk/sdk/gui/lv_watch/mmi_default.h
2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.c
2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c
2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.h
2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd_content.c

index a9e8e3c..41ccd34 100644 (file)
@@ -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;
index 71c039d..579e66a 100644 (file)
@@ -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)
 {
index 291630c..4d6f268 100644 (file)
@@ -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);
 
index 03c44d3..77c1f84 100644 (file)
@@ -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
index 0e6c8b6..aacb17a 100644 (file)
@@ -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;
 }
index 204c346..0a98a10 100644 (file)
@@ -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;
index 588b731..d4e5644 100644 (file)
@@ -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);
index 147dcde..979b6ba 100644 (file)
@@ -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;