From: @CHENG <2393524978@qq.com> Date: Wed, 3 Jan 2024 11:02:22 +0000 (+0800) Subject: gengxin X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=7c369ea3b890a9e6d6822c2cada05f642d6e5a98;p=mirrors%2FASR3603_Z5.git gengxin --- diff --git a/2.sdk/project/Z5_HA_K18/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h b/2.sdk/project/Z5_HA_K18/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h index e83fc194..c7928287 100644 --- a/2.sdk/project/Z5_HA_K18/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h +++ b/2.sdk/project/Z5_HA_K18/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h @@ -201,7 +201,7 @@ #endif -#define __MMI_CUSTOM_HENG_AI_BLOOD_PRESSURE__ +#define __MMI_CUSTOM_HENGAI_HEALTH__ diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_blood_pressure.c b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_blood_pressure.c index 633be027..6d4e05a7 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_blood_pressure.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_blood_pressure.c @@ -970,13 +970,7 @@ void mmi_hengai_bp_calibrate_update_result(bool is_success) if(true != watch_ext->is_watting_result) return; - if(is_success) - { - nv_watch_hengai_health_data_t data = {0}; - - data.is_calibrated = 1; - mmi_hengai_blood_pressure_data_set(&data); - } + mmi_hengai_bp_calibrated_flag_set(is_success ? 1 : 0); mmi_hengai_bp_calibrate_result_screen(is_success); } @@ -1861,7 +1855,7 @@ lv_obj_t * mmi_heng_ai_bp_screen_create(lv_obj_t * activity_obj) if(NULL == ext->tab_attempt_mode) return NULL; - if(1 == mmi_hengai_bp_is_calibrated()) + if(0 == mmi_hengai_bp_calibrated_flag_get()) lv_tileview_set_tile_act(tileview, 1, 0, LV_ANIM_OFF); else lv_tileview_set_tile_act(tileview, 0, 0, LV_ANIM_OFF); @@ -1888,7 +1882,7 @@ void mmi_heng_ai_blood_pressure_create_event_cb(lv_obj_t * btn, lv_event_t e) - +#if 0 static void * __s_debug_timer_id = NULL; //TIMER_ID measure_timer_id; @@ -1937,5 +1931,6 @@ void __debug_start(void) __debug_timer_start(); } +#endif #endif diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_blood_pressure.h b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_blood_pressure.h index 96d837aa..d42966a6 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_blood_pressure.h +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_blood_pressure.h @@ -81,22 +81,6 @@ typedef struct - - - - - -void mmi_hengai_blood_pressure_nv_read(void); - -#if 0 -uint8_t mmi_hengai_bp_is_activated(void); -char * mmi_hengai_bp_req_code_get(void); -void mmi_hengai_bp_req_code_set(char * req_code); -char * mmi_hengai_bp_act_code_get(void); -void mmi_hengai_bp_act_code_set(char * act_code); -void mmi_hengai_bp_activated_finish(void); -#endif - uint8_t mmi_hengai_bp_is_measuring(void); diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_http_protocol.c b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_http_protocol.c index 3d79d652..4e9cb565 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_http_protocol.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_http_protocol.c @@ -399,7 +399,7 @@ void mmi_hengai_bp_activation_feedback(void) if(cJSON_GetIntValue(cJSON_GetObjectItem(json_recv, "status"))) { // true - mmi_hengai_bp_activated_finish(); + mmi_hengai_health_activated_flag_set(1); } else { @@ -434,7 +434,7 @@ void mmi_hengai_bp_activation_check_action(void) { char * post_data = NULL; cJSON * json_send = NULL; - char * req_code = mmi_hengai_bp_req_code_get(); + char * req_code = mmi_hengai_health_req_code_get(); char imei[16 + 1] = {0}; app_adp_get_imei_req(imei); @@ -470,7 +470,7 @@ void mmi_hengai_bp_activation_check_action(void) cJSON * json_data = cJSON_GetObjectItem(json_recv, "data"); char * act_code = cJSON_GetStringValue(cJSON_GetObjectItem(json_data, "activation_code")); - mmi_hengai_bp_act_code_set(act_code); + mmi_hengai_health_act_code_set(act_code); // »ñµÃÁ˼¤»îÂ룬·¢Ë͸øÏ³Á¿â£¬²¢µÃµ½ÕýÈ··µ»ØºóÇëÇó // if() @@ -573,75 +573,87 @@ void mmi_hengai_algorithm_interface_login_action(void) -static nv_watch_hengai_health_data_t s_hengai_blood_pressure_data = {0}; +static nv_watch_hengai_health_data_t s_hengai_health_data = {0}; -void mmi_hengai_blood_pressure_nv_write(void) +void mmi_hengai_health_data_nv_write(void) { uint32_t nv_data_length = sizeof(nv_watch_hengai_health_data_t); - if(nv_data_length != UI_NV_Write_Req(NV_SECTION_UI_HENGAI_HEALTH_DATA, 0, nv_data_length, (uint8_t *)&s_hengai_blood_pressure_data)) + if(nv_data_length != UI_NV_Write_Req(NV_SECTION_UI_HENGAI_HEALTH_DATA, 0, nv_data_length, (uint8_t *)&s_hengai_health_data)) { printf("[@CHENG_DEBUG][%s][%d]: nv write fail\n", __FUNCTION__, __LINE__); } } -void mmi_hengai_blood_pressure_nv_read(void) +void mmi_hengai_health_data_nv_read(void) { uint32_t nv_data_length = sizeof(nv_watch_hengai_health_data_t); - if(nv_data_length != UI_NV_Read_Req(NV_SECTION_UI_HENGAI_HEALTH_DATA, 0, nv_data_length, (uint8_t *)&s_hengai_blood_pressure_data)) + if(nv_data_length != UI_NV_Read_Req(NV_SECTION_UI_HENGAI_HEALTH_DATA, 0, nv_data_length, (uint8_t *)&s_hengai_health_data)) { printf("[@CHENG_DEBUG][%s][%d]: nv read fail\n", __FUNCTION__, __LINE__); - _lv_memset_00(&s_hengai_blood_pressure_data, sizeof(nv_watch_hengai_health_data_t)); + _lv_memset_00(&s_hengai_health_data, sizeof(nv_watch_hengai_health_data_t)); } } -void mmi_hengai_blood_pressure_data_set(nv_watch_hengai_health_data_t * data) +uint8_t mmi_hengai_health_activated_flag_get(void) { - if(NULL != data) - { - _lv_memset_00(&s_hengai_blood_pressure_data, sizeof(nv_watch_hengai_health_data_t)); - _lv_memcpy(&s_hengai_blood_pressure_data, data, sizeof(nv_watch_hengai_health_data_t)); - mmi_hengai_blood_pressure_nv_write(); - } + return (s_hengai_health_data.is_activated); +} + +void mmi_hengai_health_activated_flag_set(uint8_t flag) +{ + s_hengai_health_data.is_activated = flag; + mmi_hengai_health_data_nv_write(); } -uint8_t mmi_hengai_bp_is_calibrated(void) +char * mmi_hengai_health_req_code_get(void) { - return (s_hengai_blood_pressure_data.is_calibrated); + return (s_hengai_health_data.req_code); } -uint8_t mmi_hengai_bp_is_activated(void) +void mmi_hengai_health_req_code_set(char * req_code) { - return (s_hengai_blood_pressure_data.is_activated); + _lv_memcpy(s_hengai_health_data.req_code, req_code, strlen(req_code)); + mmi_hengai_health_data_nv_write(); } -char * mmi_hengai_bp_req_code_get(void) +char * mmi_hengai_health_act_code_get(void) { - return (s_hengai_blood_pressure_data.req_code); + return (s_hengai_health_data.act_code); } -void mmi_hengai_bp_req_code_set(char * req_code) +void mmi_hengai_health_act_code_set(char * act_code) { - _lv_memcpy(s_hengai_blood_pressure_data.req_code, req_code, strlen(req_code)); + _lv_memcpy(s_hengai_health_data.act_code, act_code, strlen(act_code)); + mmi_hengai_health_data_nv_write(); } -char * mmi_hengai_bp_act_code_get(void) +char * mmi_hengai_health_token_get(void) { - return (s_hengai_blood_pressure_data.act_code); + return (s_hengai_health_data.token); } -void mmi_hengai_bp_act_code_set(char * act_code) +void mmi_hengai_health_token_set(char * token) { - _lv_memcpy(s_hengai_blood_pressure_data.act_code, act_code, strlen(act_code)); + _lv_memcpy(s_hengai_health_data.token, token, strlen(token)); + mmi_hengai_health_data_nv_write(); } -void mmi_hengai_bp_activated_finish(void) +uint8_t mmi_hengai_bp_calibrated_flag_get(void) { - s_hengai_blood_pressure_data.is_activated = 1; - mmi_hengai_blood_pressure_nv_write(); + return (s_hengai_health_data.is_calibrated); } +void mmi_hengai_bp_calibrated_flag_set(uint8_t flag) +{ + s_hengai_health_data.is_calibrated = flag; + mmi_hengai_health_data_nv_write(); +} + + + + diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_http_protocol.h b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_http_protocol.h index 63e6c5bf..40f1be47 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_http_protocol.h +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_http_protocol.h @@ -45,6 +45,22 @@ extern "C" { +void mmi_hengai_health_data_nv_read(void); + +uint8_t mmi_hengai_health_activated_flag_get(void); +void mmi_hengai_health_activated_flag_set(uint8_t flag); + +char * mmi_hengai_health_req_code_get(void); +void mmi_hengai_health_req_code_set(char * req_code); + +char * mmi_hengai_health_act_code_get(void); +void mmi_hengai_health_act_code_set(char * act_code); + +char * mmi_hengai_health_token_get(void); +void mmi_hengai_health_token_set(char * token); + +uint8_t mmi_hengai_bp_calibrated_flag_get(void); +void mmi_hengai_bp_calibrated_flag_set(uint8_t flag); diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/phonebook/phonebook.c b/2.sdk/sdk/gui/lv_watch/lv_apps/phonebook/phonebook.c index 864e3223..06ae1046 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/phonebook/phonebook.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/phonebook/phonebook.c @@ -74,6 +74,11 @@ void phonebook_init(void) void phonebook_create_btn_event_cb(lv_obj_t * btn, lv_event_t e) { +#ifdef __MMI_CUSTOM_HENGAI_HEALTH__ + + mmi_heng_ai_blood_pressure_create_event_cb(btn, e); +#else + #ifdef __MMI_ZHSX_SUPPORT_PHONEBOOK_LIST_STYLE__ #ifdef __MMI_PHONEBOOK_CALLLOG_IN_ONE_MENU__ mmi_phonebook_calllog_create_event_cb(btn, e); @@ -88,6 +93,8 @@ void phonebook_create_btn_event_cb(lv_obj_t * btn, lv_event_t e) phonebook_create(NULL); } #endif + +#endif } void app_adaptor_update_phonebook_ind(app_adaptor_contact_t * contact_list, uint8_t count) diff --git a/2.sdk/sdk/gui/lv_watch/lv_watch.c b/2.sdk/sdk/gui/lv_watch/lv_watch.c index 9de967ab..47b89c57 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_watch.c +++ b/2.sdk/sdk/gui/lv_watch/lv_watch.c @@ -137,7 +137,7 @@ static void mmi_data_init_after_watch_create(void) mmi_sedentary_remind_mission_power_on_check(); #endif #ifdef __MMI_CUSTOM_HENGAI_HEALTH__ - mmi_hengai_blood_pressure_nv_read(); + mmi_hengai_health_data_nv_read(); #endif