}
}
+
+#if 1
+static uint8_t s_gsensor_upload_switch = 0; // 0-off; 1-on
+
+void mmi_heng_ai_gsensor_upload_action(void)
+{
+ if(0 == s_gsensor_upload_switch)
+ return;
+
+ mmi_protocol_fzd_action_hengai_sleep_data(s_hengai_sleep_gsensor_data, sizeof(s_hengai_sleep_gsensor_data));
+}
+
+void mmi_heng_ai_gsensor_upload_switch_set(uint8_t value)
+{
+ s_gsensor_upload_switch = value;
+}
+#endif
+
+
bool mmi_hengai_sleep_data_send(void)
{
char * temp_buff = NULL;
{
uos_timer_stop(s_hengai_sleep_gsensor_timer_id);
s_hengai_sleep_gsensor_counter = 0;
+ mmi_heng_ai_gsensor_upload_action();
mmi_hengai_sleep_data_get();
}
else
return result;
}
+
+#if 1
+bool mmi_protocol_fzd_action_hengai_sleep_data(char * file_buf, uint32_t file_size)
+{
+ bool result = false;
+ MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_ACTION_GSENSOR_DATA_UPLOAD;
+ unsigned char * content_buff = NULL;
+ unsigned int content_lenth = 0;
+
+ content_buff = (unsigned char *)lv_mem_alloc(file_size + 2);
+ if(NULL == content_buff)
+ {
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ return false;
+ }
+ _lv_memset_00(content_buff, file_size + 2);
+ sprintf(content_buff, ",");
+ _lv_memcpy(content_buff + 1, file_buf, file_size);
+ content_lenth = file_size;
+
+ result = mmi_protocol_fzd_send_with_data(action, content_buff, content_lenth);
+ lv_mem_free(content_buff);
+
+ return result;
+}
+
+bool mmi_protocol_fzd_parse_SERVER_SET_GSENSOR_UPLOAD_SWITCH(unsigned char * next_buff, unsigned int next_buff_len)
+{
+ bool result = false;
+ MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_SERVER_SET_GSENSOR_UPLOAD_SWITCH;
+
+ if(NULL == next_buff || 0 == next_buff_len)
+ {
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ return false;
+ }
+
+ result = true;
+ mmi_protocol_fzd_send_without_data(action);
+
+ state_value = atoi(next_buff);
+
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
+ mmi_heng_ai_gsensor_upload_switch_set(state_value);
+
+ return result;
+}
+
+#endif
+
#endif
MMI_FZD_ACTION_HENGAI_ACTIVATION,
MMI_FZD_ACTION_HENGAI_ACTIVATION_FEEDBACK,
MMI_FZD_ACTION_HENGAI_SLEEP_DATA,
+#if 1
+MMI_FZD_ACTION_GSENSOR_DATA_UPLOAD,
+MMI_FZD_SERVER_SET_GSENSOR_UPLOAD_SWITCH,
+#endif
#endif
{MMI_FZD_ACTION_HENGAI_ACTIVATION, "HENGAI_ACTIVATION"},
{MMI_FZD_ACTION_HENGAI_ACTIVATION_FEEDBACK, "HENGAI_ACTIVATION_FEEDBACK"},
{MMI_FZD_ACTION_HENGAI_SLEEP_DATA, "HENGAI_SLEEP_DATA"},
+
+ {MMI_FZD_ACTION_GSENSOR_DATA_UPLOAD, "TEST_SLEEP_UPLOAD"},
+ {MMI_FZD_SERVER_SET_GSENSOR_UPLOAD_SWITCH, "TEST_SLEEP_CONTROL"},
#endif
break;
case MMI_FZD_ACTION_HENGAI_SLEEP_DATA:
break;
+
+ case MMI_FZD_ACTION_GSENSOR_DATA_UPLOAD:
+ break;
+ case MMI_FZD_SERVER_SET_GSENSOR_UPLOAD_SWITCH:
+ mmi_protocol_fzd_parse_SERVER_SET_GSENSOR_UPLOAD_SWITCH(next_buff, next_buff_len);
+ break;
#endif