diff options
Diffstat (limited to 'replay-plugin/src/gps_plugin_replay.c')
-rw-r--r-- | replay-plugin/src/gps_plugin_replay.c | 54 |
1 files changed, 30 insertions, 24 deletions
diff --git a/replay-plugin/src/gps_plugin_replay.c b/replay-plugin/src/gps_plugin_replay.c index 1cb8aa8..343fa6f 100644 --- a/replay-plugin/src/gps_plugin_replay.c +++ b/replay-plugin/src/gps_plugin_replay.c @@ -1,10 +1,10 @@ /* - * GPS manager replay plugin + * gps-manager replay plugin * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved. + * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd. All rights reserved. * - * Contact: Youngae Kang <youngae.kang@samsung.com>, Yunhan Kim <yhan.kim@samsung.com>, - * Genie Kim <daejins.kim@samsung.com>, Minjune Kim <sena06.kim@samsung.com> + * Contact: Youngae Kang <youngae.kang@samsung.com>, Minjune Kim <sena06.kim@samsung.com> + * Genie Kim <daejins.kim@samsung.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -87,7 +87,7 @@ void gps_plugin_replay_pos_event(pos_data_t * data) gps_event.event_data.pos_ind.pos.ver_accuracy = data->ver_accuracy; } - //LOG_PLUGIN(DBG_LOW, "%d / %f / %f / %f", gps_event.event_data.pos_ind.pos.timestamp, gps_event.event_data.pos_ind.pos.latitude, gps_event.event_data.pos_ind.pos.longitude, gps_event.event_data.pos_ind.pos.altitude); + //LOG_PLUGIN(DBG_LOW, "%d", gps_event.event_data.pos_ind.pos.timestamp); if (g_gps_event_cb != NULL) { g_gps_event_cb(&gps_event); @@ -270,8 +270,13 @@ gboolean gps_plugin_replay_timeout_cb(gpointer data) { gboolean ret = FALSE; read_error_t err = READ_SUCCESS; - replay_timeout *timer = (replay_timeout *) data; char nmea_data[REPLAY_NMEA_SET_SIZE] = { 0, }; + replay_timeout *timer = (replay_timeout *) data; + + if (timer == NULL) { + LOG_PLUGIN(DBG_ERR, "replay handel[timer] is NULL"); + return FALSE; + } memset(timer->pos_data, 0, sizeof(pos_data_t)); memset(timer->sv_data, 0, sizeof(sv_data_t)); @@ -433,27 +438,28 @@ replay_timeout *gps_plugin_replay_timer_init() setting_notify_key_changed(VCONFKEY_LOCATION_REPLAY_MODE, replay_mode_changed_cb); timer->pos_data = (pos_data_t *) malloc(sizeof(pos_data_t)); - if (timer->pos_data == NULL) { - LOG_PLUGIN(DBG_ERR, "pos_data allocation is failed."); - free(timer); - return NULL; - } + if (timer->pos_data == NULL) { + LOG_PLUGIN(DBG_ERR, "pos_data allocation is failed."); + free(timer); + return NULL; + } + timer->sv_data = (sv_data_t *) malloc(sizeof(sv_data_t)); - if (timer->sv_data == NULL) { - LOG_PLUGIN(DBG_ERR, "sv_data allocation is failed."); - free(timer->pos_data); - free(timer); - return NULL; - } + if (timer->sv_data == NULL) { + LOG_PLUGIN(DBG_ERR, "sv_data allocation is failed."); + free(timer->pos_data); + free(timer); + return NULL; + } timer->nmea_data = (nmea_data_t *) malloc(sizeof(nmea_data_t)); - if (timer->nmea_data == NULL) { - LOG_PLUGIN(DBG_ERR, "nmea_data allocation is failed."); - free(timer->pos_data); - free(timer->sv_data); - free(timer); - return NULL; - } + if (timer->nmea_data == NULL) { + LOG_PLUGIN(DBG_ERR, "nmea_data allocation is failed."); + free(timer->pos_data); + free(timer->sv_data); + free(timer); + return NULL; + } timer->timeout_src = NULL; timer->default_context = NULL; |