srand(Hal_Timer_Get_Counter());
t_value = 50 + rand() % 150;
+#else
+ mmi_hsensor_heart_value_get(&t_value);
+#endif
+
if(220 < t_value)
t_value = 220;
else if(50 > t_value)
t_value = 50;
-#else
- 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;
* new_node = measure_type;
}
-void mmi_health_measure_timed_list_trigger(void)
+static bool mmi_health_measure_timed_list_trigger(MMI_HEALTH_MEASURE_TYPE_E measure_type)
{
if(true == _lv_ll_is_empty(&s_health_measure_timed_ll))
- return;
+ return false;
MMI_HEALTH_MEASURE_TYPE_E * node = _lv_ll_get_tail(&s_health_measure_timed_ll);
if(NULL == node)
- return;
+ return false;
+
+ lv_obj_t * activity_obj = lv_watch_get_activity_obj(ACT_ID_FACTORY_MODE_TEST);
+ if(NULL != activity_obj)
+ return false;
+ HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d,%d\n", __FUNCTION__, __LINE__, measure_type, * node);
+
+ if(measure_type != * node)
+ return false;
+
mmi_health_measure_timed_measure_start(* node);
+ return true;
}
void mmi_health_measure_timed_time_stamp_set(MMI_HEALTH_MEASURE_TYPE_E measure_type, uint32_t time_stamp)
if(true == direct_trigger
|| s_health_measure_timed_data.heart_timed_interval <= (cur_time_stamp - s_health_measure_heart_timed_time_stamp))
{
+ HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
mmi_health_measure_timed_list_node_add(MMI_HEALTH_MEASURE_HEART);
- mmi_health_measure_timed_list_trigger();
- mmi_health_measure_timed_time_stamp_set(MMI_HEALTH_MEASURE_HEART, cur_time_stamp);
+ if(true == mmi_health_measure_timed_list_trigger(MMI_HEALTH_MEASURE_HEART))
+ {
+ mmi_health_measure_timed_time_stamp_set(MMI_HEALTH_MEASURE_HEART, cur_time_stamp);
+ }
return true;
}
if(true == direct_trigger
|| s_health_measure_timed_data.temperature_timed_interval <= (cur_time_stamp - s_health_measure_temperature_timed_time_stamp))
{
+ HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
mmi_health_measure_timed_list_node_add(MMI_HEALTH_MEASURE_TEMPERATURE);
- mmi_health_measure_timed_list_trigger();
- mmi_health_measure_timed_time_stamp_set(MMI_HEALTH_MEASURE_TEMPERATURE, cur_time_stamp);
+ if(true == mmi_health_measure_timed_list_trigger(MMI_HEALTH_MEASURE_TEMPERATURE))
+ {
+ mmi_health_measure_timed_time_stamp_set(MMI_HEALTH_MEASURE_TEMPERATURE, cur_time_stamp);
+ }
return true;
}
|| s_health_measure_timed_data.blood_timed_interval <= (cur_time_stamp - s_health_measure_blood_timed_time_stamp))
{
mmi_health_measure_timed_list_node_add(MMI_HEALTH_MEASURE_BLOOD);
- mmi_health_measure_timed_list_trigger();
- mmi_health_measure_timed_time_stamp_set(MMI_HEALTH_MEASURE_BLOOD, cur_time_stamp);
+ if(true == mmi_health_measure_timed_list_trigger(MMI_HEALTH_MEASURE_BLOOD))
+ {
+ mmi_health_measure_timed_time_stamp_set(MMI_HEALTH_MEASURE_BLOOD, cur_time_stamp);
+ }
return true;
}
)
{
mmi_health_measure_timed_list_node_add(MMI_HEALTH_MEASURE_SPO2);
- mmi_health_measure_timed_list_trigger();
- mmi_health_measure_timed_time_stamp_set(MMI_HEALTH_MEASURE_SPO2, cur_time_stamp);
+ if(true == mmi_health_measure_timed_list_trigger(MMI_HEALTH_MEASURE_SPO2))
+ {
+ mmi_health_measure_timed_time_stamp_set(MMI_HEALTH_MEASURE_SPO2, cur_time_stamp);
+ }
return true;
}
uint16_t heart_value = s_health_measure_run_data.heart_value;
if(0 == heart_value)
+ {
+ HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
return;
+ }
mmi_protocol_action_send_heart(heart_value);
float body_value = s_health_measure_run_data.body_value;
if(0.0 == body_value)
+ {
+ HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
return;
+ }
mmi_protocol_action_send_temperature(body_value);
uint16_t blood_low_value = s_health_measure_run_data.blood_low_value;
if(0 == blood_high_value || 0 == blood_low_value)
+ {
+ HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
return;
+ }
mmi_protocol_action_send_blood(blood_high_value, blood_low_value);
uint16_t spo2_value = s_health_measure_run_data.spo2_value;
if(0 == spo2_value)
+ {
+ HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
return;
+ }
mmi_protocol_action_send_spo2(spo2_value);
void mmi_health_measure_process_finish(void)
{
+ HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
s_health_measure_run_data.measure_state = MMI_HEALTH_MEASURE_STATE_FINISH;
s_measure_time_count = 0;
s_measure_time_total = 0;
s_health_measure_run_data.measure_type = MMI_HEALTH_MEASURE_NONE;
}
-void mmi_health_measure_start(MMI_HEALTH_MEASURE_TYPE_E measure_type, uint32_t time_duration)
+static 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__);
s_health_measure_run_data.measure_type = measure_type;
s_measure_time_count = 0;
+ mmi_health_measure_process_timer_stop();
uos_timer_create(&s_health_measure_process_timer_id);
uos_timer_start(s_health_measure_process_timer_id, MS_TO_TICKS(MMI_HEALTH_MEASURE_CYCLE_DURATION), 0, mmi_health_measure_process_timer_handle, NULL);
}
mmi_health_measure_timed_list_node_remove(measure_type);
}
+ HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: type=%d\n", __FUNCTION__, __LINE__, measure_type);
+
return;
}
{
HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ lv_obj_t * activity_obj = lv_watch_get_activity_obj(ACT_ID_FACTORY_MODE_TEST);
+ if(NULL != activity_obj)
+ return;
+
if(MMI_HEALTH_MEASURE_STATE_UI == s_health_measure_run_data.measure_state)
{
return;
if(HAL_CHG_CONNECTED == Hal_Charger_Get_Status()) {
if(NULL != lv_watch_get_activity_obj(ACT_ID_LOWBATTERY)) {
// exit low battery mode
- printf("power charging start and exit low battery mode\n");
+ printf("[@CHENG_DEBUG][%s][%d]: power charging start and exit low battery mode\n", __FUNCTION__, __LINE__);
lowbattery_destory();
}
} else {
} else {
// exit low battery mode
if(NULL != lv_watch_get_activity_obj(ACT_ID_LOWBATTERY)) {
+ printf("[@CHENG_DEBUG][%s][%d]: exit low battery mode\n", __FUNCTION__, __LINE__);
lowbattery_destory();
}
}
static void lowbattery_prepare_destory(lv_obj_t * activity_obj)
{
lv_watch_png_cache_all_free();
- lv_lowbattery_ext_t * ext = lv_obj_get_ext_attr(lv_watch_get_activity_obj(ACT_ID_LOWBATTERY));
- ext->timelabel = NULL;
+ //lv_lowbattery_ext_t * ext = lv_obj_get_ext_attr(lv_watch_get_activity_obj(ACT_ID_LOWBATTERY));
+ //if(NULL != ext)
+ // ext->timelabel = NULL;
}
static void lowbattery_destory(void)
{
lowbattery_prepare_destory(NULL);
- lv_obj_del(lv_watch_get_activity_obj(ACT_ID_LOWBATTERY));
+ //lv_obj_del(lv_watch_get_activity_obj(ACT_ID_LOWBATTERY));
+ lv_obj_t * activity_obj = lv_watch_get_activity_obj(ACT_ID_LOWBATTERY);
+ if(NULL != activity_obj)
+ {
+ lv_obj_del(activity_obj);
+ }
}
#endif /*USE_LV_WATCH_LOWBATTERY*/
void mmi_vc_call_action_incoming(char * number, MODEM_VIDEO_CALL_TYPE type)
{
- if(true == mmi_active_screen_is_prohibit_interrupted() || true == is_rat_gsm())
+ if(true == mmi_active_screen_is_prohibit_interrupted()
+ || true == is_rat_gsm()
+ #ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__
+ || true == mmi_watch_is_in_do_not_disturb_time()
+ #endif
+ )
{
VIDEO_CALL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
s_video_call_params.call_type = type;
s_video_call_params.state = MMI_VIDEO_CALL_STATE_INCOMING;
strncpy(s_video_call_params.number, number, NV_WATCH_VC_CONTACT_NUMBER_LEN - 1);
+ uint8_t i = 0;
+ for(i = 0; i < s_vc_contact.total; i++)
+ {
+ if(0 == strncmp(s_video_call_params.number, s_vc_contact.number[i], strlen(s_video_call_params.number)))
+ {
+ strncpy(s_video_call_params.name, s_vc_contact.name[i], NV_WATCH_VC_CONTACT_NAME_LEN - 1);
+ break;
+ }
+ }
HAL_SPEAKER_GAIN volume = query_current_volume();
if(!Hal_Set_BT_Audio_Path(volume))
s_video_call_params.state = MMI_VIDEO_CALL_STATE_DIALING;
s_video_call_params.call_type = type;
strcpy(s_video_call_params.number, number);
+ uint8_t i = 0;
+ for(i = 0; i < s_vc_contact.total; i++)
+ {
+ if(0 == strncmp(s_video_call_params.number, s_vc_contact.number[i], strlen(s_video_call_params.number)))
+ {
+ strncpy(s_video_call_params.name, s_vc_contact.name[i], NV_WATCH_VC_CONTACT_NAME_LEN - 1);
+ break;
+ }
+ }
int8_t ret = mmi_video_call_dial_req(type, s_video_call_params.number);
if(NULL == s_video_call_params.dialing_timer_id)
void mmi_vc_call_action_incoming(char * number, MODEM_VIDEO_CALL_TYPE type, char * t_ticket, char * t_tokens)
{
- if(true == mmi_active_screen_is_prohibit_interrupted() || true == is_rat_gsm())
+ if(true == mmi_active_screen_is_prohibit_interrupted()
+ || true == is_rat_gsm()
+ #ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__
+ || true == mmi_watch_is_in_do_not_disturb_time()
+ #endif
+ )
{
VIDEO_CALL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
s_video_call_params.call_type = type;
s_video_call_params.state = MMI_VIDEO_CALL_STATE_INCOMING;
strncpy(s_video_call_params.number, number, NV_WATCH_VC_CONTACT_NUMBER_LEN - 1);
+ uint8_t i = 0;
+ for(i = 0; i < s_vc_contact.total; i++)
+ {
+ if(0 == strncmp(s_video_call_params.number, s_vc_contact.number[i], strlen(s_video_call_params.number)))
+ {
+ strncpy(s_video_call_params.name, s_vc_contact.name[i], NV_WATCH_VC_CONTACT_NAME_LEN - 1);
+ break;
+ }
+ }
memset(s_video_call_ticket, 0x0, MMI_WATCH_VC_TICKET_LEN);
strncpy(s_video_call_ticket, t_ticket, MMI_WATCH_VC_TICKET_LEN - 1);
s_video_call_params.state = MMI_VIDEO_CALL_STATE_DIALING;
s_video_call_params.call_type = type;
strcpy(s_video_call_params.number, number);
+ uint8_t i = 0;
+ for(i = 0; i < s_vc_contact.total; i++)
+ {
+ if(0 == strncmp(s_video_call_params.number, s_vc_contact.number[i], strlen(s_video_call_params.number)))
+ {
+ strncpy(s_video_call_params.name, s_vc_contact.name[i], NV_WATCH_VC_CONTACT_NAME_LEN - 1);
+ break;
+ }
+ }
mmi_protocol_fzd_action_VC_CALL_REQUEST(s_video_call_params.number, s_video_call_params.call_type);
s_video_call_params.dialing_timer_id = Hal_Timer_Start(MMI_VC_DIALING_TIMEOUT, mmi_vc_call_dialing_timeout_cb, NULL, 0);
-void wechat_chat_list_set_slide_enable(lv_watch_obj_ext_t * ext, bool enable);
+//void wechat_chat_list_set_slide_enable(lv_watch_obj_ext_t * ext, bool enable);
void mmi_wechat_msg_info_init(void);
void wechat_msg_info_nv_write(void);
WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
}
-void wechat_chat_list_set_slide_enable(lv_watch_obj_ext_t * ext, bool enable)
+static void wechat_chat_list_set_slide_enable(lv_watch_obj_ext_t * ext, bool enable)
{
if(enable)
{
&& false == wechat_msg_voice_is_playing()
&& false == wechat_msg_voice_is_recording()
&& false == wechat_msg_item_is_sending()
+ #ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__
+ && false == mmi_watch_is_in_do_not_disturb_time()
+ #endif
)
{
WECHAT_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
lv_obj_del(activity_obj);
}
- lv_wechat_ext_t * ext = wechat_actId_ext_get(ACT_ID_WECHAT_MAIN);
- if(NULL != ext)
- {
- wechat_chat_list_set_slide_enable(&ext->old_ext, false); /*prevent to slide out while recording*/
- }
+ //lv_wechat_ext_t * ext = wechat_actId_ext_get(ACT_ID_WECHAT_MAIN);
+ //if(NULL != ext)
+ //{
+ // wechat_chat_list_set_slide_enable(&ext->old_ext, false); /*prevent to slide out while recording*/
+ //}
}
}
lv_wechat_ext_t * ext = wechat_actId_ext_get(ACT_ID_WECHAT_MAIN);
if(NULL != ext)
{
- wechat_chat_list_set_slide_enable(&ext->old_ext, false); /*prevent to slide out while recording*/
+ //wechat_chat_list_set_slide_enable(&ext->old_ext, false); /*prevent to slide out while recording*/
wechat_msg_voice_item_playing_stop(ext);
}
}
static void phonebook_btn_event_cb(lv_obj_t * btn, lv_event_t e)
{
+#ifdef __MMI_ZHSX_SUPPORT__
+ //printf("[@CHENG_DEBUG][%s][%d]: %d\n", __FUNCTION__, __LINE__, e);
+
+ static uint8_t s_phonebook_item_click_flag = 0;
+ if(LV_EVENT_CLICKED == e)
+ {
+ if(s_phonebook_item_click_flag)
+ {
+ lv_phonebook_obj_ext_t * ext = phonebook_get_ext();
+ uint8_t length = strlen(ext->cur_contact->number) + 1;
+ char * number = (char *)lv_mem_alloc(length);
+ memcpy(number, ext->cur_contact->number, length);
+ phone_voice_call_req(number);
+ }
+ }
+ else if(LV_EVENT_PRESSED == e)
+ {
+ s_phonebook_item_click_flag = 1;
+ }
+ else if(LV_EVENT_LONG_PRESSED == e)
+ {
+ s_phonebook_item_click_flag = 0;
+ }
+#else
lv_phonebook_obj_ext_t * ext = NULL;
uint8_t length = 0;
char * number = NULL;
memcpy(number, ext->cur_contact->number, length);
phone_voice_call_req(number);
}
+#endif
}
static void phonebook_add_btn(lv_obj_t * obj, char * phone_name, char * phone_number, lv_event_cb_t event_cb)
#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
#endif
voice_wakeup_init();
#endif
- app_adaptor_pedometer_record_t record;
- app_adaptor_get_pedometer_info_req(&record);
+ //app_adaptor_pedometer_record_t record;
+ //app_adaptor_get_pedometer_info_req(&record);
app_adaptor_timing_control_init();
#ifdef __MMI_ZHSX_SUPPORT_NO_SIM_POWER_OFF__
return;
}
+#ifdef __MMI_ZHSX_SUPPORT__
+ if(NULL != lv_watch_get_activity_obj(ACT_ID_WATCH_SEARCHING))
+ {
+ mmi_watch_search_screen_destroy();
+ }
+#endif
+
#if USE_LV_WATCH_EXERCISE != 0
if(exercise_sport_home_key_handle()) {
return;
return;
}
+ printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
if(ext->actId > ACT_ID_ONE_LEVEL_MAX) {
if(ext->actId == ACT_ID_ALBUM) {
album_destory(false);
return;
}
+#ifdef __MMI_ZHSX_SUPPORT__
+ if(NULL != lv_watch_get_activity_obj(ACT_ID_WATCH_SEARCHING))
+ {
+ mmi_watch_search_screen_destroy();
+ }
+#endif
+
+#ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__
+ if(true == mmi_watch_is_in_do_not_disturb_time())
+ {
+ return;
+ }
+#endif
+
#if USE_LV_WATCH_EXERCISE != 0
if(exercise_sport_back_key_handle()) {
return;
launcher_power_key_event();
return;
}
+
+ printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
if(ext->actId > ACT_ID_ONE_LEVEL_MAX) {
if(NULL != ext->prepare_destory) {
ext->prepare_destory(obj);
#include "mmi_default_CUSTOM.h"
-//server ip
+// protocol server ip
#ifdef MMI_CUSTOMER_IP_ADDRESS
#define MMI_PROTOCOL_IP_ADDRESS_DEFAULT MMI_CUSTOMER_IP_ADDRESS
#else
#define MMI_PROTOCOL_IP_ADDRESS_DEFAULT "api.xcloudtech.com" // fzd
#endif
+// protocol server port
#ifdef MMI_CUSTOMER_IP_PORT
#define MMI_PROTOCOL_IP_PORT_DEFAULT MMI_CUSTOMER_IP_PORT
#else
#define MMI_PROTOCOL_IP_PORT_DEFAULT (9000) // fzd
#endif
-
// protocol md5 key
#ifdef MMI_CUSTOMER_PROTOCOL_MD5_KEY
#define MMI_PROTOCOL_MD5_KEY_DEFAULT MMI_CUSTOMER_PROTOCOL_MD5_KEY