hengai
authorCCC <2393524978@qq.com>
Thu, 30 Nov 2023 11:35:56 +0000 (19:35 +0800)
committerCCC <2393524978@qq.com>
Thu, 30 Nov 2023 11:35:56 +0000 (19:35 +0800)
2.sdk/sdk/gui/lv_watch/lv_apps/custom_function/heng_ai_sleep_activation.c

index d7be7ea..66af953 100644 (file)
@@ -87,13 +87,35 @@ void mmi_hengai_sleep_activation_check_action(void)
 
 #if 1
 static uint8_t s_gsensor_upload_switch = 0; // 0-off; 1-on
+static char s_gsensor_buff_send[45000] = {0}; // 3000 * 3 * (4 + 1)
 
 void mmi_heng_ai_gsensor_upload_action(void)
 {
        if(0 == s_gsensor_upload_switch)
                return;
 
-       mmi_protocol_fzd_action_hengai_gsensor_data(s_hengai_sleep_gsensor_data, sizeof(s_hengai_sleep_gsensor_data));
+       _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)