gpio_count = gpio_count*1232/1208;//修正与逻辑分析仪的误差
temp1 = (gpio_count * 0.0625) - 50.0625;
- temp = (cant180_irq_count * 0.0625) - 50.0625;
+ temp = temp1; // (cant180_irq_count * 0.0625) - 50.0625;
printf("hal_acnt180_process_data2:cant*180_irq_count:%d gpio_count: %d temp:%f temp1:%f",cant180_irq_count,gpio_count,temp,temp1);
gpio_set_direction(GPIO16, GPIO_OUT);
}
float acnt180_get_body_temperature(void)
{
+ printf("[@CHENG_DEBUG][%s][%d]: %f\n", __FUNCTION__, __LINE__, temp);
+
return temp;
}
static void acnt180_IRQ_callback(void)
gpio_set_value(GPIO123, GPIO_LOW);
}
-#endif
\ No newline at end of file
+#endif
static void gh3018_hr_bp_bo_value_update(uint16_t hr, uint16_t bp_high, uint16_t bp_low, uint16_t bo)
{
+ printf("[@CHENG_DEBUG][%s][%d]: %d,%d,%d,%d\n", __FUNCTION__, __LINE__, hr, bp_high, bp_low, bo);
+
if(hr > 0) {
gh3018_hr_bp_bo_value.hr = hr;
}
lv_apps/lowbattery/lowbattery.c
lv_apps/sos/sos.c
lv_apps/search/search.c
- #lv_apps/qrcode/qrcode.c
+ lv_apps/qrcode/qrcode.c
#lv_apps/barcode/barcode.c
lv_apps/make_friends/make_friends.c
lv_apps/voice_msg/voice_msg.c
mmi_protocol/mmi_protocol_api.c
mmi_protocol/mmi_protocol_fzd.c
mmi_location/mmi_location.c
+ mmi_sundry/mmi_sundry.c
#wechat
lv_apps/wechat/wechat_ui.c
#primary menu data
#else
return;
#endif
+
+ printf("[@CHENG_DEBUG][%s][%d]: %d,%d,%d,%d\n", __FUNCTION__, __LINE__, *hr, *bp_high, *bp_low, *bo);
}
void asl_sport_hr_record_get(sport_hr_record_t * data)
"血氧",
"体温",
"℃", // WATCH_TEXT_ID_TEMPERATURE_UNIT
+ "App正在寻找此设备\n点击屏幕关闭提醒", // WATCH_TEXT_ID_SERVER_SEARCH_PROMPT
+ "设备二维码", // WATCH_TEXT_ID_DEVICE_QRCODE
//CHENG_MODIFY
"SPO2",
"Temperature",
"C", // WATCH_TEXT_ID_TEMPERATURE_UNIT ℃
+ "App is looking for this device\ntap the screen to turn off the reminder", // WATCH_TEXT_ID_SERVER_SEARCH_PROMPT
+ "Device qrcode", // WATCH_TEXT_ID_DEVICE_QRCODE
//CHENG_MODIFY
#ifdef __MMI_HEALTH_MEASURE_TEMPERATURE_SUPPORT__
ACT_ID_HEALTH_MEASURE_TEMPERATURE,
#endif
+ ACT_ID_WATCH_SEARCHING,
ACT_ID_MAX,
};
WATCH_TEXT_ID_SPO2, /* "血氧" "SPO2" */
WATCH_TEXT_ID_TEMPERATURE, /* "体温" "Temperature" */
WATCH_TEXT_ID_TEMPERATURE_UNIT, /* "℃" "℃" */
-
+ WATCH_TEXT_ID_SERVER_SEARCH_PROMPT, /* "App正在寻找此设备,点击屏幕关闭提醒" "App is looking for this device, tap the screen to turn off the reminder" */
+ WATCH_TEXT_ID_DEVICE_QRCODE, /* "设备二维码" "Device qrcode" */
//CHENG_MODIFY
void mmi_hsensor_close(void)
{
+ HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
asl_hr_bp_bo_measure_stop();
}
void mmi_hsensor_heart_open(void)
{
+ HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
asl_hr_measure_start(0);
}
void mmi_hsensor_blood_open(void)
{
+ HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
asl_hr_measure_start(0);
}
void mmi_hsensor_spo2_open(void)
{
+ HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
asl_bo_measure_start(0);
}
bool mmi_hsensor_is_open(void)
{
-
return true;
}
void mmi_tsensor_close(void)
{
+ HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
asl_temperature_measure_stop();
}
void mmi_tsensor_open(void)
{
+ HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
asl_temperature_measure_start();
}
bool mmi_tsensor_is_open(void)
{
-
return true;
}
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;
return true;
t_wrist_value = t_body_value - 10.0;
#endif
+ HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %f,%f\n", __FUNCTION__, __LINE__, t_body_value, t_wrist_value);
* body_value = t_body_value;
* wrist_value = t_wrist_value;
mmi_health_measure_interrupt();
return;
}
+
+ HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: total=%d,count=%d\n", __FUNCTION__, __LINE__, s_measure_time_total, s_measure_time_count);
s_measure_time_count++;
if(s_measure_time_total <= s_measure_time_count)
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__);
+
if(0 == time_duration)
{
switch(measure_type)
{
case MMI_HEALTH_MEASURE_HEART:
- s_measure_time_total = MMI_HEALTH_MEASURE_HEART_DURATION;
+ s_measure_time_total = MMI_HEALTH_MEASURE_HEART_DURATION / MMI_HEALTH_MEASURE_CYCLE_DURATION;
mmi_hsensor_heart_open();
break;
case MMI_HEALTH_MEASURE_TEMPERATURE:
- s_measure_time_total = MMI_HEALTH_MEASURE_TEMPERATURE_DURATION;
+ s_measure_time_total = MMI_HEALTH_MEASURE_TEMPERATURE_DURATION / MMI_HEALTH_MEASURE_CYCLE_DURATION;
mmi_tsensor_open();
break;
case MMI_HEALTH_MEASURE_BLOOD:
- s_measure_time_total = MMI_HEALTH_MEASURE_BLOOD_DURATION;
+ s_measure_time_total = MMI_HEALTH_MEASURE_BLOOD_DURATION / MMI_HEALTH_MEASURE_CYCLE_DURATION;
mmi_hsensor_blood_open();
break;
case MMI_HEALTH_MEASURE_SPO2:
- s_measure_time_total = MMI_HEALTH_MEASURE_SPO2_DURATION;
+ s_measure_time_total = MMI_HEALTH_MEASURE_SPO2_DURATION / MMI_HEALTH_MEASURE_CYCLE_DURATION;
mmi_hsensor_spo2_open();
break;
}
else
{
- s_measure_time_total = time_duration;
+ s_measure_time_total = time_duration / MMI_HEALTH_MEASURE_CYCLE_DURATION;
}
s_health_measure_run_data.measure_type = measure_type;
s_measure_time_count = 0;
- s_process_timer_id = Hal_Timer_Start(1000 * 1, mmi_health_measure_process_timer_handle, NULL, true);
+ s_process_timer_id = Hal_Timer_Start(MMI_HEALTH_MEASURE_CYCLE_DURATION, mmi_health_measure_process_timer_handle, NULL, true);
}
void mmi_health_measure_timed_measure_start(MMI_HEALTH_MEASURE_TYPE_E measure_type)
void mmi_health_measure_app_measure_start(MMI_HEALTH_MEASURE_TYPE_E measure_type)
{
+ HEALTH_MEASURE_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
if(MMI_HEALTH_MEASURE_STATE_UI == s_health_measure_run_data.measure_state)
{
return;
#define MMI_HEALTH_MEASURE_BLOOD_DURATION (34 * 1000) // ms
#define MMI_HEALTH_MEASURE_SPO2_DURATION (34 * 1000) // ms
+#define MMI_HEALTH_MEASURE_CYCLE_DURATION (1 * 1000) // ms
typedef enum
lv_label_set_long_mode(label, LV_LABEL_LONG_SROLL);
lv_obj_set_width(label, lv_obj_get_width(content) - 10);
char txt[NV_CONTACTS_MAX_NAME_LEN + NV_CONTACTS_MAX_NUMBER_LEN] = {};
+#if 1
+ if(LV_BIDI_DIR_RTL == bidi_dir)
+ lv_obj_set_base_dir(label, LV_BIDI_DIR_LTR);
+
+ if(strlen(call_params.name) > 0)
+ strcpy(txt, call_params.name);
+ else
+ strcpy(txt, call_params.number);
+
+#else
if(LV_BIDI_DIR_RTL == bidi_dir) {
lv_obj_set_base_dir(label, LV_BIDI_DIR_LTR);
strcat(txt, call_params.number);
}
strcat(txt, call_params.number);
}
+#endif
lv_label_set_text(label, txt);
lv_obj_t * cont = phone_cont_create(content, LV_LAYOUT_OFF, &lv_watch_style_transp, lv_obj_get_width(content) - 40);
lv_obj_set_click(content, false);
lv_obj_align(content, par, LV_ALIGN_CENTER, 0, -20);
+#ifdef __MMI_ZHSX_SUPPORT__
+
+ char imei[16] = {0};
+ app_adp_get_imei_req(imei);
+
+ lv_obj_t * qrcode = qrcode_gen(content, imei, 0, 0, QRCODE_WIDTH);
+ lv_obj_align(qrcode, content, LV_ALIGN_CENTER, 0, 0);
+
+ lv_obj_t * label = lv_label_create(par, NULL);
+ lv_obj_add_style(label, LV_OBJ_PART_MAIN, &lv_watch_font20);
+ lv_label_set_text(label, imei);
+ lv_obj_set_click(label, false);
+ lv_obj_align(label, content, LV_ALIGN_OUT_BOTTOM_MID, 0, 6);
+
+#else
/*cid.txt read from nvm*/
char * cid = app_adaptor_get_cid_for_qrcode();
lv_obj_t * qrcode = qrcode_gen(content, cid, 0, 0, QRCODE_WIDTH);
lv_label_set_text(label, cid);
lv_obj_set_click(label, false);
lv_obj_align(label, content, LV_ALIGN_OUT_BOTTOM_MID, 0, 6);
+#endif
+
return content;
}
{ ICON_SETTING_VOLUME, WATCH_TEXT_ID_VOLUME_ADJUST, setting_volume_create_btn_action },
{ ICON_SETTING_BRIGHTNESS, WATCH_TEXT_ID_BRIGHTNESS_ADJUST, setting_brightness_create_btn_action },
{ ICON_SETTING_DATETIME, WATCH_TEXT_ID_DATE_AND_TIME, setting_date_time_create_btn_action},
- { ICON_SETTING_LANGUAGE, WATCH_TEXT_ID_LANGUAGE_SWITCH, language_create_btn_action },
+ //{ ICON_SETTING_LANGUAGE, WATCH_TEXT_ID_LANGUAGE_SWITCH, language_create_btn_action },
#if USE_LV_WATCH_VOLTE_SWTICH != 0
{ ICON_SETTING_VOLTE, WATCH_TEXT_ID_VOLTE, volte_switch_create_btn_action },
#endif
#endif
{ ICON_SETTING_ABOUT, WATCH_TEXT_ID_ABOUT_WATCH, setting_about_create_btn_action },
#if USE_LV_WATCH_QRCODE != 0
- { ICON_SETTING_QRCODE, WATCH_TEXT_ID_CREATE_QRCODE, qrcode_create_event_cb },
+ //{ ICON_SETTING_QRCODE, WATCH_TEXT_ID_CREATE_QRCODE, qrcode_create_event_cb },
+ { ICON_SETTING_QRCODE, WATCH_TEXT_ID_DEVICE_QRCODE, qrcode_create_event_cb },
#endif
//{ &icon_setting_time_zone, WATCH_TEXT_ID_TIME_ZONE, btn_action },
//{ &icon_setting_add_friends, WATCH_TEXT_ID_ADD_FRIEND_ADJUST, btn_action },
{ ICON_SETTING_DUAL_SIM, WATCH_TEXT_ID_DUAL_SIM, dualsim_create_btn_action },
#endif
#if USE_LV_WATCH_MOBILE_NETWORK != 0
- { ICON_SETTING_MOBILE_NETWORK, WATCH_TEXT_ID_MOBILE_NETWORK, mobile_network_create_btn_action },
+ //{ ICON_SETTING_MOBILE_NETWORK, WATCH_TEXT_ID_MOBILE_NETWORK, mobile_network_create_btn_action },
#endif
/**only for craneg A1**/
#if defined(USE_LV_VAD) && (USE_LV_VAD > 0)
checksim_task_p = NULL;
#endif
+ printf("shutdown start1\n");
if(NULL != btn) {
lv_obj_clean(lv_obj_get_parent(btn));
}
#if USE_POWER_OFF_GIF
shutdown_music();
+ printf("shutdown start2\n");
lv_obj_t * activity_obj = NULL;
lv_watch_activity_ext_t activity_ext;
memset(&activity_ext, 0, sizeof(lv_watch_activity_ext_t));
LV_ASSERT_MEM(activity_obj);
if(activity_obj == NULL) return;
+ printf("shutdown start3\n");
gif_info_t * gif_info = gif_open(activity_obj, ANIM_POWER_OFF, 1);
if(!gif_info) {
printf("shutdown gif failed.\n");
return;
}
+ printf("shutdown start4\n");
shutdown_task_p = lv_task_create(shutdown_task, 100, LV_TASK_PRIO_MID, (void *)gif_info);
#else
printf("shutdown without power off gif.\n");
#ifdef __MMI_ZHSX_SUPPORT__
void mmi_watch_power_off(void)
{
- if(WATCH_SHUTDOWN_UNPERFORMED == shutdown_performance_flg) {
- shutdown_performance_flg = WATCH_SHUTDOWN_PERFORMING;
- printf("shutdown start\n");
- } else {
- printf("shutdown has been performed\n");
- return;
- }
-
- lv_task_del(lowbattery_task_p);
- lowbattery_task_p = NULL;
-#if USE_LV_WATCH_SIMCHECK
- lv_task_del(checksim_task_p);
- checksim_task_p = NULL;
-#endif
-
- lv_watch_go_home();
-#if USE_LV_BLUETOOTH != 0
- bt_power_off();
-#endif
- dial_poweroff();
- watch_set_ready_state(false);
- watch_set_suspend_enable(false, ACT_ID_SHUTDOWN, 0);
-#if USE_POWER_OFF_GIF
- shutdown_music();
-
- lv_obj_t * activity_obj = NULL;
- lv_watch_activity_ext_t activity_ext;
- memset(&activity_ext, 0, sizeof(lv_watch_activity_ext_t));
- activity_ext.actId = ACT_ID_ANYOBJ;
- activity_obj = lv_watch_creat_activity_obj(&activity_ext);
- LV_ASSERT_MEM(activity_obj);
- if(activity_obj == NULL) return;
-
- gif_info_t * gif_info = gif_open(activity_obj, ANIM_POWER_OFF, 1);
- if(!gif_info) {
- printf("shutdown gif failed.\n");
- return;
- }
- shutdown_task_p = lv_task_create(shutdown_task, 100, LV_TASK_PRIO_MID, (void *)gif_info);
-#else
- printf("shutdown without power off gif.\n");
- Hal_Backlight_Off();
- lv_task_del(lowbattery_task_p);
- Hal_Power_Off(HAL_TYPE_POWER_OFF);
-#endif
+ shutdown_confirm_btn_action(NULL, LV_EVENT_CLICKED);
}
#endif
#include "mmi_location/mmi_location.h"
#include "mmi_protocol/mmi_protocol_api.h"
#include "mmi_protocol/mmi_protocol_fzd.h"
+#include "mmi_sundry/mmi_sundry.h"
#ifdef __MMI_WECHAT_SUPPORT__
#include "lv_apps/wechat/wechat.h"
#endif
uint32_t watch_indev_get_inactive_time(const lv_indev_t * indev);
void watch_suspend_by_key(void);
void watch_suspend_by_ui(void);
-void qrcode_create_event_cb(lv_obj_t * btn, lv_event_t event);
+
void watch_set_pintype(MMI_MODEM_PIN_STATUS_TYPE pinreqtype);
MMI_MODEM_PIN_STATUS_TYPE watch_get_pintype(void);
void watch_wakeup_lcd(bool always);
#define ICON_COMMON_BG_WHITE "R:/png/common/ICON_COMMON_BG_WHITE.png"
#define ICON_COMMON_SUCCESS "R:/png/common/ICON_COMMON_SUCCESS.png"
-#endif
// wechat
#ifdef __MMI_WECHAT_SUPPORT__
//#define ICON_TEMPERATURE_MEASURE_BG "R:/png/health_measure/icon_temperature_measure_bg.png"
#endif
+#define AUDIO_WATCH_SEARCH "R:/audio/audio_watch_search.mp3"
+
+//#define ICON_CALL_OUTGOING "R:/png/call/icon_heart_rate_measure_done.png"
+//#define ICON_CALL_INCOMING "R:/png/call/icon_heart_rate_measure_fail.png"
+//#define ICON_CALL_CONNECTING "R:/png/call/icon_heart_rate_measure_fail.png"
+
+#endif
//font
{
MMI_WATCH_LOCATION_TYPE_E * node = _lv_ll_get_head(&s_watch_location_mission_ll);
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: %d\n", __FUNCTION__, __LINE__, (NULL != node) ? 1 : 0);
+
while(NULL != node)
{
if(location_type == * node)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
return ; // exist
}
node = _lv_ll_get_next(&s_watch_location_mission_ll, node);
}
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
MMI_WATCH_LOCATION_TYPE_E * new_node = _lv_ll_ins_head(&s_watch_location_mission_ll);
* new_node = location_type;
}
void mmi_watch_location_mission_list_data_send(void)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
if(true == _lv_ll_is_empty(&s_watch_location_mission_ll))
return;
MMI_WATCH_LOCATION_TYPE_E * node = _lv_ll_get_tail(&s_watch_location_mission_ll);
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
while(NULL != node)
{
switch(* node)
{
case MMI_WATCH_LOCATION_UD:
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
mmi_protocol_action_send_location(&s_watch_location_data);
break;
case MMI_WATCH_LOCATION_CRUD:
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
mmi_protocol_action_send_cur_location(&s_watch_location_data);
break;
case MMI_WATCH_LOCATION_WT:
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
mmi_protocol_action_send_get_weather(&s_watch_location_data);
break;
{
if(NULL != param)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
double gpsLon = 0, gpsLat = 0;
gpsNmeaDataT * gpsNmeaData = (gpsNmeaDataT * )param;
void mmi_watch_location_gps_stop(void)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
gps_request_locate_stop();
}
void mmi_watch_location_gps_start(void)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
s_watch_location_gps_state = MMI_WATCH_LOCATION_STATE_PROCESS;
gps_request_locate_start(mmi_watch_location_gps_finsh_cb);
void mmi_watch_location_cell_stop(void)
{
-
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
}
void mmi_watch_location_lte_cell_info_ind(app_adp_lte_cells_t *cell_list)
void mmi_watch_location_cell_start(void)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
s_watch_location_cell_state = MMI_WATCH_LOCATION_STATE_PROCESS;
app_adaptor_lte_cell_info_ind_bind(mmi_watch_location_lte_cell_info_ind);
void mmi_watch_location_wifi_stop(void)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
wifi_scan_destroy();
}
//if(WIFI_SCAN_MSG_COMPLETE == msgid)
if(0 != wifi_info->HotspotNum)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
s_watch_location_wifi_state = MMI_WATCH_LOCATION_STATE_SUCCESS;
s_watch_location_data.wifi_data.count = wifi_info->HotspotNum;
void mmi_watch_location_wifi_start(void)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
s_watch_location_wifi_state = MMI_WATCH_LOCATION_STATE_PROCESS;
wifi_scan_init();
void mmi_watch_location_mission_stop(void)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
s_watch_location_state = 0;
if(NULL != s_watch_location_timer_id)
{
void mmi_watch_location_mission_timer_cb(void * para)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: total=%d,count=%d\n", __FUNCTION__, __LINE__, MMI_WATCH_LOCATION_CHECK_TIMES_COUNT_MAX, s_watch_location_times_check_count);
+
s_watch_location_times_check_count++;
if(MMI_WATCH_LOCATION_CHECK_TIMES_COUNT_MAX <= s_watch_location_times_check_count)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
mmi_watch_location_mission_list_data_send();
mmi_watch_location_mission_stop();
}
else
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
if(MMI_WATCH_LOCATION_STATE_SUCCESS == s_watch_location_cell_state
- &&MMI_WATCH_LOCATION_STATE_SUCCESS == s_watch_location_gps_state
+ && MMI_WATCH_LOCATION_STATE_SUCCESS == s_watch_location_gps_state
)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
mmi_watch_location_mission_list_data_send();
mmi_watch_location_mission_stop();
}
void mmi_watch_location_mission_start(void)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
if(0 == s_watch_location_state)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
s_watch_location_state = 1;
_lv_memset_00(&s_watch_location_data, sizeof(MMI_WATCH_LOCATION_DATA_T));
s_watch_location_times_check_count = 0;
void mmi_watch_location_mission_timed_location_action(void)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
mmi_watch_location_mission_list_node_add(MMI_WATCH_LOCATION_UD);
mmi_watch_location_mission_start();
}
void mmi_watch_location_mission_current_location_action(void)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
mmi_watch_location_mission_list_node_add(MMI_WATCH_LOCATION_CRUD);
mmi_watch_location_mission_start();
}
void mmi_watch_location_mission_get_weather_action(void)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
mmi_watch_location_mission_list_node_add(MMI_WATCH_LOCATION_WT);
mmi_watch_location_mission_start();
}
#define LOCATION_MIN(a, b) (((a) > (b)) ? (b) : (a))
#define MMI_WATCH_LOCATION_PROCESS_DURATION (1000 * 10) // ms
-#define MMI_WATCH_LOCATION_CHECK_TIMES_COUNT_MAX (4) // 4000 ms
+#define MMI_WATCH_LOCATION_CHECK_TIMES_COUNT_MAX (4) // 40000 ms
typedef enum
return mmi_protocol_fzd_action_link();
}
-bool mmi_protocol_action_bind(void)
-{
- return mmi_protocol_fzd_action_bind();
-}
-
bool mmi_protocol_check_state_before_send_action(void)
{
if((false == watch_modem_sim_present_check_req())
void mmi_protocol_watch_heartbeat_stop(void);
void mmi_protocol_watch_heartbeat_action(void);
-bool mmi_protocol_action_bind(void);
-
bool mmi_protocol_action_link(void);
bool mmi_protocol_action_send_temperature(float temp_value);
{
PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: ptr=0x%x\n", __FUNCTION__, __LINE__, s_send_space_struct[action].ptr);
lv_mem_free(s_send_space_struct[action].ptr);
+ s_send_space_struct[action].ptr = NULL;
s_send_space_struct[action].size = 0;
}
}
bool result = false;
unsigned char * temp_ptr = NULL;
- PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: receive_ptr=0x%x\n", __FUNCTION__, __LINE__, s_receive_space_struct.receive_ptr);
+ //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: receive_ptr=0x%x\n", __FUNCTION__, __LINE__, s_receive_space_struct.receive_ptr);
if(NULL == recv_buffer || 0 == recv_len)
{
}
else if(NULL != s_receive_space_struct.incomplete_ptr && 0 != s_receive_space_struct.incomplete_len)
{
- PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: incomplete buffer is not null\n", __FUNCTION__, __LINE__);
+ //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: incomplete buffer is not null\n", __FUNCTION__, __LINE__);
temp_ptr = lv_mem_alloc(recv_len + s_receive_space_struct.incomplete_len);
if (NULL != temp_ptr)
}
else
{
- PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: incomplete buffer is null\n", __FUNCTION__, __LINE__);
+ //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: incomplete buffer is null\n", __FUNCTION__, __LINE__);
temp_ptr = lv_mem_alloc(recv_len);
if (NULL != temp_ptr)
int offset_head_bracket = 0, offset_device_name = 0, offset_first_sep = 0, offset_device_id = 0,
offset_second_sep = 0, offset_content_len = 0, offset_third_sep = 0, offset_tail_bracket = 0;
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%d]: len=%d, buff=%s\n", __LINE__, recv_len, recv_buffer);
//check
#endif
"WT", //MMI_FZD_ACTION_GET_WEATHER
+ "SOS", //MMI_FZD_SERVER_SET_SOS_NUMBER
+ "CENTER", //MMI_FZD_SERVER_SET_CENTER_NUMBER
mmi_protocol_fzd_parse_ACTION_GET_WEATHER(next_buff, next_buff_len);
break;
+ case MMI_FZD_SERVER_SET_SOS_NUMBER:
+ mmi_protocol_fzd_parse_SERVER_SET_SOS_NUMBER(next_buff, next_buff_len);
+ break;
+
+ case MMI_FZD_SERVER_SET_CENTER_NUMBER:
+ mmi_protocol_fzd_parse_SERVER_SET_CENTER_NUMBER(next_buff, next_buff_len);
+ break;
+
default:
result = true;
mmi_protocol_fzd_respond_without_data(action);
uos_sleep(30);
+ app_adaptor_wake_up_short_time();
mmi_watch_power_off();
return result;
result = true;
mmi_protocol_fzd_respond_without_data(action);
- //////////
- //////////
- //////////
- //function
- //////////
- //////////
- //////////
- //mmi_watch_server_find_screen_create();
+ mmi_watch_server_search_screen_create(NULL);
return result;
}
return result;
}
-
-
-
-
-
-
-
-#if 0
-signed char* km_strcpy(char* des,const char* source)
+bool mmi_protocol_fzd_parse_SERVER_SET_SOS_NUMBER(unsigned char * next_buff, unsigned int next_buff_len)
{
- signed char* r=des;
-
- if (source == NULL)
- {
-
- if (des)
- {
- *(des) = '\0';
- }
-
- return r;
- }
-
- if (source == NULL || des == NULL)
- {
- return NULL;
- }
-
- while((*des++ = *source++)!='\0');
-
- return r;
-
-}
+ bool result = false;
+ MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_SERVER_SET_SOS_NUMBER;
-void km_FZD_filename_delete_invalid_symbol(signed char *nameout,signed char *filename)
-{
- int i=0;
- int j=0;
-
- if(nameout==NULL||filename==NULL)
- {
- return;
- }
-
- for(i=0;i<strlen(filename);i++)
+ if(NULL == next_buff || 0 == next_buff_len)
{
- if(!( filename[i]==':' || filename[i]=='\\'|| filename[i]=='/'|| filename[i]=='*'
- || filename[i]=='?'|| filename[i]=='"'|| filename[i]=='<'|| filename[i]=='>'|| filename[i]=='|'))
- {
- nameout[j]= filename[i];
- j++;
- }
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ return false;
}
-
- KM_FZD_TRACE_INFO("%s",nameout);
-}
-/*****************************************************************************
- * FUNCTION
- * applib_dt_decrease_time
- * DESCRIPTION
- * Decrease a reference time by some time
- * PARAMETERS
- * timeToDecrement [IN] Time to be decreased
- * decrement [IN] Time to decrease
- * Result [IN/OUT] Result of compuatation
- * RETURNS
- * void
- *****************************************************************************/
-void applib_dt_decrease_time(
- applib_time_struct *timeToDecrement,
- applib_time_struct *decrement,
- applib_time_struct *Result)
-{
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- applib_time_struct decrement_local;
- applib_time_struct *decrement_local_ptr = &decrement_local;
-
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(&decrement_local, 0x00, sizeof(applib_time_struct));
- memcpy(&decrement_local, decrement, sizeof(applib_time_struct));
-
- if (decrement_local_ptr->nSec != 0)
- {
- if (timeToDecrement->nSec >= decrement_local_ptr->nSec)
- {
- Result->nSec = timeToDecrement->nSec - decrement_local_ptr->nSec;
- }
- else
- {
- Result->nSec = DT_MIN_PER_HR + timeToDecrement->nSec - decrement_local_ptr->nSec;
- decrement_local_ptr->nMin++;
- }
- }
- else
- {
- Result->nSec = timeToDecrement->nSec;
- }
-
- if (decrement_local_ptr->nMin != 0)
- {
- if (timeToDecrement->nMin >= decrement_local_ptr->nMin)
- {
- Result->nMin = timeToDecrement->nMin - decrement_local_ptr->nMin;
- }
- else
- {
- Result->nMin = DT_MIN_PER_HR + timeToDecrement->nMin - decrement_local_ptr->nMin;
- decrement_local_ptr->nHour++;
- }
- }
- else
- {
- Result->nMin = timeToDecrement->nMin;
- }
-
- if (decrement_local_ptr->nHour != 0)
- {
- if (timeToDecrement->nHour >= decrement_local_ptr->nHour)
- {
- Result->nHour = timeToDecrement->nHour - decrement_local_ptr->nHour;
- }
- else
- {
- Result->nHour = DT_HRS_PRE_DAY + timeToDecrement->nHour - decrement_local_ptr->nHour;
- decrement_local_ptr->nDay++;
- }
- }
- else
- {
- Result->nHour = timeToDecrement->nHour;
- }
-
- if (decrement_local_ptr->nDay != 0)
- {
- if (timeToDecrement->nDay > decrement_local_ptr->nDay)
- {
- Result->nDay = timeToDecrement->nDay - decrement_local_ptr->nDay;
- }
- else
- {
- decrement_local_ptr->nMonth++;
- if (timeToDecrement->nMonth != 1)
- {
- Result->nDay = applib_dt_last_day_of_mon(
- (kal_uint8) (timeToDecrement->nMonth - 1),
- timeToDecrement->nYear) + timeToDecrement->nDay - decrement_local_ptr->nDay;
- }
- else
- {
- Result->nDay = 31 + timeToDecrement->nDay - decrement_local_ptr->nDay;
- }
- }
- }
- else
- {
- Result->nDay = timeToDecrement->nDay;
- }
-
- if (decrement_local_ptr->nMonth != 0)
- {
- if (timeToDecrement->nMonth > decrement_local_ptr->nMonth)
- {
- Result->nMonth = timeToDecrement->nMonth - decrement_local_ptr->nMonth;
- }
- else
- {
- Result->nMonth = DT_MONTH_PER_YEAR + timeToDecrement->nMonth - decrement_local_ptr->nMonth;
- decrement_local_ptr->nYear++;
- }
- }
- else
- {
- Result->nMonth = timeToDecrement->nMonth;
- }
-
- Result->nYear = timeToDecrement->nYear - decrement_local_ptr->nYear;
-
- Result->DayIndex = applib_dt_dow(Result->nYear, Result->nMonth, Result->nDay);
-
-}
-/*****************************************************************************
- * FUNCTION
- * applib_dt_increase_time
- * DESCRIPTION
- * Increase a reference time by some time
- * PARAMETERS
- * timeToIncrement [IN] Time to be increased
- * increment [?]
- * Result [?]
- * decrement(?) [IN] Time to increase
- * RETURNS
- * result of computation(?)
- *****************************************************************************/
-void applib_dt_increase_time(
- applib_time_struct *timeToIncrement,
- applib_time_struct *increment,
- applib_time_struct *Result)
-{
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- kal_int16 NumOfDays;
-
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* second */
- Result->nSec = (timeToIncrement->nSec + increment->nSec);
-
- /* minute */
- Result->nMin = (timeToIncrement->nMin + increment->nMin);
- if (Result->nSec >= DT_MIN_PER_HR)
- {
- Result->nSec -= DT_MIN_PER_HR;
- Result->nMin += 1;
- }
-
- /* hour */
- Result->nHour = (timeToIncrement->nHour + increment->nHour);
- if (Result->nMin >= DT_MIN_PER_HR)
- {
- Result->nMin -= DT_MIN_PER_HR;
- Result->nHour += 1;
- }
-
- /* day */
- Result->nDay = (timeToIncrement->nDay + increment->nDay);
- if (Result->nHour >= DT_HRS_PRE_DAY)
- {
- Result->nHour -= DT_HRS_PRE_DAY;
- Result->nDay += +1;
- }
-
- /* month, year */
- Result->nMonth = timeToIncrement->nMonth + increment->nMonth;
- Result->nYear = timeToIncrement->nYear + increment->nYear;
-
- if (Result->nMonth > DT_MONTH_PER_YEAR)
- {
- Result->nMonth -= DT_MONTH_PER_YEAR;
- Result->nYear++;
- }
-
- /* correct day */
- NumOfDays = applib_dt_last_day_of_mon(timeToIncrement->nMonth, timeToIncrement->nYear);
-
- if (Result->nDay > NumOfDays)
- {
- Result->nDay -= NumOfDays;
- if (Result->nMonth != 12)
- {
- Result->nMonth += 1;
- }
- else
- {
- Result->nMonth = 1;
- Result->nYear += 1;
- }
- }
+ result = true;
+ mmi_protocol_fzd_respond_without_data(action);
- Result->DayIndex = applib_dt_dow(Result->nYear, Result->nMonth, Result->nDay);
-}
+ //////////
+ //////////
+ //////////
+ //function
+ //////////
+ //////////
+ //////////
-static int km_FZD_net_parse_TK(signed char *next_buf,int next_buf_len,signed char seq)
-{
- signed char send_temp[20] = {0};
- signed int content_lenth = 0;
- uint16 record_id = 0;
-
- if(next_buf_len == 1)
- {
- //SG*5678901234*0004*TK,1
- //this is rsp.
- unsigned char send_result = (*next_buf == '1')?1:0;
- MMIAPI_SetSendWechatContentResult(send_result);
- }
- else
- {
- #if defined(MMI_C51_NO_LCD_DISPLAY_SUPPORT)
- sprintf(send_temp, ",%d", record_id);
- content_lenth = strlen(send_temp);
- km_FZD_net_construct_and_do_rsp(KM_FZD_NET_PT_ACTION_TK, send_temp, content_lenth, seq);
-
- #else
- //SG*5678901234*0256*TK,data
- //convert send buff to TK buff.
- next_buf_len = km_FZD_net_untextdata_decrypt((unsigned char *)next_buf, (unsigned int)next_buf_len);
- record_id = MMIAPI_SaveWechatAudioData(next_buf, next_buf_len, PNULL);
-
- //send rsp.
- sprintf(send_temp, ",%d", (0xFFFF != record_id));
- content_lenth = strlen(send_temp);
- km_FZD_net_construct_and_do_rsp(KM_FZD_NET_PT_ACTION_TK, send_temp, content_lenth, seq);
-
- if(FALSE == km_FZD_currtime_is_in_dnd_cfg())
- {
- #if defined(DRV_RGB_LED_SUPPORT)
- MMIAPI_SetRgbledEvent(RGBLED_PRIORITY_WECHAT_NEW_MSG, TRUE);
- #endif
- #if defined(MMI_D10_NO_LCD_DISPLAY_SUPPORT)
- MMIAPI_PlayNewVoice();
- MMIAPI_StartWechatMsgNoReadTimer();
- #else
- MMIAPI_PlayWechatNewMsgRing();
- #endif
- }
- #endif
- }
-}
-static int km_FZD_net_parse_TKOne(signed char *next_buf,int next_buf_len,signed char seq)
-{
- //Todolist
- KM_TRACE_INFO("km_FZD_net_parse_TKOne: is need parse !");
-
- if(FALSE == km_FZD_currtime_is_in_dnd_cfg())
- {
- #if !defined(MMI_C51_NO_LCD_DISPLAY_SUPPORT)
- #if defined(MMI_D10_NO_LCD_DISPLAY_SUPPORT)
- MMIAPI_PlayNewVoice();
- MMIAPI_StartWechatMsgNoReadTimer();
- #else
- MMIAPI_PlayWechatNewMsgRing();
- #endif
- #endif
- }
-}
-static int km_FZD_net_parse_TKIMG(signed char *next_buf,int next_buf_len,signed char seq)
-{
- signed char send_temp[20] = {0};
- signed int content_lenth = 0;
- uint16 record_id = 0;
-
- KM_TRACE_INFO("km_FZD_net_parse_TKIMG: next_buf_len = %d, next_buf = %s !", next_buf_len, next_buf);
-
- if(next_buf_len == 1)
- {
- //SG*5678901234*0004*TKIMG,1
- //this is rsp.
- unsigned char send_result = (*next_buf == '1')?1:0;
- MMIAPI_SetSendWechatContentResult(send_result);
- }
- else
- {
- #if defined(MMI_C51_NO_LCD_DISPLAY_SUPPORT)
- sprintf(send_temp, ",%d", record_id);
- content_lenth = strlen(send_temp);
- km_FZD_net_construct_and_do_rsp(KM_FZD_NET_PT_ACTION_TKIMG, send_temp, content_lenth, seq);
-
- #else
- //SG*5678901234*0256*TKIMG,data
- //convert send buff to TKIMG buff.
- next_buf_len = km_FZD_net_untextdata_decrypt((unsigned char *)next_buf, (unsigned int)next_buf_len);
- record_id = MMIAPI_SaveWechatImageData(next_buf, next_buf_len, PNULL);
-
- //send rsp.
- sprintf(send_temp, ",%d", (0xFFFF != record_id));
- content_lenth = strlen(send_temp);
- km_FZD_net_construct_and_do_rsp(KM_FZD_NET_PT_ACTION_TKIMG, send_temp, content_lenth, seq);
-
- if(FALSE == km_FZD_currtime_is_in_dnd_cfg())
- {
- #if defined(MMI_D10_NO_LCD_DISPLAY_SUPPORT)
- MMIAPI_PlayNewVoice();
- MMIAPI_StartWechatMsgNoReadTimer();
- #else
- MMIAPI_PlayWechatNewMsgRing();
- #endif
- }
- #endif
- }
+ return result;
}
-void ic_fzd_net_parse_wt(signed char *next_buf,int next_buf_len,signed char seq)
+bool mmi_protocol_fzd_parse_SERVER_SET_CENTER_NUMBER(unsigned char * next_buff, unsigned int next_buff_len)
{
- //[XT*334588000000156*009F*WT,Äê-ÔÂ-ÈÕ,ʱ:·Ö:Ãë,ÌìÆøÃèÊö,ÌìÆø±àºÅ,µ±Ç°Î¶È,×îµÍÎÂ,×î¸ß ÎÂ,³ÇÊÐÃû]
- signed char *phead = NULL;
- signed char *ptail = NULL;
- signed char *p1 = NULL;
- signed char *p2 = NULL;
- WEATHER_NVRAM_STRUCT fzd_weather = {0};
- signed char len = 0;
- unsigned char i = 0;
-
- if ((NULL == next_buf) || (next_buf_len <= 0))
- {
- KM_FZD_TRACE_ERROR("parameter error!");
- return ;
- }
-
- KM_FZD_TRACE_INFO("WT: (%s)(%d)", next_buf, next_buf_len);
-
- phead = ptail = next_buf;
-
- //parse date
- if (ptail = strstr(phead, ","))
- {
- *(ptail++) = '\0';
-
- //year
- p2 = p1 = phead;
- if (p2 = strstr(p1, "-"))
- {
- *(p2++) = '\0';
- fzd_weather.weather_desc[0].time.nYear = atoi(p1);
- }
-
- //month
- p1 = p2;
- if (p2 = strstr(p1, "-"))
- {
- *(p2++) = '\0';
- fzd_weather.weather_desc[0].time.nMonth = atoi(p1);
- }
-
- //day
- p1 = p2;
- fzd_weather.weather_desc[0].time.nDay = atoi(p1);
- }
-
- //parse time
- phead = ptail;
- if (ptail = strstr(phead, ","))
- {
- *(ptail++) = '\0';
-
- //hour
- p2 = p1 = phead;
- if (p2 = strstr(p1, ":"))
- {
- *(p2++) = '\0';
- fzd_weather.weather_desc[0].time.nHour = atoi(p1);
- }
-
- //min
- p1 = p2;
- if (p2 = strstr(p1, ":"))
- {
- *(p2++) = '\0';
- fzd_weather.weather_desc[0].time.nMin = atoi(p1);
- }
-
- //sec
- p1 = p2;
- fzd_weather.weather_desc[0].time.nSec = atoi(p1);
- }
-
- //parse weather decription
- phead = ptail;
- if (ptail = strstr(phead, ","))
- {
- *(ptail++) = '\0';
- }
-
- //parse weather num
- phead = ptail;
- if (ptail = strstr(phead, ","))
- {
- *(ptail++) = '\0';
- fzd_weather.weather_desc[0].weater_No = atoi(phead);
- }
-
- //parse current temperature
- phead = ptail;
- if (ptail = strstr(phead, ","))
- {
- uint8 is_negative = 0;
- if(*phead == '-')
- {
- is_negative = 1;
- phead++;
- }
-
- *(ptail++) = '\0';
- fzd_weather.weather_desc[0].curr_temperature = is_negative ? (0 - atoi(phead)) : atoi(phead);
- }
-
- //parse min temperature
- phead = ptail;
- if (ptail = strstr(phead, ","))
- {
- uint8 is_negative = 0;
- if(*phead == '-')
- {
- is_negative = 1;
- phead++;
- }
-
- *(ptail++) = '\0';
- fzd_weather.weather_desc[0].min_temperature = is_negative ? (0 - atoi(phead)) : atoi(phead);
- }
+ bool result = false;
+ MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_SERVER_SET_CENTER_NUMBER;
- //parse max temperature
- phead = ptail;
- if (ptail = strstr(phead, ","))
+ if(NULL == next_buff || 0 == next_buff_len)
{
- uint8 is_negative = 0;
- if(*phead == '-')
- {
- is_negative = 1;
- phead++;
- }
-
- *(ptail++) = '\0';
- fzd_weather.weather_desc[0].max_temperature = is_negative ? (0 - atoi(phead)) : atoi(phead);
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ return false;
}
- //parse city
- phead = ptail;
- len = strlen(phead);
- for(i = 0; i*4 < len; i++){
- fzd_weather.city_name[i] = km_str_hex_string_to_number(phead+i*4,4);
- KM_FZD_TRACE_INFO("fzd_weather.city_name[%d]:%04x", i, fzd_weather.city_name[i]);
- }
+ result = true;
+ mmi_protocol_fzd_respond_without_data(action);
- KM_FZD_TRACE_INFO("{\n");
- KM_FZD_TRACE_INFO("\t date: %02d-%02d-%02d", \
- fzd_weather.weather_desc[0].time.nYear, \
- fzd_weather.weather_desc[0].time.nMonth,\
- fzd_weather.weather_desc[0].time.nDay);
- KM_FZD_TRACE_INFO("\t time: %02d:%02d:%02d", \
- fzd_weather.weather_desc[0].time.nMonth, \
- fzd_weather.weather_desc[0].time.nMin, \
- fzd_weather.weather_desc[0].time.nSec);
- KM_FZD_TRACE_INFO("\t weather code: %d", fzd_weather.weather_desc[0].weater_No);
- KM_FZD_TRACE_INFO("\t current temperature : %d", fzd_weather.weather_desc[0].curr_temperature);
- KM_FZD_TRACE_INFO("\t min temperature : %d", fzd_weather.weather_desc[0].min_temperature);
- KM_FZD_TRACE_INFO("\t max temperature : %d", fzd_weather.weather_desc[0].max_temperature);
- KM_FZD_TRACE_INFO("\t city : %s", fzd_weather.city_name);
- KM_FZD_TRACE_INFO("\t city_name_len : %d", fzd_weather.city_name_len);
- KM_FZD_TRACE_INFO("\t real_data_num : %d", fzd_weather.real_data_num);
- KM_FZD_TRACE_INFO("}\n");
-
- if((3 > s_parse_wt_count)
- && (0 == fzd_weather.weather_desc[0].curr_temperature && 0 == fzd_weather.weather_desc[0].min_temperature && 0 == fzd_weather.weather_desc[0].max_temperature))
- {
- s_parse_wt_count++;
- MMIAPI_StartWeatherFreshFromNet();
- }
- else
- {
- s_parse_wt_count = 0;
- MMIAPI_SetWeatherDataToNv(&fzd_weather);
- }
+ //////////
+ //////////
+ //////////
+ //function
+ //////////
+ //////////
+ //////////
- return;
+ return result;
}
-/*****************************************************************************
- Prototype : ic_fzd_convert_and_save_to_file
- Description £º×ª»»½ÓÊÕµ½µÄÊý¾Ý£¬±£´æµ½Îļþ
- Input : None
- Output : None
- Return Value :
- Calls :
- Called By :
-
- History :
- 1.Date : 2019/3/2
- Author : leihj
- Modification : Created function
-
- 0X7D 0X01 --> 0X7D
- 0X7D 0X02 --> 0X5B
- 0X7D 0X03 --> 0X5D
- 0X7D 0X04 --> 0X2C
- 0X7D 0X05 --> 0X2A
-
-*****************************************************************************/
-char ic_fzd_convert_and_save_to_file(wchar *file_path, char *buf, int buf_len)
-{
- int dir_fd = 0;
- int fd = 0;
- int i = 0;
- char tmp1 = 0;
- char tmp2 = 0;
- char value = 0;
- char w_data[100] = {0};
- char w_len = 0;
- MMIFILE_HANDLE file_handle;
- uint32 bytes_to_write = 0;
- if ((NULL == file_path) || (NULL == buf) || (buf_len <= 0))
- {
- KM_FZD_TRACE_ERROR("parameter error");
- return -1;
- }
- file_handle = MMIFILE_CreateFile(file_path, SFS_MODE_CREATE_ALWAYS | SFS_MODE_WRITE, NULL, NULL);
- for (i = 0; i < buf_len - 1; i++)
- {
- tmp1 = buf[i];
- tmp2 = buf[i + 1];
- w_data[w_len] = tmp1;
- if ((0x7d == tmp1) && ((tmp2 >= 0x01) && (tmp2 <= 0x05)))
- {
- switch (tmp2)
- {
- case 0x01:
- value = 0x7d;
- break;
-
- case 0x02:
- value = 0x5b;
- break;
-
- case 0x03:
- value = 0x5d;
- break;
-
- case 0x04:
- value = 0x2c;
- break;
-
- case 0x05:
- value = 0x2a;
- break;
- }
-
- //save new value and skip tmp2
- w_data[w_len] = value;
- i++;
- }
-
- //when buffer w_data is full, it need to write buffer to specific file.
- w_len++;
- if (sizeof(w_data) == w_len)
- {
- MMIFILE_WriteFile(file_handle, (void *)w_data, (uint32)w_len, &bytes_to_write, NULL);
- w_len = 0;
- }
- }
- KM_FZD_TRACE_INFO("ic_fzd_convert_and_save_to_file -111: buf_len = %d, i = %d",buf_len,i);
- //save the last data
- //×îºóµÄÁ½¸öÊý¾ÝÊÇÎÞÐè×ªÒÆµÄ£¬ÐèÒª°Ñ×îºóµÄÒ»¸öÊý¾Ý±£´æÆðÀ´
- //µ±i == next_buf_lenʱ£¬±íʾ×îºóÒ»¸öÊý¾ÝÊÇÐèҪתÒåµÄ£¬ÎÞÐè±£´æÕâ¸öÊý¾Ý
- if (i == buf_len - 1)
- {
- w_data[w_len++] = buf[buf_len - 1];
- }
-
- //±£´æÊ£ÓàµÄÊý¾Ý
- if (w_len > 0)
- {
- MMIFILE_WriteFile(file_handle, (void *)w_data, (uint32)w_len, &bytes_to_write, NULL);
- w_len = 0;
- }
- MMIFILE_CloseFile(file_handle);
- KM_FZD_TRACE_ERROR("cid: %s", file_path);
- return 0;
-}
-/*****************************************************************************
- Prototype : ic_fzd_net_parse_cid
- Description :
- Input : None
- Output : None
- Return Value :
- len of receiver data: 2048bytes
-
- // 0X7D 0X01 --> 0x7D
- // 0X7D 0X02 --> 0x5B
- // 0X7D 0X03 --> 0x5D
- // 0X7D 0X04 --> 0x2C
- // 0X7D 0X05 --> 0x2A
-*****************************************************************************/
-void ic_fzd_net_parse_cid(signed char *next_buf,int next_buf_len,signed char seq)
-{
- if(MMIFILE_IsFileExist((wchar *)MMI_FZD_FLODER_FILE_PNG, MMIAPICOM_Wstrlen((wchar *)MMI_FZD_FLODER_FILE_PNG)))
- {
- MMIFILE_DeleteFile ((wchar *)MMI_FZD_FLODER_FILE_PNG, NULL);
- }
- ic_fzd_convert_and_save_to_file((wchar *)MMI_FZD_FLODER_FILE_PNG, next_buf, next_buf_len);
-}
-/*****************************************************************************
- Prototype : ic_fzd_net_parse_cid_jpg
- Description :
- Input : None
- Output : None
- Return Value :
- len of receiver data: 1378bytes
-
- // 0X7D 0X01 --> 0x7D
- // 0X7D 0X02 --> 0x5B
- // 0X7D 0X03 --> 0x5D
- // 0X7D 0X04 --> 0x2C
- // 0X7D 0X05 --> 0x2A
-*****************************************************************************/
-void ic_fzd_net_parse_cid_jpg(signed char *next_buf,int next_buf_len,signed char seq)
-{
- if(MMIFILE_IsFileExist((wchar *)MMI_FZD_FLODER_FILE_JPG, MMIAPICOM_Wstrlen((wchar *)MMI_FZD_FLODER_FILE_JPG)))
- {
- MMIFILE_DeleteFile ((wchar *)MMI_FZD_FLODER_FILE_JPG, NULL);
- }
- ic_fzd_convert_and_save_to_file((wchar *)MMI_FZD_FLODER_FILE_JPG, next_buf, next_buf_len);
-}
-/*****************************************************************************
- Prototype : ic_fzd_net_parse_voice
- Description : parse response
- Input : None
- Output : None
- Return Value :
- Calls :
- Called By :
-
- ƽ̨»ØÓ¦ÓïÒô:
- ½âÎöÓïÒôʧ°Ü£¬·µ»Ø[XT*YYYYYYYYYYYYYYY*0007*VOICE,´íÎóÂë]
- ´íÂëÂë·Ö±ðΪ 0,1,2£º0 ±íʾ·Ç amr ÒôƵÊý¾Ý¡¢1 ±íʾÓïÒôʶ±ð²»³ö¡¢2 ±íʾÓïÒô²»¶ÔÓ¦ÈκÎÖ¸Áî
-
-*****************************************************************************/
-void ic_fzd_net_parse_voice(signed char *next_buf,int next_buf_len,signed char seq)
-{
- signed char value = 0;
- if ((NULL == next_buf) || (next_buf_len <= 0))
- {
- KM_FZD_TRACE_ERROR("parameter error");
- return ;
- }
- //value ·Ö±ðΪ 0,1,2£º0 ±íʾ·Ç amr ÒôƵÊý¾Ý¡¢1 ±íʾÓïÒôʶ±ð²»³ö¡¢2 ±íʾÓïÒô²»¶ÔÓ¦ÈκÎÖ¸Áî
- value = atoi(next_buf);
-}
-#endif
#endif
MMI_FZD_SERVER_SET_FACTORY,
MMI_FZD_SERVER_SET_POWEROFF,
- MMI_FZD_SERVER_FIND_WATCH,
+ MMI_FZD_SERVER_FIND_WATCH, // 11
MMI_FZD_SERVER_GET_VERSION,
MMI_FZD_SERVER_SET_PHONEBOOK,
MMI_FZD_SERVER_SET_CALL,
MMI_FZD_SERVER_SET_REMIND,
- MMI_FZD_SERVER_SET_HEART_INTERVAL,
+ MMI_FZD_SERVER_SET_HEART_INTERVAL, // 16
MMI_FZD_ACTION_SEND_HEART,
MMI_FZD_SERVER_SET_TEMPERATURE_INTERVAL,
MMI_FZD_ACTION_SEND_TEMPERATURE,
MMI_FZD_ACTION_GET_WEATHER,
+ MMI_FZD_SERVER_SET_SOS_NUMBER, // 26
+ MMI_FZD_SERVER_SET_CENTER_NUMBER,
+
/*******add before this line*******/
bool mmi_protocol_fzd_action_send_get_weather(MMI_WATCH_LOCATION_DATA_T * location_data);
bool mmi_protocol_fzd_parse_ACTION_GET_WEATHER(unsigned char * next_buff, unsigned int next_buff_len);
+bool mmi_protocol_fzd_parse_SERVER_SET_SOS_NUMBER(unsigned char * next_buff, unsigned int next_buff_len);
+
+bool mmi_protocol_fzd_parse_SERVER_SET_CENTER_NUMBER(unsigned char * next_buff, unsigned int next_buff_len);
--- /dev/null
+
+
+
+#include "lv_watch.h"
+
+#ifdef __MMI_ZHSX_SUPPORT__
+
+static TIMER_ID s_watch_search_timer_id = NULL;
+
+
+void mmi_watch_search_timer_stop(void)
+{
+ if(NULL != s_watch_search_timer_id)
+ {
+ Hal_Timer_Stop(s_watch_search_timer_id);
+ s_watch_search_timer_id = NULL;
+ }
+}
+
+static void mmi_watch_search_audio_ctrl_callback(AUDIO_CTRL_PRIORITY priority)
+{
+ SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: priority=%d\n", __FUNCTION__, __LINE__, priority);
+
+ if(AUDIO_CTRL_PRIORITY_SEARCH == priority)
+ {
+ if (AUDIO_CTRL_PRIORITY_SEARCH == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_SEARCH, mmi_watch_search_audio_ctrl_callback))
+ {
+ Hal_NFFS_File_Play_Repeat(AUDIO_SEARCH, HAL_AUDIO_SPK_LEVEL_MAX);
+ }
+ }
+ else if(AUDIO_CTRL_PRIORITY_SEARCH > priority)
+ {
+ mmi_watch_search_screen_destroy();
+ }
+}
+
+void mmi_watch_search_timeout_cb(void * para)
+{
+ mmi_watch_search_screen_destroy();
+}
+
+void mmi_watch_search_timer_start(void)
+{
+ mmi_watch_search_timer_stop();
+ s_watch_search_timer_id = Hal_Timer_Start(MMI_WATCH_SEARCH_DURATION, mmi_watch_search_timeout_cb, NULL, false);
+}
+
+void mmi_watch_search_screen_destroy(void)
+{
+ //lv_watch_search_ext_t * ext = lv_obj_get_ext_attr(lv_watch_get_activity_obj(ACT_ID_WATCH_SEARCHING));
+
+ mmi_watch_search_timer_stop();
+
+ //if (AUDIO_CTRL_PRIORITY_SEARCH == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_SEARCH, mmi_watch_search_audio_ctrl_callback))
+ //{
+ // Hal_Tone_Play_End();
+ //}
+ Hal_Audio_Manage_End_Ind(AUDIO_CTRL_PRIORITY_SEARCH);
+ Hal_Vibrator_Play_End();
+
+ lv_watch_png_cache_all_free();
+ lv_obj_del_async(lv_watch_get_activity_obj(ACT_ID_WATCH_SEARCHING));
+
+ watch_set_suspend_enable(true, ACT_ID_WATCH_SEARCHING, 0);
+}
+
+void mmi_watch_search_screen_event_cb(lv_obj_t * obj, lv_event_t e)
+{
+ SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: event=%d\n", __FUNCTION__, __LINE__, e);
+
+ if(LV_EVENT_PRESSED == e || LV_EVENT_CLICKED == e)
+ {
+ mmi_watch_search_screen_destroy(); // lv_watch_del_interface(ACT_ID_WATCH_SEARCHING);
+ }
+}
+
+lv_obj_t * mmi_watch_server_search_screen_create(lv_obj_t * activity_obj)
+{
+ SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
+ if(NULL == activity_obj)
+ {
+ lv_watch_activity_ext_t activity_ext = {0};
+
+ activity_ext.actId = ACT_ID_WATCH_SEARCHING;
+ activity_ext.create = (lv_watch_activity_create_f_t)mmi_watch_server_search_screen_create;
+ activity_ext.prepare_destory = mmi_watch_search_screen_destroy;
+ activity_obj = lv_watch_creat_activity_obj(&activity_ext);
+ LV_ASSERT_MEM(activity_obj);
+ }
+
+ lv_obj_t * obj = lv_watch_obj_create(activity_obj);
+ LV_ASSERT_MEM(obj);
+
+ lv_watch_search_ext_t * searching_ext = lv_obj_allocate_ext_attr(obj, sizeof(lv_watch_search_ext_t));
+
+ lv_obj_t * cont = lv_cont_create(obj, NULL);
+ lv_obj_set_size(cont, lv_obj_get_width(obj), lv_obj_get_height(obj));
+ lv_obj_align(cont, obj, LV_ALIGN_CENTER, 0, 0);
+ lv_obj_set_style_local_bg_color(cont, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(0, 0, 0));
+ lv_obj_set_click(cont, true);
+ lv_obj_set_event_cb(cont, mmi_watch_search_screen_event_cb);
+ //lv_obj_add_protect(cont, LV_PROTECT_PRESS_LOST);
+
+ lv_obj_t * label = lv_label_create(cont, NULL);
+ lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font20);
+ lv_label_set_text_id(label, WATCH_TEXT_ID_SERVER_SEARCH_PROMPT); //lv_lang_get_text(WATCH_TEXT_ID_SERVER_SEARCH_PROMPT)
+ lv_obj_align(label, cont, LV_ALIGN_CENTER, 0, 0);
+
+ //prompt
+ if (AUDIO_CTRL_PRIORITY_SEARCH == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_SEARCH, mmi_watch_search_audio_ctrl_callback))
+ {
+ Hal_NFFS_File_Play_Repeat(AUDIO_WATCH_SEARCH, HAL_AUDIO_SPK_LEVEL_MAX); // query_current_volume()
+ }
+ Hal_Vibrator_Play_Repeat();
+
+ mmi_watch_search_timer_start();
+
+ //watch_wakeup_lcd(true);
+ if(0 == Hal_Pm_Get_State())
+ {
+ Hal_Pm_WakeUp();
+ watch_set_lcd_status(true);
+ }
+ else
+ {
+ watch_set_lcd_status(true);
+ watch_wakeup_time_reset();
+ }
+ watch_set_suspend_enable(false, ACT_ID_WATCH_SEARCHING, 0);
+
+ return obj;
+}
+
+
+
+
+
+
+
+#endif
+
+
--- /dev/null
+
+
+
+#ifdef __MMI_ZHSX_SUPPORT__
+
+#ifndef __MMI_SUNDRY_H__
+#define __MMI_SUNDRY_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif //__cplusplus
+
+
+#include "lv_watch.h"
+
+
+#define __MMI_SUNDRY_DEBUG__
+#ifdef __MMI_SUNDRY_DEBUG__
+#define SUNDRY_DEBUG_PRINTF(fmt, ...) printf("[SUNDRY]"fmt, ##__VA_ARGS__)
+#else
+#define SUNDRY_DEBUG_PRINTF(fmt, ...)
+#endif
+
+
+#define MMI_WATCH_SEARCH_DURATION (1000 * 60) // ms
+
+typedef struct
+{
+ lv_watch_obj_ext_t old_ext;
+ lv_obj_t * label;
+} lv_watch_search_ext_t;
+
+void mmi_watch_search_screen_destroy(void);
+lv_obj_t * mmi_watch_server_search_screen_create(lv_obj_t * activity_obj);
+
+
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif //__cplusplus
+
+#endif
+
+#endif
+
+
mmi_protocol_receive_data_process(recv_str, recv_len);
}
- printf("[@CHENG_DEBUG][%s][%d]: recv_str=0x%x\n", __FUNCTION__, __LINE__, recv_str);
+ //printf("[@CHENG_DEBUG][%s][%d]: recv_str=0x%x\n", __FUNCTION__, __LINE__, recv_str);
//free(recv_str);
Hal_Mem_Free(recv_str);
return;
#define USE_LV_WATCH_DIAL_ROCKET 1
#define USE_LV_WATCH_DIAL_BEAR 1
#define USE_LV_WATCH_MAKE_FRIENDS 0 // 1
-#define USE_LV_WATCH_QRCODE 0
+#define USE_LV_WATCH_QRCODE 1 // 0
#define USE_LV_WATCH_QRCODE_SCAN 0
#define USE_LV_WATCH_STOPWATCH 1
#define USE_LV_WATCH_SOS 1
#define USE_LV_WATCH_LOWBATTERY 1
#define USE_LV_WATCH_SEARCH 1
-#define USE_LV_WATCH_SEARCH_SWTICH 1
+#define USE_LV_WATCH_SEARCH_SWTICH 0 // 1
#define USE_LV_WATCH_SEARCH_PHONE 0
#define USE_LV_WATCH_DIALPAD 1
#define USE_LV_WATCH_ALARM 1
#define USE_LV_WATCH_ALBUM 1
#define USE_LV_WATCH_ENGINEER_MODE 1
#define USE_LV_WATCH_CTA 1
-#define USE_LV_WATCH_VOLTE_SWTICH 1
+#define USE_LV_WATCH_VOLTE_SWTICH 0 // 1
#define USE_LV_WATCH_VIDEOCALL 1
#define USE_LV_WATCH_CALENDAR 1
#define USE_LV_WATCH_AUDIO_PLAYER 1