4 * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Youngae Kang <youngae.kang@samsung.com>, Minjune Kim <sena06.kim@samsung.com>
7 * Genie Kim <daejins.kim@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
31 #include <gps_plugin_intf.h>
32 #include <dd-display.h>
34 #include "gps_plugin_debug.h"
35 #include "nmea_parser.h"
38 #define REPLAY_NMEA_SET_SIZE 4096
39 #define REPLAY_NMEA_SENTENCE_SIZE 128
41 #define LBS_SERVER_FOLDER "/opt/usr/media/lbs-server"
42 #define BATCH_LOG LBS_SERVER_FOLDER"/location_batch.log"
44 gps_event_cb g_gps_event_cb = NULL;
45 void *g_user_data = NULL;
56 time_t batch_start_time;
59 batch_data_t *batch_data;
61 nmea_data_t *nmea_data;
64 GMainContext *default_context;
67 replay_timeout *g_replay_timer = NULL;
69 int gps_plugin_replay_gps_init(gps_event_cb gps_event_cb, void *user_data);
70 int gps_plugin_replay_gps_deinit(gps_failure_reason_t * reason_code);
71 int gps_plugin_replay_gps_request(gps_action_t gps_action, void *gps_action_data, gps_failure_reason_t * reason_code);
73 static const gps_plugin_interface g_gps_plugin_replay_interface = {
74 gps_plugin_replay_gps_init,
75 gps_plugin_replay_gps_deinit,
76 gps_plugin_replay_gps_request
79 void gps_plugin_replay_pos_event(pos_data_t * data)
81 gps_event_info_t gps_event;
84 memset(&gps_event, 0, sizeof(gps_event_info_t));
87 gps_event.event_id = GPS_EVENT_REPORT_POSITION;
90 LOG_PLUGIN(DBG_ERR, "NULL POS data.");
91 gps_event.event_data.pos_ind.error = GPS_ERR_COMMUNICATION;
93 gps_event.event_data.pos_ind.error = GPS_ERR_NONE;
94 gps_event.event_data.pos_ind.pos.timestamp = timestamp;
95 gps_event.event_data.pos_ind.pos.latitude = data->latitude;
96 gps_event.event_data.pos_ind.pos.longitude = data->longitude;
97 gps_event.event_data.pos_ind.pos.altitude = data->altitude;
98 gps_event.event_data.pos_ind.pos.speed = data->speed;
99 gps_event.event_data.pos_ind.pos.bearing = data->bearing;
100 gps_event.event_data.pos_ind.pos.hor_accuracy = data->hor_accuracy;
101 gps_event.event_data.pos_ind.pos.ver_accuracy = data->ver_accuracy;
104 if (g_gps_event_cb != NULL) {
105 g_gps_event_cb(&gps_event, g_user_data);
109 void gps_plugin_replay_batch_event(pos_data_t * data, replay_timeout * timer)
114 if (timer->batch_fd == NULL) {
115 if (timer->batch_mode == BATCH_MODE_ON) {
117 struct stat st = {0};
118 if (stat(LBS_SERVER_FOLDER, &st) == -1) {
119 if (mkdir(LBS_SERVER_FOLDER, 0777) == -1) {
120 LOG_PLUGIN(DBG_ERR, "Fail to create lbs-server folder");
125 timer->batch_fd = fopen(BATCH_LOG, "w+");
126 if (timer->batch_fd == NULL) {
127 LOG_PLUGIN(DBG_ERR, "Fail to open file [Not available batch_fd]");
134 if (timer->batch_mode == BATCH_MODE_ON) {
136 char buf[256] = {0, };
138 g_snprintf(buf, 256, "%ld;%.6lf;%.6lf;%.2lf;%.2lf;%.2lf;%.2lf;%.2lf;\n", timestamp, data->latitude, data->longitude, data->altitude, data->speed, data->bearing, data->hor_accuracy, data->ver_accuracy);
139 LOG_PLUGIN(DBG_LOW, "Add location info to batch file [%s]", buf);
141 ret = fwrite(buf, 1, strlen(buf), timer->batch_fd);
142 if (ret != strlen(buf)) {
143 LOG_PLUGIN(DBG_ERR, "Fail to write file[%s]", BATCH_LOG);
146 (timer->num_of_batch)++ ;
150 if ((timestamp - timer->batch_start_time) >= timer->batch_period) {
151 LOG_PLUGIN(DBG_LOW, "Batch invoked, Batch interval is expired or Batch stopped");
152 gps_event_info_t gps_event;
153 memset(&gps_event, 0, sizeof(gps_event_info_t));
155 gps_event.event_id = GPS_EVENT_REPORT_BATCH;
156 timer->batch_start_time = timestamp;
158 if (timer->num_of_batch < 1) {
159 LOG_PLUGIN(DBG_ERR, "There is no Batch data");
160 gps_event.event_data.batch_ind.error = GPS_ERR_COMMUNICATION;
162 gps_event.event_data.batch_ind.error = GPS_ERR_NONE;
163 gps_event.event_data.batch_ind.batch.num_of_location = timer->num_of_batch;
166 if (g_gps_event_cb != NULL) {
167 g_gps_event_cb(&gps_event, g_user_data);
168 timer->num_of_batch = 0;
171 if (timer->batch_fd != NULL) {
172 fclose(timer->batch_fd);
173 timer->batch_fd = NULL;
178 void gps_plugin_replay_sv_event(sv_data_t * data)
181 gps_event_info_t gps_event;
184 memset(&gps_event, 0, sizeof(gps_event_info_t));
186 gps_event.event_id = GPS_EVENT_REPORT_SATELLITE;
189 LOG_PLUGIN(DBG_ERR, "NULL SV data.");
190 gps_event.event_data.sv_ind.error = GPS_ERR_COMMUNICATION;
192 gps_event.event_data.sv_ind.error = GPS_ERR_NONE;
193 gps_event.event_data.sv_ind.sv.timestamp = timestamp;
194 gps_event.event_data.sv_ind.sv.pos_valid = data->pos_valid;
195 gps_event.event_data.sv_ind.sv.num_of_sat = data->num_of_sat;
196 for (i = 0; i < data->num_of_sat; i++) {
197 gps_event.event_data.sv_ind.sv.sat[i].used = data->sat[i].used;
198 gps_event.event_data.sv_ind.sv.sat[i].prn = data->sat[i].prn;
199 gps_event.event_data.sv_ind.sv.sat[i].snr = data->sat[i].snr;
200 gps_event.event_data.sv_ind.sv.sat[i].elevation = data->sat[i].elevation;
201 gps_event.event_data.sv_ind.sv.sat[i].azimuth = data->sat[i].azimuth;
205 if (g_gps_event_cb != NULL) {
206 g_gps_event_cb(&gps_event, g_user_data);
210 void gps_plugin_replay_nmea_event(nmea_data_t * data)
212 gps_event_info_t gps_event;
215 memset(&gps_event, 0, sizeof(gps_event_info_t));
218 gps_event.event_id = GPS_EVENT_REPORT_NMEA;
221 LOG_PLUGIN(DBG_ERR, "NULL NMEA data.");
222 gps_event.event_data.nmea_ind.error = GPS_ERR_COMMUNICATION;
224 if (data->len > REPLAY_NMEA_SENTENCE_SIZE) {
225 LOG_PLUGIN(DBG_WARN, "The Size of NMEA[ %d ] is larger then max ", data->len);
226 data->len = REPLAY_NMEA_SENTENCE_SIZE;
227 gps_event.event_data.nmea_ind.error = GPS_ERR_COMMUNICATION;
229 gps_event.event_data.nmea_ind.error = GPS_ERR_NONE;
231 gps_event.event_data.nmea_ind.nmea.timestamp = timestamp;
232 gps_event.event_data.nmea_ind.nmea.len = data->len;
233 gps_event.event_data.nmea_ind.nmea.data = (char *)malloc(data->len);
234 g_return_if_fail(gps_event.event_data.nmea_ind.nmea.data);
236 memset(gps_event.event_data.nmea_ind.nmea.data, 0x00, data->len);
237 memcpy(gps_event.event_data.nmea_ind.nmea.data, data->data, data->len);
240 if (g_gps_event_cb != NULL) {
241 g_gps_event_cb(&gps_event, g_user_data);
244 if (gps_event.event_data.nmea_ind.nmea.data != NULL) {
245 free(gps_event.event_data.nmea_ind.nmea.data);
246 gps_event.event_data.nmea_ind.nmea.data = NULL;
250 void gps_plugin_respond_start_session(gboolean ret)
252 gps_event_info_t gps_event;
253 gps_event.event_id = GPS_EVENT_START_SESSION;
256 gps_event.event_data.start_session_rsp.error = GPS_ERR_NONE;
258 gps_event.event_data.start_session_rsp.error = GPS_ERR_COMMUNICATION;
261 if (g_gps_event_cb != NULL) {
262 g_gps_event_cb(&gps_event, g_user_data);
266 void gps_plugin_respond_stop_session(void)
268 gps_event_info_t gps_event;
270 gps_event.event_id = GPS_EVENT_STOP_SESSION;
271 gps_event.event_data.stop_session_rsp.error = GPS_ERR_NONE;
273 if (g_gps_event_cb != NULL) {
274 g_gps_event_cb(&gps_event, g_user_data);
278 gboolean gps_plugin_replay_read_nmea(replay_timeout * timer, char *nmea_data)
280 gboolean ret = FALSE;
282 char buf[REPLAY_NMEA_SENTENCE_SIZE] = { 0, };
284 if (timer->fd == NULL) {
285 LOG_PLUGIN(DBG_ERR, "nmea fd is NULL");
289 if (nmea_data == NULL) {
290 LOG_PLUGIN(DBG_ERR, "nmea_data is NULL");
296 while (fgets(buf, REPLAY_NMEA_SENTENCE_SIZE, timer->fd) != NULL) {
297 if (strncmp(buf, "$GPGGA", 6) == 0) {
300 fseek(timer->fd, -strlen(buf), SEEK_CUR);
301 LOG_PLUGIN(DBG_LOW, "2nd GPGGA : stop to read nmea data");
304 } else if (ref == 1) {
305 LOG_PLUGIN(DBG_LOW, "1st GPGGA : start to read nmea data");
306 strncpy(nmea_data, buf, strlen(buf));
309 if (strlen(nmea_data) + strlen(buf) > REPLAY_NMEA_SET_SIZE) {
310 LOG_PLUGIN(DBG_ERR, "read nmea data size is too long");
313 strncat(nmea_data, buf, strlen(buf));
316 timer->nmea_data->len = strlen(buf);
317 timer->nmea_data->data = buf;
318 gps_plugin_replay_nmea_event(timer->nmea_data);
321 if (feof(timer->fd)) {
322 LOG_PLUGIN(DBG_ERR, "end of file");
326 LOG_PLUGIN(DBG_LOW, "read nmea data [%s]", nmea_data);
331 gboolean gps_plugin_replay_read_manual(pos_data_t * pos_data)
335 if (setting_get_double(VCONFKEY_LOCATION_MANUAL_LATITUDE, &pos_data->latitude) == FALSE) {
336 LOG_PLUGIN(DBG_ERR, "Fail to get latitude");
339 if (setting_get_double(VCONFKEY_LOCATION_MANUAL_LONGITUDE, &pos_data->longitude) == FALSE) {
340 LOG_PLUGIN(DBG_ERR, "Fail to get longitude");
343 if (setting_get_double(VCONFKEY_LOCATION_MANUAL_ALTITUDE, &pos_data->altitude) == FALSE) {
344 LOG_PLUGIN(DBG_ERR, "Fail to get altitude");
351 gboolean gps_plugin_replay_timeout_cb(gpointer data)
353 gboolean ret = FALSE;
354 read_error_t err = READ_SUCCESS;
355 char nmea_data[REPLAY_NMEA_SET_SIZE] = { 0, };
356 replay_timeout *timer = (replay_timeout *) data;
359 LOG_PLUGIN(DBG_ERR, "replay handel[timer] is NULL");
363 memset(timer->pos_data, 0, sizeof(pos_data_t));
364 memset(timer->batch_data, 0, sizeof(batch_data_t));
365 memset(timer->sv_data, 0, sizeof(sv_data_t));
367 if (timer->replay_mode == REPLAY_NMEA) {
368 if (gps_plugin_replay_read_nmea(timer, nmea_data) == FALSE) {
369 LOG_PLUGIN(DBG_ERR, "Fail to read nmea data from file");
372 err = nmea_parser(nmea_data, timer->pos_data, timer->sv_data);
373 if (err == READ_ERROR) {
374 LOG_PLUGIN(DBG_ERR, "Fail to parser nmea data from file");
376 } else if (err == READ_NOT_FIXED) {
377 LOG_PLUGIN(DBG_LOW, "GPS position is not fixed");
378 timer->sv_data->pos_valid = FALSE;
381 } else if (timer->replay_mode == REPLAY_MANUAL) {
382 if (gps_plugin_replay_read_manual(timer->pos_data) == FALSE) {
383 LOG_PLUGIN(DBG_ERR, "Fail to read manual data");
387 timer->sv_data->pos_valid = TRUE;
390 } else if (timer->replay_mode == REPLAY_OFF) {
391 LOG_PLUGIN(DBG_WARN, "replay_mode is OFF");
392 err = READ_NOT_FIXED;
393 timer->sv_data->pos_valid = FALSE;
396 if (g_gps_event_cb != NULL) {
397 if (err != READ_NOT_FIXED) {
398 gps_plugin_replay_pos_event(timer->pos_data);
400 gps_plugin_replay_sv_event(timer->sv_data);
406 gboolean gps_plugin_batch_replay_timeout_cb(gpointer data)
408 gboolean ret = FALSE;
409 read_error_t err = READ_SUCCESS;
410 char nmea_data[REPLAY_NMEA_SET_SIZE] = { 0, };
411 replay_timeout *timer = (replay_timeout *) data;
414 LOG_PLUGIN(DBG_ERR, "replay handel[timer] is NULL");
418 memset(timer->pos_data, 0, sizeof(pos_data_t));
419 memset(timer->batch_data, 0, sizeof(batch_data_t));
420 memset(timer->sv_data, 0, sizeof(sv_data_t));
422 if (timer->replay_mode == REPLAY_NMEA) {
423 if (gps_plugin_replay_read_nmea(timer, nmea_data) == FALSE) {
424 LOG_PLUGIN(DBG_ERR, "Fail to read nmea data from file");
427 err = nmea_parser(nmea_data, timer->pos_data, timer->sv_data);
428 if (err == READ_ERROR) {
429 LOG_PLUGIN(DBG_ERR, "Fail to parser nmea data from file");
430 } else if (err == READ_NOT_FIXED) {
431 LOG_PLUGIN(DBG_LOW, "GPS position is not fixed");
432 timer->sv_data->pos_valid = FALSE;
435 } else if (timer->replay_mode == REPLAY_MANUAL) {
436 if (gps_plugin_replay_read_manual(timer->pos_data) == FALSE) {
437 LOG_PLUGIN(DBG_ERR, "Fail to read manual data");
441 timer->sv_data->pos_valid = TRUE;
444 } else if (timer->replay_mode == REPLAY_OFF) {
445 LOG_PLUGIN(DBG_WARN, "replay_mode is OFF");
446 err = READ_NOT_FIXED;
447 timer->sv_data->pos_valid = FALSE;
450 if (g_gps_event_cb != NULL) {
451 if (timer->batch_mode == BATCH_MODE_ON){
452 gps_plugin_replay_batch_event(timer->pos_data, timer);
459 void gps_plugin_stop_replay_mode(replay_timeout * timer)
461 if (timer->replay_mode == REPLAY_NMEA && fclose(timer->fd) != 0) {
462 LOG_PLUGIN(DBG_ERR, "fclose failed");
466 if (timer->timeout_src != NULL && timer->default_context != NULL && !g_source_is_destroyed(timer->timeout_src)) {
467 if (timer->default_context == g_source_get_context(timer->timeout_src)) {
468 g_source_destroy(timer->timeout_src);
469 LOG_PLUGIN(DBG_LOW, "g_source_destroy timeout_src");
471 LOG_PLUGIN(DBG_WARN, "timer->timeout_src is attatched to 0x%x (actual 0x%x)",
472 g_source_get_context(timer->timeout_src), timer->default_context);
474 timer->timeout_src = NULL;
475 timer->default_context = NULL;
477 LOG_PLUGIN(DBG_WARN, "timeout_src or default_context is NULL or timeout_src is already destroyed");
479 gps_plugin_respond_stop_session();
481 display_unlock_state(LCD_OFF, PM_RESET_TIMER);
482 LOG_PLUGIN(DBG_LOW, "display_unlock_state(LCD_OFF, PM_RESET_TIMER);");
485 gboolean gps_plugin_get_nmea_fd(replay_timeout * timer)
487 char replay_file_path[256];
490 str = setting_get_string(VCONFKEY_LOCATION_NMEA_FILE_NAME);
494 snprintf(replay_file_path, sizeof(replay_file_path), NMEA_FILE_PATH"%s", str);
495 SECLOG_PLUGIN(DBG_ERR, "replay file name : %s", replay_file_path);
498 timer->fd = fopen(replay_file_path, "r");
499 if (timer->fd == NULL) {
500 SECLOG_PLUGIN(DBG_ERR, "fopen(%s) failed", replay_file_path);
501 timer->fd = fopen(DEFAULT_NMEA_LOG, "r");
502 if (timer->fd == NULL) {
503 SECLOG_PLUGIN(DBG_ERR, "fopen(%s) failed", DEFAULT_NMEA_LOG);
510 gboolean gps_plugin_start_replay_mode(replay_timeout * timer)
512 gboolean ret = FALSE;
514 if (timer->replay_mode == REPLAY_NMEA) {
515 if (gps_plugin_get_nmea_fd(timer) == FALSE) {
520 if (timer->default_context == NULL) {
521 timer->default_context = g_main_context_default();
522 if (timer->default_context == NULL) {
527 if (timer->timeout_src != NULL) {
528 LOG_PLUGIN(DBG_ERR, "timeout_src is already existed");
531 timer->timeout_src = g_timeout_source_new_seconds(timer->interval);
532 if (timer->timeout_src != NULL) {
533 g_source_set_callback(timer->timeout_src, &gps_plugin_replay_timeout_cb, timer, NULL);
534 if (g_source_attach(timer->timeout_src, timer->default_context) > 0) {
535 LOG_PLUGIN(DBG_LOW, "timeout_src(0x%x) is created & attatched to 0x%x", timer->timeout_src,
536 timer->default_context);
539 gps_plugin_stop_replay_mode(timer);
545 display_lock_state(LCD_OFF, STAY_CUR_STATE, 0);
546 LOG_PLUGIN(DBG_LOW, "display_lock_state(LCD_OFF, STAY_CUR_STATE, 0);");
548 gps_plugin_respond_start_session(ret);
553 gboolean gps_plugin_start_batch_mode(replay_timeout * timer, int batch_interval, int batch_period)
555 gboolean ret = FALSE;
559 if (timer->replay_mode == REPLAY_NMEA) {
560 if (gps_plugin_get_nmea_fd(timer) == FALSE) {
565 if (timer->default_context == NULL) {
566 timer->default_context = g_main_context_default();
567 if (timer->default_context == NULL) {
572 if (timer->timeout_src != NULL) {
573 LOG_PLUGIN(DBG_ERR, "timeout_src is already existed");
576 timer->timeout_src = g_timeout_source_new_seconds(batch_interval);
577 if (timer->timeout_src != NULL) {
578 g_source_set_callback(timer->timeout_src, &gps_plugin_batch_replay_timeout_cb, timer, NULL);
579 if (g_source_attach(timer->timeout_src, timer->default_context) > 0) {
580 LOG_PLUGIN(DBG_LOW, "timeout_src(0x%x) is created & attatched to 0x%x", timer->timeout_src, timer->default_context);
583 gps_plugin_stop_replay_mode(timer);
589 gps_plugin_respond_start_session(ret);
591 timer->batch_mode = BATCH_MODE_ON;
592 timer->batch_period = batch_period;
593 timer->batch_start_time = timestamp;
598 void gps_plugin_stop_batch_mode(replay_timeout * timer)
600 if (timer->batch_mode == BATCH_MODE_ON) {
601 timer->batch_mode = BATCH_MODE_OFF;
604 if (timer->batch_fd != NULL) {
605 fclose(timer->batch_fd);
606 timer->batch_fd = NULL;
607 timer->num_of_batch = 0;
611 static void replay_mode_changed_cb(keynode_t * key, void *data)
613 if (setting_get_int(VCONFKEY_LOCATION_REPLAY_MODE, &g_replay_timer->replay_mode) == FALSE) {
614 g_replay_timer->replay_mode = REPLAY_OFF;
617 if (g_replay_timer->replay_mode == REPLAY_NMEA) {
618 if (gps_plugin_get_nmea_fd(g_replay_timer) == FALSE) {
619 LOG_PLUGIN(DBG_ERR, "Fail to get nmea fd.");
622 if (g_replay_timer->fd != NULL) {
623 fclose(g_replay_timer->fd);
624 g_replay_timer->fd = NULL;
630 replay_timeout *gps_plugin_replay_timer_init()
632 replay_timeout *timer = NULL;
634 timer = (replay_timeout *) malloc(sizeof(replay_timeout));
636 LOG_PLUGIN(DBG_ERR, "replay_timeout allocation is failed.");
643 timer->batch_fd = NULL;
644 timer->num_of_batch = 0;
645 timer->batch_mode = BATCH_MODE_OFF;
647 if (setting_get_int(VCONFKEY_LOCATION_REPLAY_MODE, &timer->replay_mode) == FALSE) {
648 timer->replay_mode = REPLAY_OFF;
650 setting_notify_key_changed(VCONFKEY_LOCATION_REPLAY_MODE, replay_mode_changed_cb);
652 timer->pos_data = (pos_data_t *) malloc(sizeof(pos_data_t));
653 if (timer->pos_data == NULL) {
654 LOG_PLUGIN(DBG_ERR, "pos_data allocation is failed.");
659 timer->batch_data = (batch_data_t *) malloc(sizeof(batch_data_t));
660 if (timer->batch_data == NULL) {
661 LOG_PLUGIN(DBG_ERR, "batch_data allocation is failed.");
662 free(timer->pos_data);
667 timer->sv_data = (sv_data_t *) malloc(sizeof(sv_data_t));
668 if (timer->sv_data == NULL) {
669 LOG_PLUGIN(DBG_ERR, "sv_data allocation is failed.");
670 free(timer->pos_data);
671 free(timer->batch_data);
676 timer->nmea_data = (nmea_data_t *) malloc(sizeof(nmea_data_t));
677 if (timer->nmea_data == NULL) {
678 LOG_PLUGIN(DBG_ERR, "nmea_data allocation is failed.");
679 free(timer->pos_data);
680 free(timer->batch_data);
681 free(timer->sv_data);
686 timer->timeout_src = NULL;
687 timer->default_context = NULL;
692 void gps_plugin_replay_timer_deinit(replay_timeout * timer)
698 if (timer->pos_data != NULL) {
699 free(timer->pos_data);
700 timer->pos_data = NULL;
702 if (timer->sv_data != NULL) {
703 free(timer->sv_data);
704 timer->sv_data = NULL;
706 if (timer->nmea_data != NULL) {
707 free(timer->nmea_data);
708 timer->nmea_data = NULL;
711 setting_ignore_key_changed(VCONFKEY_LOCATION_REPLAY_MODE, replay_mode_changed_cb);
717 int gps_plugin_replay_gps_init(gps_event_cb gps_event_cb, void *user_data)
719 g_gps_event_cb = gps_event_cb;
720 g_replay_timer = gps_plugin_replay_timer_init();
721 g_user_data = user_data;
726 int gps_plugin_replay_gps_deinit(gps_failure_reason_t * reason_code)
728 gps_plugin_replay_timer_deinit(g_replay_timer);
729 g_gps_event_cb = NULL;
735 int gps_plugin_replay_gps_request(gps_action_t gps_action, void *gps_action_data, gps_failure_reason_t * reason_code)
737 gps_action_start_data_t *gps_start_data = gps_action_data;
739 switch (gps_action) {
740 case GPS_ACTION_SEND_PARAMS:
742 case GPS_ACTION_START_SESSION:
743 gps_plugin_start_replay_mode(g_replay_timer);
745 case GPS_ACTION_STOP_SESSION:
746 gps_plugin_stop_replay_mode(g_replay_timer);
748 case GPS_ACTION_START_BATCH:
749 gps_plugin_start_batch_mode(g_replay_timer, gps_start_data->interval, gps_start_data->period);
751 case GPS_ACTION_STOP_BATCH:
752 gps_plugin_stop_batch_mode(g_replay_timer);
753 gps_plugin_stop_replay_mode(g_replay_timer);
755 case GPS_INDI_SUPL_VERIFICATION:
756 case GPS_INDI_SUPL_DNSQUERY:
757 case GPS_ACTION_START_FACTTEST:
758 case GPS_ACTION_STOP_FACTTEST:
759 case GPS_ACTION_REQUEST_SUPL_NI:
760 LOG_PLUGIN(DBG_LOW, "Don't use action type : [ %d ]", gps_action);
769 EXPORT_API const gps_plugin_interface *get_gps_plugin_interface()
771 return &g_gps_plugin_replay_interface;