MMI_PROTOCOL_FZD_ACTION_ENUM action,
unsigned char * alert_info)
{
+#if 1
+
+ unsigned char * t_ptr = NULL;
+ unsigned int t_count = 0, t_total_count = 0;
+ hal_rtc_t cur_time = {0}, cur_utc_time = {0};
+ unsigned int battery_value = Hal_Battery_Get_Status();
+ unsigned int sleep_roll_value = 0;
+ unsigned int step_value = asl_pedometer_steps_get();
+ uint8_t i = 0;
+ char data_str[256] = {0};
+
+ t_ptr = content_buff;
+
+ //seperator & time
+ Hal_Rtc_Gettime_Utc(&cur_utc_time);
+ t_count = sprintf(t_ptr, ",%02u%02u%02u,%02u%02u%02u",
+ cur_utc_time.tm_year%100,
+ cur_utc_time.tm_mon,
+ cur_utc_time.tm_mday,
+ cur_utc_time.tm_hour,
+ cur_utc_time.tm_min,
+ cur_utc_time.tm_sec);
+ t_total_count += t_count;
+
+ //gps
+ t_ptr += t_count;
+ mmi_location_gps_data_process(&(location_data->gps_data), data_str);
+ t_count = sprintf(t_ptr, ",%s", data_str);
+ t_total_count += t_count;
+
+ //
+ t_ptr += t_count;
+ t_count = sprintf(t_ptr, ",%d,%u,%u,%u",
+ location_data->cell_data.link_rxlev,
+ battery_value,
+ step_value,
+ sleep_roll_value);
+ t_total_count += t_count;
+
+ //alert info
+ t_ptr += t_count;
+ if (NULL != alert_info)
+ {
+ t_count = sprintf(t_ptr, ",%s", alert_info);
+ }
+ else
+ {
+ t_count = sprintf(t_ptr, ",%s", "00000000");
+ }
+ t_total_count += t_count;
+
+ //cell
+ t_ptr += t_count;
+ t_count = sprintf(t_ptr, ",%u,%u,%u,%u",
+ location_data->cell_data.cell_num,
+ 1,
+ location_data->cell_data.mcc,
+ location_data->cell_data.mnc);
+ t_total_count += t_count;
+ for (i = 0; i < location_data->cell_data.cell_num; i++)
+ {
+ t_ptr += t_count;
+ t_count = sprintf(t_ptr, ",%u,%u,%d", location_data->cell_data.lac[i], location_data->cell_data.cell_id[i], location_data->cell_data.rxlev[i]);
+ t_total_count += t_count;
+ }
+
+ //wifi
+ t_ptr += t_count;
+ t_count = sprintf(t_ptr, ",%u", location_data->wifi_data.count);
+ t_total_count += t_count;
+ for (i = 0; i < location_data->wifi_data.count; i++)
+ {
+ t_ptr += t_count;
+ t_count = sprintf(t_ptr, ",wifi%u,%02x:%02x:%02x:%02x:%02x:%02x,%d",
+ i,
+ location_data->wifi_data.item[i].mac[0],
+ location_data->wifi_data.item[i].mac[1],
+ location_data->wifi_data.item[i].mac[2],
+ location_data->wifi_data.item[i].mac[3],
+ location_data->wifi_data.item[i].mac[4],
+ location_data->wifi_data.item[i].mac[5],
+ location_data->wifi_data.item[i].rssi);
+ t_total_count += t_count;
+ }
+
+ return t_total_count;
+
+#else
+
unsigned char * t_ptr = NULL;
unsigned int t_count = 0;
hal_rtc_t cur_time = {0}, cur_utc_time = {0};
t_count = strlen(content_buff);
return t_count;
+#endif
}
bool mmi_protocol_fzd_action_send_location(MMI_WATCH_LOCATION_DATA_T * location_data)