#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)