break;
#if USE_LV_WATCH_SMS_MSG != 0
case MMI_MODEM_RECV_SMS_NOTIFY_UI_CMD:
- sms_msg_list_update();
- break;
+ #ifdef __MMI_ZHSX_SUPPORT__
+ mmi_sms_new_msg_prompt();
+ #endif
+ sms_msg_list_update();
+ break;
#endif
case MMI_HAL_LOW_POWER_IND:
Hal_Vibrator_Play_End();
}
+void mmi_sms_new_msg_prompt(void)
+{
+ uint8_t volume = 0;
+
+#ifdef __MMI_USER_PROFILE_SUPPORT__
+ volume = mmi_user_profile_current_mode_new_sms_volume_get();
+#else
+ volume = query_current_volume();
+#endif
+#ifdef __MMI_NEW_SMS_SILENT_SUPPORT__
+ if(0 != mmi_new_sms_silent_swtich_get())
+ volume = 0;
+#endif
+ if(0 != volume)
+ {
+ Hal_NFFS_File_Play_Onetime(AUDIO_SETTING_AUDIO_MSG, volume, NULL, 0);
+ }
+ if(true == mmi_watch_vibrate_is_permitted())
+ {
+ Hal_Vibrator_Play_Onetime(NULL, 800);
+ lv_task_t * task_ptr = lv_task_create(mmi_sms_vib_prompt_task_cb, 900, LV_TASK_PRIO_MID, NULL);
+ lv_task_once(task_ptr);
+ }
+}
+
void sms_msg_app_new_sms_info_ind(app_adp_new_sms_info_ind_t *sms_info)
{
if(sms_info == NULL)
&& (false == mmi_health_measure_state_is_ui_measure())
#endif
)
- {
+ {
if(0 == Hal_Pm_Get_State())
{
- printf("sms_msg_list_update -----> onkey_wakeup\n");
+ printf("new_sms -----> onkey_wakeup\n");
extern void onkey_wakeup(void) __attribute__((weak));
if (onkey_wakeup != NULL)
{
}
else
{
- printf("sms_msg_list_update -----> watch_set_lcd_status\n");
+ printf("new_sms -----> watch_set_lcd_status\n");
watch_set_lcd_status(true);
watch_wakeup_time_reset();
}
- #ifdef __MMI_ZHSX_SUPPORT__
- uint8_t volume = 0;
-
- #ifdef __MMI_USER_PROFILE_SUPPORT__
- volume = mmi_user_profile_current_mode_new_sms_volume_get();
- #else
- volume = query_current_volume();
- #endif
- #ifdef __MMI_NEW_SMS_SILENT_SUPPORT__
- if(0 != mmi_new_sms_silent_swtich_get())
- volume = 0;
- #endif
- if(0 != volume)
- {
- Hal_NFFS_File_Play_Onetime(AUDIO_SETTING_AUDIO_MSG, volume, NULL, 0);
- }
- if(true == mmi_watch_vibrate_is_permitted())
- {
- Hal_Vibrator_Play_Onetime(NULL, 800);
- lv_task_t * task_ptr = lv_task_create(mmi_sms_vib_prompt_task_cb, 900, LV_TASK_PRIO_MID, NULL);
- lv_task_once(task_ptr);
- }
- #endif
-
//notify ui
app_adaptor_recv_sms_notsify_update_ui();
}
*/
void sms_msg_list_update(void);
void sms_msg_create_event_cb(lv_obj_t * btn,lv_event_t e);
+#ifdef __MMI_ZHSX_SUPPORT__
+void mmi_sms_new_msg_prompt(void);
+#endif
void sms_msg_app_new_sms_info_ind(app_adp_new_sms_info_ind_t *sms_info);
lv_obj_t * sms_msg_create(lv_obj_t * tileview,uint16_t id);
#ifdef __MMI_ZHSX_SUPPORT__
static void mmi_data_init_before_watch_create(void)
{
+ // create task
+ mmi_protocol_timing_task_create();
+#ifdef __MMI_ZHSX_SUPPORT_HEALTH_SENSOR__
+ mmi_health_measure_task_init();
+#endif
+
// mmi_watch_common_task_create();
mmi_sos_number_nv_read();
mmi_center_number_nv_read();
#ifdef __MMI_ZHSX_SUPPORT__
static bool s_is_ACT_ID_POWON_LOGO = false;
+static bool s_poweron_logo_is_finish = false;
bool mmi_is_ACT_ID_POWON_LOGO(void)
{
return s_is_ACT_ID_POWON_LOGO;
}
+
+bool mmi_poweron_logo_is_finish(void)
+{
+ return s_poweron_logo_is_finish;
+}
#endif
void watch_poweron_logo(void)
#ifdef __MMI_ZHSX_SUPPORT__
s_is_ACT_ID_POWON_LOGO = false;
+
+ s_poweron_logo_is_finish = true;
#endif
}
}
mmi_watch_authenticate_flag_set(1);
- mmi_launcher_tcp_first_connect(0);
+ mmi_launcher_tcp_first_connect_check_start();
}
else
{
- PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: false\n", __FUNCTION__, __LINE__);
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: false.imei=%s\n", __FUNCTION__, __LINE__, imei);
//cplog_printf("[@CHENG_DEBUG][%s][%d]: false\n", __FUNCTION__, __LINE__);
}
}
}
}
-static void mmi_protocol_timing_task_create(void)
+void mmi_protocol_timing_task_create(void)
{
if(NULL != s_protocol_timing_task_id)
{
PROTOCOL_TIMING_MSG_QUEUE_SIZE,
PROTOCOL_TIMING_TASK_STACK_SIZE,
PROTOCOL_TIMING_TASK_PRIORITY,
- "mmi_protocol_timing_task");
+ "protocol_timing");
PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: task_id=0x%x\n",__FUNCTION__,__LINE__, s_protocol_timing_task_id);
}
{
mmi_protocol_timing_mission_stop();
- mmi_protocol_timing_task_create();
+ //mmi_protocol_timing_task_create();
uint32_t cur_time_stamp = 0;
Hal_Rtc_Gettime_Count_Utc(&cur_time_stamp);
s_protocol_timed_weather_time_stamp = cur_time_stamp;
#ifdef __MMI_ZHSX_SUPPORT_HEALTH_SENSOR__
- mmi_health_measure_task_init();
+ //mmi_health_measure_task_init();
mmi_health_measure_timed_info_nv_read();
mmi_health_measure_timed_mission_action(cur_time_stamp, true);
#endif
extern void dm_send_msg_active(void);
bool mmi_protocol_watch_link_action(void)
{
-#ifdef __MMI_CUSTOM_HENGAI_HEALTH__
- mmi_hengai_algorithm_interface_login_action();
- mmi_hengai_health_lib_activation_check_action();
-#endif
#if USE_DS_DM
dm_send_msg_active();
#endif
PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: no sim\n", __FUNCTION__, __LINE__);
return false;
}
+/*
if(MMI_MODEM_SIGNAL_BAR_0 == watch_modem_get_signal_bar_req())
{
PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: no signal\n", __FUNCTION__, __LINE__);
return false;
}
+*/
if(false == mmi_watch_tcp_connect_state_get())
{
PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: tcp not connect\n", __FUNCTION__, __LINE__);
char * mmi_protocol_device_name_get(void);
void mmi_protocol_device_name_set(char * device_name);
+void mmi_protocol_timing_task_create(void);
void mmi_protocol_timing_task_msg_send(MMI_PROTOCOL_TIMING_MSG_ID_E msg_id, void * msg_param);
void mmi_protocol_timing_mission_action(void);
void mmi_protocol_timing_mission_stop(void);
}
+
+static void * s_login_timer_id = NULL;
+static void mmi_protocol_fzd_login_check_stop(void)
+{
+ if(NULL != s_login_timer_id)
+ {
+ uos_timer_stop(s_login_timer_id);
+ uos_timer_delete(s_login_timer_id);
+ s_login_timer_id = NULL;
+ }
+}
+
+static void mmi_protocol_fzd_login_check_cb(uint32_t para)
+{
+ send_task_msg_tcp_reconnect(NULL);
+}
+
+static void mmi_protocol_fzd_login_check_start(void)
+{
+ if(NULL == s_login_timer_id)
+ {
+ uos_timer_create(&s_login_timer_id);
+ }
+ else
+ {
+ uos_timer_stop(s_login_timer_id);
+ }
+ uos_timer_start(s_login_timer_id, MS_TO_TICKS(1000 * 20), 0, mmi_protocol_fzd_login_check_cb, NULL);
+}
+
bool mmi_protocol_fzd_action_LINK(void)
{
+ mmi_protocol_fzd_login_check_start();
+
return mmi_protocol_fzd_send_without_data(MMI_FZD_ACTION_LINK);
}
bool mmi_protocol_fzd_parse_LINK(unsigned char * next_buff, unsigned int next_buff_len)
{
+ mmi_protocol_fzd_login_check_stop();
+
#ifdef __MMI_FZD_PROTOCOL_WITHOUT_PING_COMMAND_SUPPORT__
mmi_watch_action_after_bind();
static void * s_tcp_first_connect_timer_id = NULL;
static uint32_t s_tcp_first_connect_time = 0;
-void mmi_launcher_tcp_first_connect(uint32_t para)
+static void mmi_launcher_tcp_first_connect_check_cb(uint32_t para)
{
+ send_task_msg_tcp_wake_up();
+
if((FALSE == watch_modem_sim_present_check_req())
&& (MMI_TCP_FIRST_CONNECT_TIMEOUT <= s_tcp_first_connect_time)
)
{
printf("[@CHENG_DEBUG][%s][%d]: \n",__FUNCTION__,__LINE__);
- if(NULL == s_tcp_first_connect_timer_id)
+ if(true == mmi_poweron_logo_is_finish())
{
- uos_timer_create(&s_tcp_first_connect_timer_id);
+ s_tcp_first_connect_time += MMI_TCP_FIRST_CONNECT_TIME_INTERVAL;
}
- uos_timer_stop(s_tcp_first_connect_timer_id);
- uos_timer_start(s_tcp_first_connect_timer_id, MS_TO_TICKS(MMI_TCP_FIRST_CONNECT_TIME_INTERVAL), 0, mmi_launcher_tcp_first_connect, NULL);
- s_tcp_first_connect_time += MMI_TCP_FIRST_CONNECT_TIME_INTERVAL;
}
else
{
printf("[@CHENG_DEBUG][%s][%d]: \n",__FUNCTION__,__LINE__);
+ if(true != mmi_poweron_logo_is_finish())
+ {
+ printf("[@CHENG_DEBUG][%s][%d]: \n",__FUNCTION__,__LINE__);
+ return;
+ }
if(NULL != s_tcp_first_connect_timer_id)
{
uos_timer_stop(s_tcp_first_connect_timer_id);
}
}
+void mmi_launcher_tcp_first_connect_check_start(void)
+{
+ printf("[@CHENG_DEBUG][%s][%d]: \n",__FUNCTION__,__LINE__);
+
+ s_tcp_first_connect_time = 0;
+
+ if(NULL == s_tcp_first_connect_timer_id)
+ uos_timer_create(&s_tcp_first_connect_timer_id);
+ else
+ uos_timer_stop(s_tcp_first_connect_timer_id);
+
+ uos_timer_start(s_tcp_first_connect_timer_id,
+ MS_TO_TICKS(MMI_TCP_FIRST_CONNECT_TIME_INTERVAL),
+ MS_TO_TICKS(MMI_TCP_FIRST_CONNECT_TIME_INTERVAL),
+ mmi_launcher_tcp_first_connect_check_cb,
+ NULL);
+}
+
#ifdef __MMI_ZHSX_SUPPORT_AUTHENTICATE__
#define MMI_AUTHENTICATE_CONNECT_TIME_INTERVAL (1000 * 5) // ms
#define MMI_AUTHENTICATE_CONNECT_TIMEOUT (1000 * 60 * 3) // ms
send_task_msg_authenticate_action();
}
-void mmi_watch_authenticate_pre(uint32_t para)
+static void mmi_watch_authenticate_check_cb(uint32_t para)
{
+ send_task_msg_tcp_wake_up();
+
if((FALSE == watch_modem_sim_present_check_req())
&& (MMI_AUTHENTICATE_CONNECT_TIMEOUT <= s_authenticate_connect_time)
)
{
printf("[@CHENG_DEBUG][%s][%d]: \n",__FUNCTION__,__LINE__);
- if(NULL == s_authenticate_connect_timer_id)
+ if(true == mmi_poweron_logo_is_finish())
{
- uos_timer_create(&s_authenticate_connect_timer_id);
+ s_authenticate_connect_time += MMI_AUTHENTICATE_CONNECT_TIME_INTERVAL;
}
- uos_timer_stop(s_authenticate_connect_timer_id);
- uos_timer_start(s_authenticate_connect_timer_id, MS_TO_TICKS(MMI_AUTHENTICATE_CONNECT_TIME_INTERVAL), 0, mmi_watch_authenticate_pre, NULL);
- s_authenticate_connect_time += MMI_AUTHENTICATE_CONNECT_TIME_INTERVAL;
}
else
{
printf("[@CHENG_DEBUG][%s][%d]: \n",__FUNCTION__,__LINE__);
+ if(true != mmi_poweron_logo_is_finish())
+ {
+ printf("[@CHENG_DEBUG][%s][%d]: \n",__FUNCTION__,__LINE__);
+ return;
+ }
if(NULL != s_authenticate_connect_timer_id)
{
uos_timer_stop(s_authenticate_connect_timer_id);
}
}
}
+
+static void mmi_watch_authenticate_check_start(void)
+{
+ printf("[@CHENG_DEBUG][%s][%d]: \n",__FUNCTION__,__LINE__);
+
+ s_authenticate_connect_time = 0;
+
+ if(NULL == s_authenticate_connect_timer_id)
+ uos_timer_create(&s_authenticate_connect_timer_id);
+ else
+ uos_timer_stop(s_authenticate_connect_timer_id);
+
+ uos_timer_start(s_authenticate_connect_timer_id,
+ MS_TO_TICKS(MMI_AUTHENTICATE_CONNECT_TIME_INTERVAL),
+ MS_TO_TICKS(MMI_AUTHENTICATE_CONNECT_TIME_INTERVAL),
+ mmi_watch_authenticate_check_cb,
+ NULL);
+}
#endif
+void mmi_watch_tcp_wake_up_action(void)
+{
+ if(0 == Hal_Pm_Get_State())
+ {
+ Hal_Pm_WakeUp_No_Lcd();
+ }
+}
+
#endif
/**
#ifdef __MMI_ZHSX_SUPPORT_AUTHENTICATE__
if(0 == mmi_watch_authenticate_flag_get())
{
- mmi_watch_authenticate_pre(0);
+ mmi_watch_authenticate_check_start();
}
else
{
- mmi_launcher_tcp_first_connect(0);
+ mmi_launcher_tcp_first_connect_check_start();
}
#else
- mmi_launcher_tcp_first_connect(0);
+ mmi_launcher_tcp_first_connect_check_start();
#endif
#else
void send_tcp_cmdmsg(int cmd_type,void* cmd_param);
#ifdef __MMI_ZHSX_SUPPORT__
-void mmi_launcher_tcp_first_connect(uint32_t para);
+void mmi_launcher_tcp_first_connect_check_start(void);
+void mmi_watch_tcp_wake_up_action(void);
#endif
#ifdef __cplusplus
mmi_watch_authenticate_action();
break;
#endif
+
+ #ifdef __MMI_ZHSX_SUPPORT__
+ case MMI_MODEM_TCP_MSG_WAKE_UP:
+ mmi_watch_tcp_wake_up_action();
+ break;
+ #endif
default:
break;
}
#endif
+#ifdef __MMI_ZHSX_SUPPORT__
+void send_task_msg_tcp_wake_up(void)
+{
+ send_task_msg_tcp(MMI_MODEM_TCP_MSG_WAKE_UP, NULL);
+}
+#endif
/**
#ifdef __MMI_ZHSX_SUPPORT_AUTHENTICATE__
MMI_MODEM_TCP_MSG_AUTHENTICATE_ACTION,
#endif
+#ifdef __MMI_ZHSX_SUPPORT__
+ MMI_MODEM_TCP_MSG_WAKE_UP,
+#endif
MMI_MODEM_TCP_MSG_MAX,
MMI_MODEM_TCP_MSG_ID_END = MMI_MODEM_TCP_MSG_MAX,
#ifdef __MMI_ZHSX_SUPPORT_AUTHENTICATE__
void send_task_msg_authenticate_action(void);
#endif
+#ifdef __MMI_ZHSX_SUPPORT__
+void send_task_msg_tcp_wake_up(void);
+#endif
void send_task_msg_tcp_write_msg(int cmd_type, void* cmd_param);