[Z5_HA_K18] 睡眠功能,缺失睡眠血压二合一库文件
author@CHENG <2393524978@qq.com>
Thu, 12 Sep 2024 07:45:02 +0000 (15:45 +0800)
committer@CHENG <2393524978@qq.com>
Thu, 12 Sep 2024 07:45:02 +0000 (15:45 +0800)
2.sdk/project/Z5_HA_K18/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h
2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/custom_function.c
2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/custom_function.h
2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_k18.c [new file with mode: 0644]
2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_k18.h [new file with mode: 0644]
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
2.sdk/sdk/gui/lv_watch/mmi_sundry/mmi_sundry.c

index e4fe59e..bc25244 100644 (file)
 #define __MMI_CHIP_TEMPERATURE_MONITOR_SUPPORT__
 
 #define __MMI_SLEEP_FUNCTION_SUPPORT__
-#define __MMI_CUSTOM_HENGAI_SLEEP__
+//#define __MMI_CUSTOM_HENGAI_SLEEP__
+#define __MMI_CUSTOM_HENGAI_SLEEP_K18__
 
 
 
index 1380327..c3fb592 100644 (file)
@@ -11,6 +11,9 @@
 #ifdef __MMI_CUSTOM_HENGAI_SLEEP__
 #include "heng_ai_sleep_activation.c"
 #endif
+#ifdef __MMI_CUSTOM_HENGAI_SLEEP_K18__
+#include "heng_ai_sleep_k18.c"
+#endif
 #ifdef __MMI_CUSTOM_HENGAI_HEALTH__
 #include "heng_ai_blood_pressure.c"
 #include "heng_ai_http_protocol.c"
@@ -21,6 +24,9 @@
 #ifdef __MMI_CUSTOM_AIGC_SUPPORT__
 #include "mmi_aigc_ui.c"
 #include "mmi_aigc_data.c"
+#ifdef __MMI_CUSTOM_AIGC_AUTHENTICATE_SUPPORT__
+#include "mmi_aigc_authenticate.c"
+#endif
 #endif
 #ifdef __MMI_CUSTOM_VOICECHAT_SUPPORT__
 #include "mmi_voicechat_ui.c"
