static nv_watch_health_measure_timed_t s_health_measure_timed_data = {0};
static lv_ll_t s_health_measure_timed_ll = {0};
static lv_health_measure_run_t s_health_measure_run_data = {0};
-static TIMER_ID s_process_timer_id = NULL;
+static void * s_health_measure_process_timer_id = NULL;
static uint8_t s_measure_time_total = 0, s_measure_time_count = 0;
static uint32_t s_health_measure_heart_timed_time_stamp = 0, s_health_measure_temperature_timed_time_stamp = 0,
s_health_measure_blood_timed_time_stamp = 0, s_health_measure_spo2_timed_time_stamp = 0;
+static void mmi_health_measure_process_timer_handle(uint32_t para);
+
void mmi_hsensor_close(void)
{
void mmi_health_measure_process_timer_stop(void)
{
- if(NULL != s_process_timer_id)
+ if(NULL != s_health_measure_process_timer_id)
{
- Hal_Timer_Stop(s_process_timer_id);
- s_process_timer_id = NULL;
+ uos_timer_stop(s_health_measure_process_timer_id);
+ uos_timer_delete(s_health_measure_process_timer_id);
+ s_health_measure_process_timer_id = NULL;
}
}
s_health_measure_run_data.measure_type = MMI_HEALTH_MEASURE_NONE;
}
-void mmi_health_measure_process_timer_handle(void *para)
+static void mmi_health_measure_process_timer_handle(uint32_t para)
{
if(false == mmi_health_measure_wear_state_get())
{
default:
break;
}
+
+ uos_timer_start(s_health_measure_process_timer_id, MMI_HEALTH_MEASURE_CYCLE_DURATION, 0, mmi_health_measure_process_timer_handle, NULL);
}
}
s_health_measure_run_data.measure_type = measure_type;
s_measure_time_count = 0;
- s_process_timer_id = Hal_Timer_Start(MMI_HEALTH_MEASURE_CYCLE_DURATION, mmi_health_measure_process_timer_handle, NULL, true);
+
+ uos_timer_create(&s_health_measure_process_timer_id);
+ uos_timer_start(s_health_measure_process_timer_id, MMI_HEALTH_MEASURE_CYCLE_DURATION, 0, mmi_health_measure_process_timer_handle, NULL);
}
void mmi_health_measure_timed_measure_start(MMI_HEALTH_MEASURE_TYPE_E measure_type)
#ifdef __MMI_ZHSX_SUPPORT__
#if USE_GPS
-//#include "../../../../product/craneg_modem/hal/gps_device/inc/gpsnmeaapi.h"
#include "../../../product/craneg_modem/hal/gps_device/inc/gpsnmeaapi.h"
#endif
#include "../modem/mmi_modem_tcp/wifi_scan_task.h"
-static uint8_t s_watch_location_state = 0; // 0-init; 1-locating
+static uint8_t s_watch_location_state = 0; // 0-default; 1-locating
static MMI_WATCH_LOCATION_STATE_E s_watch_location_gps_state = 0, s_watch_location_cell_state = 0, s_watch_location_wifi_state = 0;
static MMI_WATCH_LOCATION_DATA_T s_watch_location_data = {0};
static lv_ll_t s_watch_location_mission_ll = {0};
-static TIMER_ID s_watch_location_timer_id = NULL;
+static void * s_watch_location_timer_id = NULL;
static uint8_t s_watch_location_times_check_count = 0;
+static void mmi_watch_location_mission_timer_cb(uint32_t para);
+
void mmi_watch_location_mission_list_init(void)
{
MMI_WATCH_LOCATION_TYPE_E * node = _lv_ll_get_tail(&s_watch_location_mission_ll);
LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%d]: %d,%d,%d,%d,%d,%d,%d,%d,%u\n", __LINE__,
+ s_watch_location_data.gps_data.state,
+ s_watch_location_data.gps_data.latitude * 1000000,
+ s_watch_location_data.gps_data.ns,
+ s_watch_location_data.gps_data.longitude * 1000000,
+ s_watch_location_data.gps_data.ew,
+ s_watch_location_data.gps_data.speed * 100,
+ s_watch_location_data.gps_data.degree * 10,
+ s_watch_location_data.gps_data.altitude * 10,
+ s_watch_location_data.gps_data.satellite_num);
while(NULL != node)
{
void mmi_watch_location_gps_finsh_cb(void *param)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
if(NULL != param)
{
LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
if('A' == gpsNmeaData->NmeaRmcData.Status)
{
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
gps2wgs84(gpsNmeaData->NmeaRmcData.Latitude, gpsNmeaData->NmeaRmcData.Longitude, &gpsLat, &gpsLon);
s_watch_location_data.gps_data.state = 'A';
s_watch_location_state = 0;
if(NULL != s_watch_location_timer_id)
{
- Hal_Timer_Stop(s_watch_location_timer_id);
+ uos_timer_stop(s_watch_location_timer_id);
+ uos_timer_delete(s_watch_location_timer_id);
s_watch_location_timer_id = NULL;
}
mmi_watch_location_wifi_stop();
}
-void mmi_watch_location_mission_timer_cb(void * para)
+static void mmi_watch_location_mission_timer_cb(uint32_t para)
{
LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: total=%d,count=%d\n", __FUNCTION__, __LINE__, MMI_WATCH_LOCATION_CHECK_TIMES_COUNT_MAX, s_watch_location_times_check_count);
}
else
{
- LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
-
if(MMI_WATCH_LOCATION_STATE_SUCCESS == s_watch_location_cell_state
&& MMI_WATCH_LOCATION_STATE_SUCCESS == s_watch_location_gps_state
)
mmi_watch_location_mission_list_data_send();
mmi_watch_location_mission_stop();
}
+ else
+ {
+ LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
+ uos_timer_start(s_watch_location_timer_id, MMI_WATCH_LOCATION_PROCESS_DURATION, 0, mmi_watch_location_mission_timer_cb, NULL);
+ }
}
}
s_watch_location_state = 1;
_lv_memset_00(&s_watch_location_data, sizeof(MMI_WATCH_LOCATION_DATA_T));
s_watch_location_times_check_count = 0;
- s_watch_location_timer_id = Hal_Timer_Start(MMI_WATCH_LOCATION_PROCESS_DURATION, mmi_watch_location_mission_timer_cb, NULL, true);
+
+ uos_timer_create(&s_watch_location_timer_id);
+ uos_timer_start(s_watch_location_timer_id, MMI_WATCH_LOCATION_PROCESS_DURATION, 0, mmi_watch_location_mission_timer_cb, NULL);
mmi_watch_location_gps_start();
mmi_watch_location_cell_start();
static nv_watch_protocol_data_t s_watch_protocol_data = {0};
static bool s_watch_bind_state = false;
-static TIMER_ID s_watch_timed_mission_timer_id = NULL;
+static void * s_watch_timed_mission_timer_id = NULL;
static uint32_t s_watch_timed_location_time_stamp = 0, s_watch_timed_weather_time_stamp = 0;
+static void * s_watch_heartbeat_action_timer_id = NULL;
+static uint32_t s_watch_heartbeat_action_time_stamp = 0;
+
+static void mmi_protocol_watch_timed_mission_timer_cb(uint32_t para);
+static void mmi_protocol_watch_heartbeat_timer_cb(uint32_t para);
+
bool mmi_watch_tcp_connect_state_get(void)
{
mmi_protocol_fzd_receive_data_process(recv_str, recv_len);
}
+void * mmi_protocol_send_space_ptr_get(int cmd)
+{
+ mmi_protocol_fzd_send_space_ptr_get(cmd);
+}
+
+int mmi_protocol_send_space_size_get(int cmd)
+{
+ return mmi_protocol_fzd_send_space_size_get(cmd);
+}
+
+void mmi_protocol_send_space_free(int cmd)
+{
+ mmi_protocol_fzd_send_space_deinit(cmd);
+}
+
+bool mmi_protocol_send_cmd_check(int cmd)
+{
+ return mmi_protocol_fzd_send_cmd_check(cmd);
+}
+
void mmi_watch_protocol_data_nv_write(void)
{
uint32_t nv_data_length = sizeof(nv_watch_protocol_data_t);
}
}
-void mmi_watch_protocol_data_init(void)
+void mmi_watch_protocol_data_nv_read(void)
{
uint32_t nv_data_length = sizeof(nv_watch_protocol_data_t);
if(nv_data_length != UI_NV_Read_Req(NV_SECTION_UI_PROTOCOL_DATA, 0, nv_data_length, (uint8_t *)&s_watch_protocol_data))
{
PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: nv read fail\n", __FUNCTION__, __LINE__);
- s_watch_protocol_data.heartbeat_action_interval = MMI_PROTOCOL_HEARTBEAT_ACTION_INTERVAL;
- s_watch_protocol_data.location_upload_interval = MMI_PROTOCOL_LOCATION_UPLOAD_INTERVAL;
- s_watch_protocol_data.weather_update_interval = MMI_PROTOCOL_WEATHER_UPDATE_INTERVAL;
}
}
+void mmi_watch_protocol_data_nv_default(nv_watch_protocol_data_t * data)
+{
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: nv default\n", __FUNCTION__, __LINE__);
+
+ data->heartbeat_action_interval = MMI_PROTOCOL_HEARTBEAT_ACTION_INTERVAL;
+ data->location_upload_interval = MMI_PROTOCOL_LOCATION_UPLOAD_INTERVAL;
+ data->weather_update_interval = MMI_PROTOCOL_WEATHER_UPDATE_INTERVAL;
+}
+
uint32_t mmi_protocol_watch_heartbeat_action_interval_get(void)
{
return (s_watch_protocol_data.heartbeat_action_interval);
mmi_watch_protocol_data_nv_write();
}
-static void mmi_protocol_watch_timed_mission_timer_cb(void * para)
+static void mmi_protocol_watch_timed_mission_timer_cb(uint32_t para)
{
uint32_t cur_time_stamp = 0;
mmi_health_measure_temperature_timed_action(false, cur_time_stamp);
mmi_health_measure_blood_timed_action(false, cur_time_stamp);
mmi_health_measure_spo2_timed_action(false, cur_time_stamp);
+
+ uos_timer_start(s_watch_timed_mission_timer_id, 1000 * 20, 0, mmi_protocol_watch_timed_mission_timer_cb, NULL);
}
void mmi_protocol_watch_timed_mission_action(void)
mmi_health_measure_blood_timed_action(true, cur_time_stamp);
mmi_health_measure_spo2_timed_action(true, cur_time_stamp);
- s_watch_timed_mission_timer_id = Hal_Timer_Start(1000 * 20, mmi_protocol_watch_timed_mission_timer_cb, NULL, TRUE);
+ uos_timer_create(&s_watch_timed_mission_timer_id);
+ uos_timer_start(s_watch_timed_mission_timer_id, 1000 * 20, 0, mmi_protocol_watch_timed_mission_timer_cb, NULL);
}
}
-static TIMER_ID s_watch_heartbeat_action_timer_id = NULL;
-static uint32_t s_watch_heartbeat_action_time_stamp = 0;
-
void mmi_protocol_watch_heartbeat_stop(void)
{
if(NULL != s_watch_heartbeat_action_timer_id)
{
- Hal_Timer_Stop(s_watch_heartbeat_action_timer_id);
+ uos_timer_stop(s_watch_heartbeat_action_timer_id);
+ uos_timer_delete(s_watch_heartbeat_action_timer_id);
s_watch_heartbeat_action_timer_id = NULL;
}
}
-static void mmi_protocol_watch_heartbeat_timer_cb(void * para)
+static void mmi_protocol_watch_heartbeat_timer_cb(uint32_t para)
{
uint32_t cur_time_stamp = 0;
Hal_Rtc_Gettime_Count(&cur_time_stamp);
if(mmi_protocol_watch_heartbeat_action_interval_get() <= (cur_time_stamp - s_watch_heartbeat_action_time_stamp))
{
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: cur=%d, stamp=%d\n", __FUNCTION__, __LINE__, cur_time_stamp, s_watch_heartbeat_action_time_stamp);
+
mmi_protocol_action_link();
s_watch_heartbeat_action_time_stamp = cur_time_stamp;
}
+
+ uos_timer_start(s_watch_heartbeat_action_timer_id, 1000 * 20, 0, mmi_protocol_watch_heartbeat_timer_cb, NULL);
}
void mmi_protocol_watch_heartbeat_action(void)
{
if(NULL == s_watch_heartbeat_action_timer_id)
{
- mmi_watch_protocol_data_init();
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+
+ mmi_watch_protocol_data_nv_read();
mmi_protocol_action_link();
Hal_Rtc_Gettime_Count(&s_watch_heartbeat_action_time_stamp);
- s_watch_heartbeat_action_timer_id = Hal_Timer_Start(1000 * 20, mmi_protocol_watch_heartbeat_timer_cb, NULL, TRUE);
+
+ uos_timer_create(&s_watch_heartbeat_action_timer_id);
+ uos_timer_start(s_watch_heartbeat_action_timer_id, 1000 * 20, 0, mmi_protocol_watch_heartbeat_timer_cb, NULL);
}
}
bool mmi_protocol_check_state_before_send_action(void)
{
- if((false == watch_modem_sim_present_check_req())
- || (false == mmi_watch_tcp_connect_state_get())
- || (false == mmi_protocol_watch_bind_state_get())
- )
+ if(false == watch_modem_sim_present_check_req())
+ {
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ return false;
+ }
+ if(false == mmi_watch_tcp_connect_state_get())
+ {
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ return false;
+ }
+ if(false == mmi_protocol_watch_bind_state_get())
{
PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
return false;
#endif //__cplusplus
-#define __MMI_PROTOCOL_DEBUG__
+//#define __MMI_PROTOCOL_DEBUG__
#ifdef __MMI_PROTOCOL_DEBUG__
#define PROTOCOL_DEBUG_PRINTF(fmt, ...) printf("[PROTOCOL]"fmt, ##__VA_ARGS__)
#else
void mmi_protocol_receive_data_process(char * recv_str, int recv_len);
+void * mmi_protocol_send_space_ptr_get(int cmd);
+
+int mmi_protocol_send_space_size_get(int cmd);
+
+void mmi_protocol_send_space_free(int cmd);
+
+bool mmi_protocol_send_cmd_check(int cmd);
+
+void mmi_watch_protocol_data_nv_default(nv_watch_protocol_data_t * data);
+
void mmi_protocol_watch_timed_mission_action(void);
void mmi_protocol_watch_heartbeat_stop(void);
static bool mmi_protocol_fzd_content_parse(unsigned char * content_ptr, unsigned int content_length);
-signed char km_char_toupper(signed char c)
+static signed char mmi_char_to_upper(signed char c)
{
if ( c >= 'a' && c <= 'z' )
{
return c;
}
+static void mmi_float_to_str(double float_num, uint8_t int_num, char * data_str)
+{
+ uint8_t i = 0;
+ uint32_t high_part = 0;
+ double low_part = 0.0;
+ char high_part_str[16] = {0}, low_part_str[16] = {0};
+
+ high_part = (int)float_num;
+ sprintf(high_part_str, "%d", high_part);
+
+ low_part = float_num - high_part;
+ for(i = 0; i < int_num; i++)
+ {
+ uint32_t temp_high = 0;
+
+ low_part = low_part * 10;
+ temp_high = (int)low_part;
+ low_part -= temp_high;
+ low_part_str[i] = '0' + temp_high;
+ }
+ low_part_str[i] = '\0';
+
+ sprintf(data_str, "%s.%s", high_part_str, low_part_str);
+}
+
void km_str_toupper(signed char *str, signed int len)
{
signed int i = 0;
for(i=0;i<len;i++)
{
- str[i] = km_char_toupper(str[i]);
+ str[i] = mmi_char_to_upper(str[i]);
}
}
for(i=0;i<hex_str_len;i++)
{
- upper = km_char_toupper(hex_str[i]);
+ upper = mmi_char_to_upper(hex_str[i]);
temp_num = (upper >= 'A')?upper - 'A' + 10:upper - '0';
number = number*16 + temp_num;
}
void mmi_protocol_fzd_send_space_deinit(MMI_PROTOCOL_FZD_ACTION_ENUM action)
{
- PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: action=%d\n", __FUNCTION__, __LINE__, action);
-
if (NULL != s_send_space_struct[action].ptr)
{
- PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: ptr=0x%x\n", __FUNCTION__, __LINE__, s_send_space_struct[action].ptr);
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: action=%d,ptr=0x%x\n", __FUNCTION__, __LINE__, action, s_send_space_struct[action].ptr);
lv_mem_free(s_send_space_struct[action].ptr);
s_send_space_struct[action].ptr = NULL;
s_send_space_struct[action].size = 0;
}
}
-void mmi_protocol_fzd_send_action_do(MMI_PROTOCOL_FZD_ACTION_ENUM action)
+bool mmi_protocol_fzd_send_cmd_check(MMI_PROTOCOL_FZD_ACTION_ENUM action)
{
- unsigned char * send_space_ptr = (unsigned char *)mmi_protocol_fzd_send_space_ptr_get(action);
- int send_space_size = mmi_protocol_fzd_send_space_size_get(action);
-
- PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: size=%d, content=%s\n", __FUNCTION__, __LINE__, send_space_size, send_space_ptr);
-
- if(send_space_size > 0)
+ if(MMI_FZD_ACTION_NONE >= action || MMI_FZD_ACTION_MAX <= action)
{
PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: action=%d\n", __FUNCTION__, __LINE__, action);
-
- //send_tcp_cmdmsg(int cmd_type, void* cmd_param)
- send_tcp_cmdmsg(send_space_size, send_space_ptr);
+ return false;
}
- mmi_protocol_fzd_send_space_deinit(action);
+ return true;
+}
+
+void mmi_protocol_fzd_send_action_do(MMI_PROTOCOL_FZD_ACTION_ENUM action)
+{
+ PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: action=%d\n", __FUNCTION__, __LINE__, action);
+
+ send_tcp_cmdmsg(action, NULL);
+
+ //mmi_modem_tcp_send(send_space_ptr, send_space_size);
+ //mmi_protocol_fzd_send_space_deinit(action);
}
// [MD5_DATADEVICE_NAME*DEVICE_ID*CONTENT_LEN*ACTION_STRING,ACTION_CONTENT]
}
else if(NULL != s_receive_space_struct.incomplete_ptr && 0 != s_receive_space_struct.incomplete_len)
{
- //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: incomplete buffer is not null\n", __FUNCTION__, __LINE__);
-
temp_ptr = lv_mem_alloc(recv_len + s_receive_space_struct.incomplete_len);
if (NULL != temp_ptr)
{
}
else
{
- //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: incomplete buffer is null\n", __FUNCTION__, __LINE__);
-
temp_ptr = lv_mem_alloc(recv_len);
if (NULL != temp_ptr)
{
//tail
offset_tail_bracket = offset_third_sep + MMI_PROTOCOL_FZD_SEPARATOR_LEN + content_len;
- PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: offset_tail_bracket=%d\n", __FUNCTION__, __LINE__, offset_tail_bracket);
+ //PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: offset_tail_bracket=%d\n", __FUNCTION__, __LINE__, offset_tail_bracket);
if(0 != strncmp(recv_buffer + i + offset_tail_bracket, MMI_PROTOCOL_FZD_TAIL_BRACKET, MMI_PROTOCOL_FZD_BRACKET_LEN)) // ]
{
PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: tail check error\n", __FUNCTION__, __LINE__);
MMI_PROTOCOL_FZD_ACTION_ENUM action = MMI_FZD_ACTION_SEND_TEMPERATURE;
unsigned char content_buff[8] = {0};
unsigned int content_lenth = 0;
+ char data_str[8] = {0};
- sprintf(content_buff, ",%.1f", temp_value);
+ mmi_float_to_str(temp_value, 1, data_str);
+ sprintf(content_buff, ",%s", data_str);
content_lenth = strlen(content_buff);
result = mmi_protocol_fzd_send_content_construct(action, content_buff, content_lenth);
}
#endif
+static void mmi_location_gps_data_process(MMI_WATCH_GPS_DATA_T * gps_data, char * data_str)
+{
+ char state_str[2] = {0};
+ char latitude_str[16] = {0}, longitude_str[16] = {0};
+ char ns_str[2] = {0}, ew_str[2] = {0};
+ char speed_str[8] = {0}, degree_str[8] = {0}, altitude_str[8] = {0};
+
+ if('A' == gps_data->state)
+ state_str[0] = 'A';
+ else
+ state_str[0] = 'V';
+
+ mmi_float_to_str(gps_data->latitude, 6, latitude_str);
+
+ if('N' == gps_data->ns)
+ ns_str[0] = 'N';
+ else if('S' == gps_data->ns)
+ ns_str[0] = 'S';
+ else
+ ns_str[0] = '0';
+
+ mmi_float_to_str(gps_data->longitude, 6, longitude_str);
+
+ if('E' == gps_data->ew)
+ ew_str[0] = 'E';
+ else if('W' == gps_data->ew)
+ ew_str[0] = 'W';
+ else
+ ew_str[0] = '0';
+
+ mmi_float_to_str(gps_data->speed, 2, speed_str);
+
+ mmi_float_to_str(gps_data->degree, 1, degree_str);
+
+ mmi_float_to_str(gps_data->altitude, 1, altitude_str);
+
+ sprintf(data_str, "%s,%s,%s,%s,%s,%s,%s,%s,%u",
+ state_str,
+ latitude_str, ns_str, longitude_str, ew_str,
+ speed_str, degree_str, altitude_str,
+ gps_data->satellite_num);
+}
+
static unsigned int mmi_protocol_fzd_action_send_content_fill_location_data(unsigned char * content_buff,
unsigned int content_lenth,
MMI_WATCH_LOCATION_DATA_T * location_data,
unsigned int sleep_roll_value = 0;
unsigned int step_value = 0;
uint8_t i = 0;
+ char data_str[128] = {0};
t_ptr = content_buff;
//gps
t_ptr += t_count;
- sprintf(t_ptr, ",%c,%02.06f,%c,%03.06f,%c,%01.02f,%03.01f,%03.01f,%u",
- location_data->gps_data.state,
- location_data->gps_data.latitude,
- location_data->gps_data.ns,
- location_data->gps_data.longitude,
- location_data->gps_data.ew,
- location_data->gps_data.speed,
- location_data->gps_data.degree,
- location_data->gps_data.altitude,
- location_data->gps_data.satellite_num);
+ mmi_location_gps_data_process(&(location_data->gps_data), data_str);
+ sprintf(t_ptr, ",%s", data_str);
t_count = strlen(t_ptr);
//
-//#define __MMI_PROTOCOL_DEBUG__
-//#ifdef __MMI_PROTOCOL_DEBUG__
-//#define PROTOCOL_DEBUG_PRINTF(fmt, ...) printf("[FZD]"fmt, ##__VA_ARGS__)
-//#else
-//#define PROTOCOL_DEBUG_PRINTF(fmt, ...)
-//#endif
-
-
//Server address and port
//#define HOST_NAME "api.xcloudtech.com"
//#define HOST_PORT (9000)
void mmi_protocol_fzd_receive_data_process(char * recv_str, int recv_len);
+void * mmi_protocol_fzd_send_space_ptr_get(MMI_PROTOCOL_FZD_ACTION_ENUM action);
+
+int mmi_protocol_fzd_send_space_size_get(MMI_PROTOCOL_FZD_ACTION_ENUM action);
+
+void mmi_protocol_fzd_send_space_deinit(MMI_PROTOCOL_FZD_ACTION_ENUM action);
+
+bool mmi_protocol_fzd_send_cmd_check(MMI_PROTOCOL_FZD_ACTION_ENUM action);
+
bool mmi_protocol_fzd_action_link(void);
bool mmi_protocol_fzd_parse_ACTION_LINK(unsigned char * next_buff, unsigned int next_buff_len);
//{
// Hal_Tone_Play_End();
//}
+ Hal_NFFS_File_Play_End();
Hal_Audio_Manage_End_Ind(AUDIO_CTRL_PRIORITY_SEARCH);
Hal_Vibrator_Play_End();
if(tcp_manage_instance.sock_fd > 0)
{
ret = ValSend(tcp_manage_instance.sock_fd, DT_SOCKE_REV_TIMEOUT, pkg_data, pkg_len);
- printf("fun = %s, line = %d, ret = %d\n",__FUNCTION__,__LINE__,ret);
+ printf("[@CHENG_DEBUG][%s][%d]: ret=%d\n", __FUNCTION__, __LINE__, ret);
if(ret < 0){
send_task_msg_tcp_reconnect(NULL);
}
void mmi_modem_tcp_task_init(void)
{
mmi_modem_tcp_task_interface_init();
+
+#ifdef __MMI_ZHSX_SUPPORT__
+ printf("[@CHENG_DEBUG][%s][%d]: \n",__FUNCTION__,__LINE__);
+
+ launcher_tcp_connect(NULL);
+
+#else
launcher_tcp_connect(tcp_connect_cb);
//while(1)
// {
// uos_sleep(3);
// }
uart_printf("mmi_modem_tcp_task_init!!!!!!!\n");
+#endif
}
tcp_manage_instance_t * get_manage_instance(void)