4 * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
28 #include <gps_plugin_intf.h>
29 #include <dd-display.h>
30 #include <tzplatform_config.h>
32 #include "gps_plugin_debug.h"
33 #include "nmea_parser.h"
36 #define REPLAY_NMEA_SET_SIZE 4096
37 #define REPLAY_NMEA_SENTENCE_SIZE 128
40 gps_event_cb g_gps_event_cb = NULL;
41 void *g_user_data = NULL;
50 int batch_client_count;
55 time_t batch_start_time;
59 batch_data_t *batch_data;
61 nmea_data_t *nmea_data;
62 pos_data_t *batch_buf;
65 GMainContext *default_context;
68 replay_timeout *g_replay_timer = NULL;
70 int gps_plugin_replay_gps_init(gps_event_cb gps_event_cb, void *user_data);
71 int gps_plugin_replay_gps_deinit(gps_failure_reason_t *reason_code);
72 int gps_plugin_replay_gps_request(gps_action_t gps_action, void *gps_action_data, gps_failure_reason_t *reason_code);
74 static const gps_plugin_interface g_gps_plugin_replay_interface = {
75 gps_plugin_replay_gps_init,
76 gps_plugin_replay_gps_deinit,
77 gps_plugin_replay_gps_request
80 void gps_plugin_replay_pos_event(pos_data_t *data)
82 gps_event_info_t gps_event;
85 memset(&gps_event, 0, sizeof(gps_event_info_t));
88 gps_event.event_id = GPS_EVENT_REPORT_POSITION;
91 LOG_PLUGIN(DBG_ERR, "NULL POS data.");
92 gps_event.event_data.pos_ind.error = GPS_ERR_COMMUNICATION;
94 gps_event.event_data.pos_ind.error = GPS_ERR_NONE;
95 gps_event.event_data.pos_ind.pos.timestamp = timestamp;
96 gps_event.event_data.pos_ind.pos.latitude = data->latitude;
97 gps_event.event_data.pos_ind.pos.longitude = data->longitude;
98 gps_event.event_data.pos_ind.pos.altitude = data->altitude;
99 gps_event.event_data.pos_ind.pos.speed = data->speed;
100 gps_event.event_data.pos_ind.pos.bearing = data->bearing;
101 gps_event.event_data.pos_ind.pos.hor_accuracy = data->hor_accuracy;
102 gps_event.event_data.pos_ind.pos.ver_accuracy = data->ver_accuracy;
105 if (g_gps_event_cb != NULL)
106 g_gps_event_cb(&gps_event, g_user_data);
109 void add_batch_data(pos_data_t *data, replay_timeout *timer, int idx, time_t timestamp)
111 timer->batch_buf[idx].timestamp = timestamp;
112 timer->batch_buf[idx].latitude = data->latitude;
113 timer->batch_buf[idx].longitude = data->longitude;
114 timer->batch_buf[idx].altitude = data->altitude;
115 timer->batch_buf[idx].speed = data->speed;
116 timer->batch_buf[idx].bearing = data->bearing;
117 timer->batch_buf[idx].hor_accuracy = data->hor_accuracy;
118 timer->batch_buf[idx].ver_accuracy = data->ver_accuracy;
121 void gps_plugin_replay_batch_event(pos_data_t *data, replay_timeout *timer)
126 if (timer->num_of_batch < 1) {
127 if (timer->batch_buf) {
128 free(timer->batch_buf);
129 timer->batch_buf = NULL;
132 int size = timer->batch_period / timer->batch_interval;
133 timer->batch_buf = (pos_data_t *) malloc(sizeof(pos_data_t) * size);
134 LOG_PLUGIN(DBG_LOW, "--> set batch_buf[size : %d]", size);
135 timer->batch_buf_size = size;
138 if (timer->lcd_mode == VCONFKEY_PM_STATE_NORMAL) {
140 if (timer->num_of_batch < timer->batch_buf_size) {
141 add_batch_data(data, timer, timer->num_of_batch, timestamp);
142 (timer->num_of_batch)++ ;
144 timer->is_flush = TRUE;
146 if ((timestamp - timer->batch_start_time) % timer->batch_interval == 0) {
148 if (timer->num_of_batch < timer->batch_buf_size) {
149 add_batch_data(data, timer, timer->num_of_batch, timestamp);
150 (timer->num_of_batch)++ ;
154 if ((timestamp - timer->batch_start_time) >= timer->batch_period)
155 timer->is_flush = TRUE;
159 * invoke collected postion infomations in every batch period.
161 if (timer->is_flush) {
162 LOG_PLUGIN(DBG_LOW, "Batch invoked, Batch interval is expired or Batch stopped");
163 gps_event_info_t gps_event;
164 memset(&gps_event, 0, sizeof(gps_event_info_t));
166 gps_event.event_id = GPS_EVENT_REPORT_BATCH;
167 timer->batch_start_time = timestamp;
168 timer->is_flush = FALSE;
170 if (timer->num_of_batch < 1) {
171 LOG_PLUGIN(DBG_ERR, "There is no Batch data");
172 gps_event.event_data.batch_ind.error = GPS_ERR_COMMUNICATION;
174 gps_event.event_data.batch_ind.error = GPS_ERR_NONE;
175 gps_event.event_data.batch_ind.batch.num_of_location = timer->num_of_batch;
176 gps_event.event_data.batch_ind.batch.data = timer->batch_buf;
179 if (g_gps_event_cb != NULL) {
180 g_gps_event_cb(&gps_event, g_user_data);
181 timer->num_of_batch = 0;
186 void gps_plugin_replay_sv_event(sv_data_t *data)
189 gps_event_info_t gps_event;
192 memset(&gps_event, 0, sizeof(gps_event_info_t));
194 gps_event.event_id = GPS_EVENT_REPORT_SATELLITE;
197 LOG_PLUGIN(DBG_ERR, "NULL SV data.");
198 gps_event.event_data.sv_ind.error = GPS_ERR_COMMUNICATION;
200 gps_event.event_data.sv_ind.error = GPS_ERR_NONE;
201 gps_event.event_data.sv_ind.sv.timestamp = timestamp;
202 gps_event.event_data.sv_ind.sv.pos_valid = data->pos_valid;
203 gps_event.event_data.sv_ind.sv.num_of_sat = data->num_of_sat;
204 for (i = 0; i < data->num_of_sat; i++) {
205 gps_event.event_data.sv_ind.sv.sat[i].used = data->sat[i].used;
206 gps_event.event_data.sv_ind.sv.sat[i].prn = data->sat[i].prn;
207 gps_event.event_data.sv_ind.sv.sat[i].snr = data->sat[i].snr;
208 gps_event.event_data.sv_ind.sv.sat[i].elevation = data->sat[i].elevation;
209 gps_event.event_data.sv_ind.sv.sat[i].azimuth = data->sat[i].azimuth;
213 if (g_gps_event_cb != NULL)
214 g_gps_event_cb(&gps_event, g_user_data);
217 void gps_plugin_replay_nmea_event(nmea_data_t *data)
219 gps_event_info_t gps_event;
222 memset(&gps_event, 0, sizeof(gps_event_info_t));
225 gps_event.event_id = GPS_EVENT_REPORT_NMEA;
228 LOG_PLUGIN(DBG_ERR, "NULL NMEA data.");
229 gps_event.event_data.nmea_ind.error = GPS_ERR_COMMUNICATION;
231 if (data->len > REPLAY_NMEA_SENTENCE_SIZE) {
232 LOG_PLUGIN(DBG_WARN, "The Size of NMEA[ %d ] is larger then max ", data->len);
233 data->len = REPLAY_NMEA_SENTENCE_SIZE;
234 gps_event.event_data.nmea_ind.error = GPS_ERR_COMMUNICATION;
236 gps_event.event_data.nmea_ind.error = GPS_ERR_NONE;
238 gps_event.event_data.nmea_ind.nmea.timestamp = timestamp;
239 gps_event.event_data.nmea_ind.nmea.len = data->len;
240 gps_event.event_data.nmea_ind.nmea.data = (char *)malloc(data->len);
241 g_return_if_fail(gps_event.event_data.nmea_ind.nmea.data);
243 memset(gps_event.event_data.nmea_ind.nmea.data, 0x00, data->len);
244 memcpy(gps_event.event_data.nmea_ind.nmea.data, data->data, data->len);
247 if (g_gps_event_cb != NULL)
248 g_gps_event_cb(&gps_event, g_user_data);
250 if (gps_event.event_data.nmea_ind.nmea.data != NULL) {
251 free(gps_event.event_data.nmea_ind.nmea.data);
252 gps_event.event_data.nmea_ind.nmea.data = NULL;
256 void gps_plugin_respond_start_session(gboolean ret)
258 gps_event_info_t gps_event;
259 gps_event.event_id = GPS_EVENT_START_SESSION;
262 gps_event.event_data.start_session_rsp.error = GPS_ERR_NONE;
264 gps_event.event_data.start_session_rsp.error = GPS_ERR_COMMUNICATION;
266 if (g_gps_event_cb != NULL)
267 g_gps_event_cb(&gps_event, g_user_data);
270 void gps_plugin_respond_stop_session(void)
272 gps_event_info_t gps_event;
274 gps_event.event_id = GPS_EVENT_STOP_SESSION;
275 gps_event.event_data.stop_session_rsp.error = GPS_ERR_NONE;
277 if (g_gps_event_cb != NULL)
278 g_gps_event_cb(&gps_event, g_user_data);
281 gboolean gps_plugin_replay_read_nmea(replay_timeout *timer, char *nmea_data)
283 gboolean ret = FALSE;
285 char buf[REPLAY_NMEA_SENTENCE_SIZE] = { 0, };
287 if (timer->fd == NULL) {
288 LOG_PLUGIN(DBG_ERR, "nmea fd is NULL");
292 if (nmea_data == NULL) {
293 LOG_PLUGIN(DBG_ERR, "nmea_data is NULL");
299 while (fgets(buf, REPLAY_NMEA_SENTENCE_SIZE, timer->fd) != NULL) {
300 size_t buf_len = strlen(buf);
301 if (strncmp(buf, "$GPGGA", 6) == 0) {
304 fseek(timer->fd, -buf_len, SEEK_CUR);
305 /* LOG_PLUGIN(DBG_LOW, "2nd GPGGA : stop to read nmea data"); */
308 } else if (ref == 1) {
309 /* LOG_PLUGIN(DBG_LOW, "1st GPGGA : start to read nmea data"); */
310 strncpy(nmea_data, buf, MIN(buf_len, REPLAY_NMEA_SET_SIZE - 1));
313 size_t nmea_data_len = strlen(nmea_data);
314 if ((nmea_data_len + buf_len) > (REPLAY_NMEA_SET_SIZE - 1)) {
315 LOG_PLUGIN(DBG_ERR, "read nmea data size is too long");
318 strncat(nmea_data, buf, REPLAY_NMEA_SET_SIZE - nmea_data_len - 1);
321 timer->nmea_data->len = buf_len;
322 timer->nmea_data->data = buf;
323 gps_plugin_replay_nmea_event(timer->nmea_data);
326 if (feof(timer->fd)) {
327 LOG_PLUGIN(DBG_ERR, "end of file");
331 /* LOG_PLUGIN(DBG_LOW, "read nmea data [%s]", nmea_data); */
336 gboolean gps_plugin_replay_read_manual(pos_data_t *pos_data)
340 if (setting_get_double(VCONFKEY_LOCATION_MANUAL_LATITUDE, &pos_data->latitude) == FALSE) {
341 LOG_PLUGIN(DBG_ERR, "Fail to get latitude");
344 if (setting_get_double(VCONFKEY_LOCATION_MANUAL_LONGITUDE, &pos_data->longitude) == FALSE) {
345 LOG_PLUGIN(DBG_ERR, "Fail to get longitude");
348 if (setting_get_double(VCONFKEY_LOCATION_MANUAL_ALTITUDE, &pos_data->altitude) == FALSE) {
349 LOG_PLUGIN(DBG_ERR, "Fail to get altitude");
356 gboolean gps_plugin_replay_timeout_cb(gpointer data)
358 gboolean ret = FALSE;
359 read_error_t err = READ_SUCCESS;
360 char nmea_data[REPLAY_NMEA_SET_SIZE] = { 0, };
361 replay_timeout *timer = (replay_timeout *) data;
364 LOG_PLUGIN(DBG_ERR, "replay handel[timer] is NULL");
368 memset(timer->pos_data, 0, sizeof(pos_data_t));
369 memset(timer->batch_data, 0, sizeof(batch_data_t));
370 memset(timer->sv_data, 0, sizeof(sv_data_t));
372 if (timer->replay_mode == REPLAY_NMEA) {
373 if (gps_plugin_replay_read_nmea(timer, nmea_data) == FALSE) {
374 LOG_PLUGIN(DBG_ERR, "Fail to read nmea data from file");
377 err = nmea_parser(nmea_data, timer->pos_data, timer->sv_data);
378 if (err == READ_ERROR) {
379 LOG_PLUGIN(DBG_ERR, "Fail to parser nmea data from file");
381 } else if (err == READ_NOT_FIXED) {
382 LOG_PLUGIN(DBG_LOW, "GPS position is not fixed");
383 timer->sv_data->pos_valid = FALSE;
386 } else if (timer->replay_mode == REPLAY_MANUAL) {
387 if (gps_plugin_replay_read_manual(timer->pos_data) == FALSE) {
388 LOG_PLUGIN(DBG_ERR, "Fail to read manual data");
392 timer->sv_data->pos_valid = TRUE;
395 } else if (timer->replay_mode == REPLAY_OFF) {
396 LOG_PLUGIN(DBG_WARN, "replay_mode is OFF");
397 err = READ_NOT_FIXED;
398 timer->sv_data->pos_valid = FALSE;
401 if (g_gps_event_cb != NULL) {
402 if (err != READ_NOT_FIXED) {
403 if (timer->batch_mode == BATCH_MODE_ON) {
404 gps_plugin_replay_batch_event(timer->pos_data, timer);
407 gps_plugin_replay_pos_event(timer->pos_data);
410 gps_plugin_replay_sv_event(timer->sv_data);
416 void gps_plugin_stop_replay_mode(replay_timeout *timer)
418 if (timer->replay_mode == REPLAY_NMEA && fclose(timer->fd) != 0)
419 LOG_PLUGIN(DBG_ERR, "fclose failed");
423 if (timer->timeout_src != NULL && timer->default_context != NULL && !g_source_is_destroyed(timer->timeout_src)) {
424 if (timer->default_context == g_source_get_context(timer->timeout_src)) {
425 g_source_destroy(timer->timeout_src);
426 LOG_PLUGIN(DBG_LOW, "g_source_destroy timeout_src");
428 LOG_PLUGIN(DBG_WARN, "timer->timeout_src is attatched to 0x%x (actual 0x%x)",
429 g_source_get_context(timer->timeout_src), timer->default_context);
431 timer->timeout_src = NULL;
432 timer->default_context = NULL;
434 LOG_PLUGIN(DBG_WARN, "timeout_src or default_context is NULL or timeout_src is already destroyed");
436 gps_plugin_respond_stop_session();
438 display_unlock_state(LCD_OFF, PM_RESET_TIMER);
439 LOG_PLUGIN(DBG_LOW, "display_unlock_state(LCD_OFF, PM_RESET_TIMER);");
442 gboolean gps_plugin_get_nmea_fd(replay_timeout *timer)
444 char replay_file_path[256];
447 str = setting_get_string(VCONFKEY_LOCATION_NMEA_FILE_NAME);
451 const char *nmea_file_path = tzplatform_mkpath(TZ_SYS_SHARE, "location/replay/");
452 snprintf(replay_file_path, sizeof(replay_file_path), "%s%s", nmea_file_path, str);
453 SECLOG_PLUGIN(DBG_ERR, "check custom replay : %s", replay_file_path);
456 timer->fd = fopen(replay_file_path, "r");
457 if (timer->fd == NULL) {
458 const char *default_nmea_log = tzplatform_mkpath(TZ_SYS_RO_ETC, "location/nmea_replay.log");
459 SECLOG_PLUGIN(DBG_ERR, "fopen failed(%s). loading default(%s) ", replay_file_path, default_nmea_log);
460 timer->fd = fopen(default_nmea_log, "r");
461 if (timer->fd == NULL) {
462 SECLOG_PLUGIN(DBG_ERR, "fopen(%s) failed", default_nmea_log);
469 gboolean gps_plugin_start_replay_mode(replay_timeout *timer)
471 LOG_PLUGIN(DBG_LOW, "gps_plugin_start replay mode");
472 gboolean ret = FALSE;
474 if (timer->replay_mode == REPLAY_NMEA) {
475 if (gps_plugin_get_nmea_fd(timer) == FALSE)
479 if (timer->default_context == NULL) {
480 timer->default_context = g_main_context_default();
482 if (timer->default_context == NULL)
486 if (timer->timeout_src != NULL) {
487 LOG_PLUGIN(DBG_ERR, "timeout_src is already existed");
490 timer->timeout_src = g_timeout_source_new_seconds(timer->interval);
491 if (timer->timeout_src != NULL) {
492 g_source_set_callback(timer->timeout_src, &gps_plugin_replay_timeout_cb, timer, NULL);
493 if (g_source_attach(timer->timeout_src, timer->default_context) > 0) {
494 LOG_PLUGIN(DBG_LOW, "timeout_src(0x%x) is created & attatched to 0x%x", timer->timeout_src, timer->default_context);
497 gps_plugin_stop_replay_mode(timer);
503 display_lock_state(LCD_OFF, STAY_CUR_STATE, 0);
504 LOG_PLUGIN(DBG_LOW, "display_lock_state(LCD_OFF, STAY_CUR_STATE, 0);");
506 gps_plugin_respond_start_session(ret);
511 gboolean gps_plugin_update_batch_mode(replay_timeout *timer, int batch_interval, int batch_period)
513 gboolean ret = FALSE;
517 if (timer->batch_mode == BATCH_MODE_OFF) {
518 timer->batch_mode = BATCH_MODE_ON;
519 timer->batch_client_count = 0;
521 timer->batch_client_count++;
523 timer->batch_interval = batch_interval;
524 timer->batch_period = batch_period;
525 timer->batch_start_time = timestamp;
527 LOG_PLUGIN(DBG_LOW, "batch_client_count = %d", timer->batch_client_count);
531 void gps_plugin_stop_batch_mode(replay_timeout *timer, int batch_interval, int batch_period)
533 if (timer->batch_client_count > 0)
534 timer->batch_client_count--;
536 LOG_PLUGIN(DBG_ERR, "batch_client_count = %d", timer->batch_client_count);
537 if (timer->batch_client_count <= 0) {
538 timer->batch_mode = BATCH_MODE_OFF;
539 timer->batch_interval = 0;
540 timer->batch_period = 0;
542 if (timer->batch_buf) {
543 free(timer->batch_buf);
544 timer->batch_buf = NULL;
546 timer->num_of_batch = 0;
547 timer->batch_buf_size = 0;
550 timer->batch_interval = batch_interval;
551 timer->batch_period = batch_period;
554 timer->batch_start_time = timestamp;
558 static void replay_mode_changed_cb(keynode_t *key, void *data)
560 if (setting_get_int(VCONFKEY_LOCATION_REPLAY_MODE, &g_replay_timer->replay_mode) == FALSE)
561 g_replay_timer->replay_mode = REPLAY_OFF;
563 if (g_replay_timer->replay_mode == REPLAY_NMEA) {
564 if (gps_plugin_get_nmea_fd(g_replay_timer) == FALSE)
565 LOG_PLUGIN(DBG_ERR, "Fail to get nmea fd.");
568 if (g_replay_timer->fd != NULL) {
569 fclose(g_replay_timer->fd);
570 g_replay_timer->fd = NULL;
576 static void display_mode_changed_cb(keynode_t * key, void *data)
578 if (setting_get_int(VCONFKEY_PM_STATE, &g_replay_timer->lcd_mode) == FALSE) {
579 LOG_PLUGIN(DBG_ERR, "Fail to get lcd state");
580 g_replay_timer->lcd_mode = VCONFKEY_PM_STATE_LCDOFF;
583 if (g_replay_timer->lcd_mode == VCONFKEY_PM_STATE_NORMAL)
584 g_replay_timer->is_flush = TRUE;
589 replay_timeout *gps_plugin_replay_timer_init()
591 replay_timeout *timer = NULL;
593 timer = (replay_timeout *) malloc(sizeof(replay_timeout));
595 LOG_PLUGIN(DBG_ERR, "replay_timeout allocation is failed.");
602 timer->num_of_batch = 0;
603 timer->batch_client_count = 0;
604 timer->batch_mode = BATCH_MODE_OFF;
605 timer->batch_interval = 0;
606 timer->batch_period = 0;
607 timer->batch_buf_size = 0;
608 timer->is_flush = FALSE;
610 if (setting_get_int(VCONFKEY_LOCATION_REPLAY_MODE, &timer->replay_mode) == FALSE)
611 timer->replay_mode = REPLAY_OFF;
613 setting_notify_key_changed(VCONFKEY_LOCATION_REPLAY_MODE, replay_mode_changed_cb);
615 if (setting_get_int(VCONFKEY_PM_STATE, &timer->lcd_mode) == FALSE)
616 timer->lcd_mode = VCONFKEY_PM_STATE_LCDOFF;
618 setting_notify_key_changed(VCONFKEY_PM_STATE, display_mode_changed_cb);
620 timer->pos_data = (pos_data_t *) malloc(sizeof(pos_data_t));
621 if (timer->pos_data == NULL) {
622 LOG_PLUGIN(DBG_ERR, "pos_data allocation is failed.");
627 timer->batch_data = (batch_data_t *) malloc(sizeof(batch_data_t));
628 if (timer->batch_data == NULL) {
629 LOG_PLUGIN(DBG_ERR, "batch_data allocation is failed.");
630 free(timer->pos_data);
635 timer->sv_data = (sv_data_t *) malloc(sizeof(sv_data_t));
636 if (timer->sv_data == NULL) {
637 LOG_PLUGIN(DBG_ERR, "sv_data allocation is failed.");
638 free(timer->pos_data);
639 free(timer->batch_data);
644 timer->nmea_data = (nmea_data_t *) malloc(sizeof(nmea_data_t));
645 if (timer->nmea_data == NULL) {
646 LOG_PLUGIN(DBG_ERR, "nmea_data allocation is failed.");
647 free(timer->pos_data);
648 free(timer->batch_data);
649 free(timer->sv_data);
654 timer->timeout_src = NULL;
655 timer->default_context = NULL;
656 timer->batch_buf = NULL;
661 void gps_plugin_replay_timer_deinit(replay_timeout *timer)
666 if (timer->pos_data != NULL) {
667 free(timer->pos_data);
668 timer->pos_data = NULL;
670 if (timer->sv_data != NULL) {
671 free(timer->sv_data);
672 timer->sv_data = NULL;
674 if (timer->nmea_data != NULL) {
675 free(timer->nmea_data);
676 timer->nmea_data = NULL;
679 setting_ignore_key_changed(VCONFKEY_LOCATION_REPLAY_MODE, replay_mode_changed_cb);
685 int gps_plugin_replay_gps_init(gps_event_cb gps_event_cb, void *user_data)
687 g_gps_event_cb = gps_event_cb;
688 g_replay_timer = gps_plugin_replay_timer_init();
689 g_user_data = user_data;
694 int gps_plugin_replay_gps_deinit(gps_failure_reason_t *reason_code)
696 gps_plugin_replay_timer_deinit(g_replay_timer);
697 g_gps_event_cb = NULL;
703 int gps_plugin_replay_gps_request(gps_action_t gps_action, void *gps_action_data, gps_failure_reason_t *reason_code)
705 gps_action_start_data_t *gps_start_data = gps_action_data;
707 switch (gps_action) {
708 case GPS_ACTION_SEND_PARAMS:
710 case GPS_ACTION_START_SESSION:
711 gps_plugin_start_replay_mode(g_replay_timer);
713 case GPS_ACTION_STOP_SESSION:
714 gps_plugin_stop_replay_mode(g_replay_timer);
716 case GPS_ACTION_START_BATCH:
717 if (!gps_start_data->session_status) /* need to start */
718 gps_plugin_start_replay_mode(g_replay_timer);
720 gps_plugin_update_batch_mode(g_replay_timer, gps_start_data->interval, gps_start_data->period);
722 case GPS_ACTION_STOP_BATCH:
723 if (!gps_start_data->session_status) /* need to stop */
724 gps_plugin_stop_replay_mode(g_replay_timer);
726 gps_plugin_stop_batch_mode(g_replay_timer, gps_start_data->interval, gps_start_data->period);
728 case GPS_INDI_SUPL_VERIFICATION:
729 case GPS_INDI_SUPL_DNSQUERY:
730 case GPS_ACTION_START_FACTTEST:
731 case GPS_ACTION_STOP_FACTTEST:
732 case GPS_ACTION_REQUEST_SUPL_NI:
733 LOG_PLUGIN(DBG_LOW, "Don't use action type : [ %d ]", gps_action);
742 EXPORT_API const gps_plugin_interface *get_gps_plugin_interface()
744 return &g_gps_plugin_replay_interface;