index 9261256..32602fa 100644 (file)
@@ -25,6 +25,9 @@ extern "C" {
 #ifdef __MMI_CUSTOM_HENGAI_SLEEP__
 #include "heng_ai_sleep_activation.h"
 #endif
+#ifdef __MMI_CUSTOM_HENGAI_SLEEP_K18__
+#include "heng_ai_sleep_k18.h"
+#endif
 #ifdef __MMI_CUSTOM_HENGAI_HEALTH__
 #include "heng_ai_blood_pressure.h"
 #include "heng_ai_http_protocol.h"
@@ -33,6 +36,9 @@ extern "C" {
 #ifdef __MMI_CUSTOM_AIGC_SUPPORT__
 #include "mmi_aigc_ui.h"
 #include "mmi_aigc_data.h"
+#ifdef __MMI_CUSTOM_AIGC_AUTHENTICATE_SUPPORT__
+#include "mmi_aigc_authenticate.h"
+#endif
 #endif
 #ifdef __MMI_CUSTOM_VOICECHAT_SUPPORT__
 #include "mmi_voicechat_ui.h"
diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_k18.c b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_k18.c
new file mode 100644 (file)
index 0000000..31e9d79
--- /dev/null
@@ -0,0 +1,430 @@
+
+
+
+#include "lv_watch.h"
+
+#ifdef __MMI_CUSTOM_HENGAI_SLEEP_K18__
+
+#include "../../../../product/craneg_modem/cust/heng_ai_sleep/inc/lib_sleep.h"
+
+
+
+#define HENGAI_SLEEP_GSENSOR_DATA_MAX (3000) // 50hz
+
+static void * s_hengai_sleep_gsensor_timer_id = NULL;
+static gsensor_data_t s_hengai_sleep_gsensor_data[HENGAI_SLEEP_GSENSOR_DATA_MAX] = {0};
+static uint32_t s_hengai_sleep_gsensor_counter = 0;
+
+static sleep_data_t s_hengai_sdata = {0};
+
+static void mmi_hengai_gsensor_data_get(uint32_t para);
+
+
+
+#ifdef __MMI_HENG_AI_DEBUG__
+static uint8_t s_gsensor_upload_switch = 0; // 0-off; 1-on
+static char s_gsensor_buff_send[45000] = {0}; // 3000 * 3 * (4 + 1)
+
+#define HENGAI_SLEEP_RESULT_FILE       "C:/hengai_sleep_result.txt"
+
+
+void mmi_heng_ai_gsensor_upload_action(void)
+{
+       if(0 == s_gsensor_upload_switch)
+               return;
+
+       _lv_memset_00(s_gsensor_buff_send, sizeof(s_gsensor_buff_send));
+
+       char * temp_ptr = s_gsensor_buff_send;
+       uint32_t counter = 0;
+       uint32_t index = 0;
+       for(index = 0; index < (HENGAI_SLEEP_GSENSOR_DATA_MAX / 3); index++)
+       {
+               temp_ptr += counter;
+               sprintf(temp_ptr, "%d,%d,%d,%d,%d,%d,%d,%d,%d,",
+                                                       s_hengai_sleep_gsensor_data[index].x,
+                                                       s_hengai_sleep_gsensor_data[index].y,
+                                                       s_hengai_sleep_gsensor_data[index].z,
+                                                       s_hengai_sleep_gsensor_data[index + 1].x,
+                                                       s_hengai_sleep_gsensor_data[index + 1].y,
+                                                       s_hengai_sleep_gsensor_data[index + 1].z,
+                                                       s_hengai_sleep_gsensor_data[index + 2].x,
+                                                       s_hengai_sleep_gsensor_data[index + 2].y,
+                                                       s_hengai_sleep_gsensor_data[index + 2].z);
+               counter = strlen(temp_ptr);
+       }
+       
+       mmi_protocol_fzd_action_hengai_gsensor_data(s_gsensor_buff_send, strlen(s_gsensor_buff_send));
+}
+
+void mmi_heng_ai_gsensor_upload_switch_set(uint8_t value)
+{
+       s_gsensor_upload_switch = value;
+}
+
+void mmi_hengai_data_save_to_file(char * path, void * data_buf, uint32_t data_size)
+{
+       lv_fs_file_t file_p;
+       lv_fs_res_t res;
+       uint32_t bytes_write = 0;
+
+       res = lv_fs_open(&file_p, path, LV_FS_MODE_WR | LV_FS_MODE_APPEND);
+       if(LV_FS_RES_OK != res) 
+       {
+               printf("[@CHENG_DEBUG][%s][%d]: errno=%d\n", __FUNCTION__, __LINE__, res);
+               lv_fs_close(&file_p);
+               return false;
+       }
+
+       res = lv_fs_write(&file_p, data_buf, data_size, &bytes_write);
+       lv_fs_close(&file_p);
+       if(LV_FS_RES_OK != res)
+       {
+               printf("[@CHENG_DEBUG][%s][%d]: errno=%d\n", __FUNCTION__, __LINE__, res);
+               return false;
+       }
+       printf("[@CHENG_DEBUG][%s][%d]: file_size=%d,write_size=%d\n", __FUNCTION__, __LINE__, data_size, bytes_write);
+
+       return true;
+}
+
+#define HENGAI_SLEEP_RESULT_FILE       "C:/hengai_sleep_result.txt"
+
+void mmi_hengai_sleep_result_save(sleep_time_t * curtime, int result)
+{
+       char * temp_buff = NULL;
+       uint32_t buff_size = 64;
+
+       temp_buff = lv_mem_alloc(buff_size + 1);
+       if(NULL == temp_buff)
+       {
+               printf("[@CHENG_DEBUG][%s][%d]: memory alloc failed\n", __FUNCTION__, __LINE__);
+               return;
+       }
+       _lv_memset_00(temp_buff, buff_size + 1);
+
+       sprintf(temp_buff, "%d,%d,%d,%d,%d:%d;",
+                                               curtime->year,
+                                               curtime->month,
+                                               curtime->day,
+                                               curtime->hour,
+                                               curtime->minute,
+                                               result);
+
+       mmi_hengai_data_save_to_file(HENGAI_SLEEP_RESULT_FILE, temp_buff, strlen(temp_buff));
+       
+       if(NULL != temp_buff)
+       {
+               lv_mem_free(temp_buff);
+               temp_buff = NULL;
+       }
+}
+
+bool mmi_hengai_sleep_result_send(void)
+{
+       char * file_buf = NULL;
+       uint32_t file_size = 0;
+       lv_fs_file_t file_p;
+       lv_fs_res_t res;
+       uint32_t bytes_read = 0;
+
+       res = lv_fs_open(&file_p, HENGAI_SLEEP_RESULT_FILE, LV_FS_MODE_RD);
+       if(LV_FS_RES_OK != res) 
+       {
+               printf("[@CHENG_DEBUG][%s][%d]: errno=%d\n", __FUNCTION__, __LINE__, res);
+               goto exit_free_res;
+       }
+
+       lv_fs_size(&file_p, &file_size);
+       file_buf = (char *)lv_mem_alloc(file_size + 1);
+       if(NULL == file_buf)
+       {
+               printf("[@CHENG_DEBUG][%s][%d]: memory alloce fail\n", __FUNCTION__, __LINE__);
+               goto exit_free_res;
+       }
+       _lv_memset_00(file_buf, file_size + 1);
+       res = lv_fs_read(&file_p, file_buf, file_size, &bytes_read);
+       if(LV_FS_RES_OK != res)
+       {
+               printf("[@CHENG_DEBUG][%s][%d]: errno=%d\n", __FUNCTION__, __LINE__, res);
+               goto exit_free_res;
+       }
+       printf("[@CHENG_DEBUG][%s][%d]: file_size=%d,bytes_read=%d,file_buf=%p\n", __FUNCTION__, __LINE__, file_size, bytes_read, file_buf);
+
+       //mmi_protocol_fzd_action_sleep_result(file_buf, file_size);
+       mmi_protocol_fzd_action_hengai_sleep_data_test(file_buf, file_size);
+
+
+exit_free_res:
+       lv_fs_close(&file_p);
+       if(NULL != file_buf)
+       {
+               lv_mem_free(file_buf);
+               file_buf = NULL;
+       }
+}
+
+bool mmi_hengai_sleep_data_test_send(void)
+{
+       char * temp_buff = NULL;
+       uint32_t buff_size = sizeof(sleep_data_t);
+       char * temp_ptr = NULL;
+       uint32_t temp_count = 0;
+       uint8_t i = 0;
+
+       temp_buff = lv_mem_alloc(buff_size + 1);
+       if(NULL == temp_buff)
+       {
+               printf("[@CHENG_DEBUG][%s][%d]: memory alloc failed\n", __FUNCTION__, __LINE__);
+               return;
+       }
+       _lv_memset_00(temp_buff, buff_size + 1);
+
+       temp_count = 0;
+       temp_ptr = temp_buff + temp_count;
+       sprintf(temp_ptr, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
+                                               s_hengai_sdata.total_sleep_time,
+                                               s_hengai_sdata.begin_sleep_time.year,
+                                               s_hengai_sdata.begin_sleep_time.month,
+                                               s_hengai_sdata.begin_sleep_time.day,
+                                               s_hengai_sdata.begin_sleep_time.hour,
+                                               s_hengai_sdata.begin_sleep_time.minute,
+                                               s_hengai_sdata.end_sleep_time.year,
+                                               s_hengai_sdata.end_sleep_time.month,
+                                               s_hengai_sdata.end_sleep_time.day,
+                                               s_hengai_sdata.end_sleep_time.hour,
+                                               s_hengai_sdata.end_sleep_time.minute);
+       temp_count = strlen(temp_ptr);
+
+       temp_ptr += temp_count;
+       sprintf(temp_ptr, ",%d", s_hengai_sdata.state_count);
+       temp_count = strlen(temp_ptr);
+       
+       for(i = 0; i < s_hengai_sdata.state_count; i++)
+       {
+               temp_ptr += temp_count;
+               sprintf(temp_ptr, ",%d,%d", s_hengai_sdata.data[i].duration, s_hengai_sdata.data[i].state);
+               temp_count = strlen(temp_ptr);
+       }
+       
+       mmi_protocol_fzd_action_hengai_sleep_data_test(temp_buff, strlen(temp_buff));
+
+       if(NULL != temp_buff)
+       {
+               lv_mem_free(temp_buff);
+               temp_buff = NULL;
+       }
+}
+
+
+//#ifndef __MMI_HENG_AI_DEBUG__
+//#define __MMI_HENG_AI_DEBUG__
+//#endif
+
+static uint32_t __sleep_gsensor_counter = 0;
+
+void mmi_hengai_sleep_data_get(void);
+
+void __gsensor_data_set(unsigned char * next_buff, unsigned int next_buff_len)
+{
+#ifdef __MMI_HENG_AI_DEBUG__
+       // 300 set datas per 3 seconds
+       uint32_t index = 0;
+       char * temp_ptr = NULL;
+       uint32_t i = 0;
+       
+       for(i = 0; i < 300; i++)
+       {
+               index = __sleep_gsensor_counter + i;
+               
+               temp_ptr = km_strtok_r(NULL, ",", &next_buff);
+               s_hengai_sleep_gsensor_data[index].x = atoi(temp_ptr);
+
+               temp_ptr = km_strtok_r(NULL, ",", &next_buff);
+               s_hengai_sleep_gsensor_data[index].y = atoi(temp_ptr);
+               
+               temp_ptr = km_strtok_r(NULL, ",", &next_buff);
+               s_hengai_sleep_gsensor_data[index].z = atoi(temp_ptr);
+       }
+
+       __sleep_gsensor_counter += 300;
+       printf("[@CHENG_DEBUG][%s][%d]: %d\n", __FUNCTION__, __LINE__, __sleep_gsensor_counter);
+       if(HENGAI_SLEEP_GSENSOR_DATA_MAX <= __sleep_gsensor_counter)
+       {
+               printf("[@CHENG_DEBUG][%d]: %d,%d,%d,%d,%d,%d\n", __LINE__,
+                                                                       s_hengai_sleep_gsensor_data[0].x,
+                                                                       s_hengai_sleep_gsensor_data[0].y,
+                                                                       s_hengai_sleep_gsensor_data[0].z,
+                                                                       s_hengai_sleep_gsensor_data[1].x,
+                                                                       s_hengai_sleep_gsensor_data[1].y,
+                                                                       s_hengai_sleep_gsensor_data[1].z
+                                                                       );
+               
+               __sleep_gsensor_counter = 0;
+               mmi_hengai_sleep_data_get();
+       }
+#endif
+}
+
+#endif
+
+
+bool mmi_hengai_sleep_data_send(void)
+{
+       char * temp_buff = NULL;
+       uint32_t buff_size = sizeof(sleep_data_t);
+       char * temp_ptr = NULL;
+       uint32_t temp_count = 0;
+       uint8_t i = 0;
+
+       temp_buff = lv_mem_alloc(buff_size + 1);
+       if(NULL == temp_buff)
+       {
+               printf("[@CHENG_DEBUG][%s][%d]: memory alloc failed\n", __FUNCTION__, __LINE__);
+               return;
+       }
+       _lv_memset_00(temp_buff, buff_size + 1);
+
+       temp_count = 0;
+       temp_ptr = temp_buff + temp_count;
+       sprintf(temp_ptr, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
+                                               s_hengai_sdata.total_sleep_time,
+                                               s_hengai_sdata.begin_sleep_time.year,
+                                               s_hengai_sdata.begin_sleep_time.month,
+                                               s_hengai_sdata.begin_sleep_time.day,
+                                               s_hengai_sdata.begin_sleep_time.hour,
+                                               s_hengai_sdata.begin_sleep_time.minute,
+                                               s_hengai_sdata.end_sleep_time.year,
+                                               s_hengai_sdata.end_sleep_time.month,
+                                               s_hengai_sdata.end_sleep_time.day,
+                                               s_hengai_sdata.end_sleep_time.hour,
+                                               s_hengai_sdata.end_sleep_time.minute);
+       temp_count = strlen(temp_ptr);
+
+       temp_ptr += temp_count;
+       sprintf(temp_ptr, ",%d", s_hengai_sdata.state_count);
+       temp_count = strlen(temp_ptr);
+       
+       for(i = 0; i < s_hengai_sdata.state_count; i++)
+       {
+               temp_ptr += temp_count;
+               sprintf(temp_ptr, ",%d,%d", s_hengai_sdata.data[i].duration, s_hengai_sdata.data[i].state);
+               temp_count = strlen(temp_ptr);
+       }
+       
+       mmi_protocol_fzd_action_hengai_sleep_data(temp_buff, strlen(temp_buff));
+
+       if(NULL != temp_buff)
+       {
+               lv_mem_free(temp_buff);
+               temp_buff = NULL;
+       }
+}
+
+void mmi_hengai_sleep_data_get(void)
+{
+       sleep_time_t curtime = {0};
+       hal_rtc_t cur_time = {0};
+
+    Hal_Rtc_Gettime(&cur_time);
+       curtime.year = cur_time.tm_year;
+       curtime.month = cur_time.tm_mon;
+       curtime.day = cur_time.tm_mday;
+       curtime.hour = cur_time.tm_hour;
+       curtime.minute = cur_time.tm_min;
+
+       int result = 0;
+       result = get_sleep_time(s_hengai_sleep_gsensor_data, HENGAI_SLEEP_GSENSOR_DATA_MAX, curtime, &s_hengai_sdata);
+       printf("[@CHENG_DEBUG][%s][%d]: result=%d\n", __FUNCTION__, __LINE__, result);
+       if(1 == result)
+       {
+               mmi_hengai_sleep_data_send();           
+       }
+#ifdef __MMI_HENG_AI_DEBUG__
+       else
+       {
+               mmi_hengai_sleep_data_test_send();
+       }
+       mmi_hengai_sleep_result_save(&curtime, result);
+#endif
+
+       _lv_memset_00(s_hengai_sleep_gsensor_data, sizeof(s_hengai_sleep_gsensor_data));
+       mmi_hengai_gsensor_data_get(0);
+}
+
+static void mmi_hengai_gsensor_data_get(uint32_t para)
+{
+#ifndef __MMI_HENG_AI_DEBUG__
+       int16_t t_mems_data[32 * 3] = {0};
+       uint8_t i = 0;
+       
+       get_Gsensor_fifo_xyz(t_mems_data);
+       for(i = 0; i < 30; i++) // 30 sets data per 600ms
+       {
+               uint16_t index = s_hengai_sleep_gsensor_counter * 30 + i;
+               
+               s_hengai_sleep_gsensor_data[index].x = *(t_mems_data + i*3);
+               s_hengai_sleep_gsensor_data[index].y = *(t_mems_data + i*3 + 1);
+               s_hengai_sleep_gsensor_data[index].z = *(t_mems_data + i*3 + 2);
+       }
+       
+       s_hengai_sleep_gsensor_counter++;
+       if(100 <= s_hengai_sleep_gsensor_counter) // 1 minute:600ms*100
+       {
+               uos_timer_stop(s_hengai_sleep_gsensor_timer_id);
+               s_hengai_sleep_gsensor_counter = 0;
+       #ifdef __MMI_HENG_AI_DEBUG__
+               mmi_heng_ai_gsensor_upload_action();
+       #endif
+               mmi_hengai_sleep_data_get();
+       }
+       else
+       {
+               uos_timer_stop(s_hengai_sleep_gsensor_timer_id);
+               uos_timer_start(s_hengai_sleep_gsensor_timer_id, MS_TO_TICKS(600), 0, mmi_hengai_gsensor_data_get, NULL);
+       }
+#endif
+}
+
+void mmi_hengai_get_sleep_data_start(void)
+{
+#ifndef __MMI_HENG_AI_DEBUG__
+       printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+       
+       if(NULL != s_hengai_sleep_gsensor_timer_id)
+               uos_timer_stop(s_hengai_sleep_gsensor_timer_id);
+       else
+               uos_timer_create(&s_hengai_sleep_gsensor_timer_id);
+
+       s_hengai_sleep_gsensor_counter = 0;
+       _lv_memset_00(s_hengai_sleep_gsensor_data, sizeof(s_hengai_sleep_gsensor_data));
+       
+       //³õʼ»¯sdata
+    init_sleep_data(&s_hengai_sdata);
+    
+       uos_timer_start(s_hengai_sleep_gsensor_timer_id, MS_TO_TICKS(600), 0, mmi_hengai_gsensor_data_get, NULL);
+#endif
+}
+
+void mmi_hengai_get_sleep_data_stop(void)
+{
+#ifndef __MMI_HENG_AI_DEBUG__
+       printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
+       if(NULL != s_hengai_sleep_gsensor_timer_id)
+       {
+               uos_timer_stop(s_hengai_sleep_gsensor_timer_id);
+               uos_timer_delete(s_hengai_sleep_gsensor_timer_id);
+       }
+
+       s_hengai_sleep_gsensor_counter = 0;
+       _lv_memset_00(s_hengai_sleep_gsensor_data, sizeof(s_hengai_sleep_gsensor_data));
+#else
+       mmi_hengai_sleep_result_send();
+       lv_fs_remove(HENGAI_SLEEP_RESULT_FILE);
+#endif
+}
+#endif
+
+
+
diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_k18.h b/2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_k18.h
new file mode 100644 (file)
index 0000000..4251b13
--- /dev/null
@@ -0,0 +1,34 @@
+
+
+
+#ifndef __HENG_AI_SLEEP_K18_H__
+#define __HENG_AI_SLEEP_K18_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef LV_CONF_INCLUDE_SIMPLE
+#include "lvgl.h"
+#include "lv_ex_conf.h"
+#else
+#include "../../../lvgl/lvgl.h"
+#include "../../../lv_ex_conf.h"
+#endif
+
+#ifdef __MMI_CUSTOM_HENGAI_SLEEP_K18__
+
+
+void mmi_hengai_get_sleep_data_start(void);
+void mmi_hengai_get_sleep_data_stop(void);
+
+
+
+#endif
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif
+
index cdfb0c9..b31ec45 100644 (file)
@@ -3603,21 +3603,12 @@ bool mmi_protocol_fzd_action_hengai_activation(char * req_code)
        unsigned char * content_buff = NULL;
        unsigned int content_lenth = 256;
 
-#ifdef MMI_PROJECT_Z5_HA_K18
-       char * name = "Z5_HA_K18"; // É豸Ãû³Æ
-       char * model = "Z5_HA_K18"; // É豸ÐͺÅ
-       char * firm = "zh"; // É豸³§ÉÌ
-       char * sensor = "whale"; // ´«¸ÐÆ÷ÐͺÅ
-       uint16_t fs = 50; // ²ÉÑùÂÊ
-       char * sinklib_version = "v0.3.2.101122"; // Ï³Á¿â°æ±¾ºÅ
-#else
        char * name = "Z5_HA_K7"; // É豸Ãû³Æ
        char * model = "Z5_HA_K7"; // É豸ÐͺÅ
        char * firm = "zh"; // É豸³§ÉÌ
        char * sensor = "whale"; // ´«¸ÐÆ÷ÐͺÅ
        uint16_t fs = 50; // ²ÉÑùÂÊ
        char * sinklib_version = "v0.3.2.101122"; // Ï³Á¿â°æ±¾ºÅ
-#endif
 
        content_buff = (unsigned char *)lv_mem_alloc(content_lenth);
        if(NULL == content_buff)
@@ -3661,7 +3652,9 @@ bool mmi_protocol_fzd_action_hengai_activation_feedback(void)
 {
        return mmi_protocol_fzd_send_without_data(MMI_FZD_ACTION_HENGAI_ACTIVATION_FEEDBACK);
 }
+#endif
 
+#if defined(__MMI_CUSTOM_HENGAI_SLEEP__) || defined(__MMI_CUSTOM_HENGAI_SLEEP_K18__)
 bool mmi_protocol_fzd_action_hengai_sleep_data(char * file_buf, uint32_t file_size)
 {
        bool result = false;
index f5b12c0..63b6e3a 100644 (file)
@@ -193,6 +193,8 @@ typedef enum
 #ifdef __MMI_CUSTOM_HENGAI_SLEEP__
        MMI_FZD_ACTION_HENGAI_ACTIVATION,
        MMI_FZD_ACTION_HENGAI_ACTIVATION_FEEDBACK,
+#endif
+#if defined(__MMI_CUSTOM_HENGAI_SLEEP__) || defined(__MMI_CUSTOM_HENGAI_SLEEP_K18__)
        MMI_FZD_ACTION_HENGAI_SLEEP_DATA,
 #if 0
 MMI_FZD_ACTION_GSENSOR_DATA_UPLOAD,
@@ -365,6 +367,8 @@ bool mmi_protocol_fzd_parse_SERVER_SET_HENG_AI_WARNING(unsigned char * next_buff
 bool mmi_protocol_fzd_action_hengai_activation(char * req_code);
 bool mmi_protocol_fzd_parse_ACTION_HENGAI_ACTIVATION(unsigned char * next_buff, unsigned int next_buff_len);
 bool mmi_protocol_fzd_action_hengai_activation_feedback(void);
+#endif
+#if defined(__MMI_CUSTOM_HENGAI_SLEEP__) || defined(__MMI_CUSTOM_HENGAI_SLEEP_K18__)
 bool mmi_protocol_fzd_action_hengai_sleep_data(char * file_buf, uint32_t file_size);
 #endif
 #ifdef __MMI_CUSTOM_HENGAI_TCMS__
index 12a2820..1fedb8f 100644 (file)
@@ -125,6 +125,8 @@ static unsigned char * mmi_protocol_fzd_action_string_get(MMI_PROTOCOL_FZD_ACTIO
                #ifdef __MMI_CUSTOM_HENGAI_SLEEP__
                        {MMI_FZD_ACTION_HENGAI_ACTIVATION, "HENGAI_ACTIVATION"},
                        {MMI_FZD_ACTION_HENGAI_ACTIVATION_FEEDBACK, "HENGAI_ACTIVATION_FEEDBACK"},
+               #endif
+               #if defined(__MMI_CUSTOM_HENGAI_SLEEP__) || defined(__MMI_CUSTOM_HENGAI_SLEEP_K18__)
                        {MMI_FZD_ACTION_HENGAI_SLEEP_DATA, "HENGAI_SLEEP_DATA"},
 
                        #if 0
@@ -446,6 +448,8 @@ static bool mmi_protocol_fzd_content_parse(unsigned char * content_ptr, unsigned
 
                case MMI_FZD_ACTION_HENGAI_ACTIVATION_FEEDBACK:
                        break;
+       #endif
+       #if defined(__MMI_CUSTOM_HENGAI_SLEEP__) || defined(__MMI_CUSTOM_HENGAI_SLEEP_K18__)
                case MMI_FZD_ACTION_HENGAI_SLEEP_DATA:
                        break;
 
index 2fdf391..152f6cd 100644 (file)
@@ -1306,7 +1306,7 @@ bool mmi_watch_time_is_in_sleep_time(void)
 
 static void mmi_watch_get_sleep_data_start(void)
 {
-#ifdef __MMI_CUSTOM_HENGAI_SLEEP__
+#if defined(__MMI_CUSTOM_HENGAI_SLEEP__) || defined(__MMI_CUSTOM_HENGAI_SLEEP_K18__)
        mmi_hengai_get_sleep_data_start();
 #endif
 
@@ -1314,7 +1314,7 @@ static void mmi_watch_get_sleep_data_start(void)
 
 static void mmi_watch_get_sleep_data_stop(void)
 {
-#ifdef __MMI_CUSTOM_HENGAI_SLEEP__
+#if defined(__MMI_CUSTOM_HENGAI_SLEEP__) || defined(__MMI_CUSTOM_HENGAI_SLEEP_K18__)
        mmi_hengai_get_sleep_data_stop();
 #endif