4 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Youngae Kang <youngae.kang@samsung.com>, Yunhan Kim <yhan.kim@samsung.com>,
7 * Genie Kim <daejins.kim@samsung.com>, Minjune Kim <sena06.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.
26 #include "location-setting.h"
27 #include "location-log.h"
29 #include "module-internal.h"
31 #include "location-gps.h"
32 #include "location-marshal.h"
33 #include "location-ielement.h"
34 #include "location-signaling-util.h"
35 #include "location-common-util.h"
37 #include <vconf-internal-location-keys.h>
39 typedef struct _LocationGpsPrivate {
44 guint pos_updated_timestamp;
46 guint vel_updated_timestamp;
48 guint sat_updated_timestamp;
50 LocationPosition* pos;
51 LocationVelocity* vel;
52 LocationAccuracy* acc;
54 ZoneStatus zone_status;
55 LocationSatellite* sat;
71 PROP_REMOVAL_BOUNDARY,
77 static guint32 signals[LAST_SIGNAL] = {0, };
78 static GParamSpec *properties[PROP_MAX] = {NULL, };
80 #define GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), LOCATION_TYPE_GPS, LocationGpsPrivate))
82 static void location_ielement_interface_init (LocationIElementInterface *iface);
84 G_DEFINE_TYPE_WITH_CODE (LocationGps, location_gps, G_TYPE_OBJECT,
85 G_IMPLEMENT_INTERFACE (LOCATION_TYPE_IELEMENT,
86 location_ielement_interface_init));
89 _position_timeout_cb (gpointer data)
91 GObject *object = (GObject *)data;
92 LocationGpsPrivate *priv = GET_PRIVATE(object);
93 if (!priv) return FALSE;
95 LocationPosition *pos = NULL;
96 LocationAccuracy *acc = NULL;
99 pos = location_position_copy(priv->pos);
102 pos = location_position_new (0, 0.0, 0.0, 0.0, LOCATION_STATUS_NO_FIX);
106 acc = location_accuracy_copy (priv->acc);
109 acc = location_accuracy_new (LOCATION_ACCURACY_LEVEL_NONE, 0.0, 0.0);
112 LOCATION_LOGD("POSITION SERVICE_UPDATED");
113 g_signal_emit(object, signals[SERVICE_UPDATED], 0, POSITION_UPDATED, pos, acc);
115 location_position_free (pos);
116 location_accuracy_free (acc);
122 _velocity_timeout_cb (gpointer data)
124 GObject *object = (GObject *)data;
125 LocationGpsPrivate *priv = GET_PRIVATE(object);
126 if (!priv) return FALSE;
128 LocationVelocity *vel = NULL;
129 LocationAccuracy *acc = NULL;
132 vel = location_velocity_copy(priv->vel);
135 vel = location_velocity_new (0, 0.0, 0.0, 0.0);
139 acc = location_accuracy_copy (priv->acc);
142 acc = location_accuracy_new (LOCATION_ACCURACY_LEVEL_NONE, 0.0, 0.0);
145 LOCATION_LOGD("VELOCITY SERVICE_UPDATED");
146 g_signal_emit(object, signals[SERVICE_UPDATED], 0, VELOCITY_UPDATED, vel, acc);
148 location_velocity_free (vel);
149 location_accuracy_free (acc);
155 gps_status_cb (gboolean enabled,
156 LocationStatus status,
159 LOCATION_LOGD("gps_status_cb");
160 g_return_if_fail(self);
161 LocationGpsPrivate* priv = GET_PRIVATE(self);
162 enable_signaling(self, signals, &(priv->enabled), enabled, status);
164 if (!priv->enabled) {
165 if (priv->pos_timer) g_source_remove (priv->pos_timer);
166 if (priv->vel_timer) g_source_remove (priv->vel_timer);
173 gps_position_cb (gboolean enabled,
174 LocationPosition *pos,
175 LocationAccuracy *acc,
178 LOCATION_LOGD("gps_position_cb");
179 g_return_if_fail(self);
180 g_return_if_fail(pos);
181 g_return_if_fail(acc);
182 LocationGpsPrivate* priv = GET_PRIVATE(self);
184 enable_signaling(self, signals, &(priv->enabled), enabled, pos->status);
185 position_signaling(self, signals, &(priv->enabled), priv->pos_interval, TRUE, &(priv->pos_updated_timestamp), &(priv->pos), &(priv->acc), priv->boundary_list, &(priv->zone_status), pos, acc);
190 gps_velocity_cb (gboolean enabled,
191 LocationVelocity *vel,
192 LocationAccuracy *acc,
195 LOCATION_LOGD("gps_velocity_cb");
196 g_return_if_fail(self);
197 LocationGpsPrivate* priv = GET_PRIVATE(self);
198 velocity_signaling(self, signals, &(priv->enabled), priv->vel_interval, TRUE, &(priv->vel_updated_timestamp), &(priv->vel), vel, acc);
202 gps_satellite_cb (gboolean enabled,
203 LocationSatellite *sat,
206 LOCATION_LOGD("gps_satellite_cb");
207 g_return_if_fail(self);
208 LocationGpsPrivate* priv = GET_PRIVATE(self);
209 satellite_signaling(self, signals, &(priv->enabled), priv->sat_interval, TRUE, &(priv->sat_updated_timestamp), &(priv->sat), sat);
213 location_setting_search_cb (keynode_t *key, gpointer self)
215 LOCATION_LOGD("location_setting_search_cb");
216 g_return_if_fail(key);
217 g_return_if_fail(self);
218 LocationGpsPrivate* priv = GET_PRIVATE(self);
219 g_return_if_fail (priv->mod);
220 g_return_if_fail (priv->mod->handler);
222 if (location_setting_get_key_val(key) == VCONFKEY_LOCATION_GPS_SEARCHING) {
223 if (!priv->pos_timer) priv->pos_timer = g_timeout_add (priv->pos_interval * 1000, _position_timeout_cb, self);
224 if (!priv->vel_timer) priv->vel_timer = g_timeout_add (priv->vel_interval * 1000, _velocity_timeout_cb, self);
227 if (priv->pos_timer) g_source_remove (priv->pos_timer);
228 if (priv->vel_timer) g_source_remove (priv->vel_timer);
235 location_setting_gps_cb (keynode_t *key,
238 LOCATION_LOGD("location_setting_gps_cb");
239 g_return_if_fail(key);
240 g_return_if_fail(self);
241 LocationGpsPrivate* priv = GET_PRIVATE(self);
242 g_return_if_fail (priv->mod);
243 g_return_if_fail (priv->mod->handler);
245 int ret = LOCATION_ERROR_NONE;
247 if (0 == location_setting_get_key_val(key) && priv->mod->ops.stop && priv->is_started) {
248 LOCATION_LOGD("location stopped by setting");
249 ret = priv->mod->ops.stop(priv->mod->handler);
250 if (ret == LOCATION_ERROR_NONE) {
251 priv->is_started = FALSE;
254 else if (1 == location_setting_get_key_val(key) && priv->mod->ops.start && !priv->is_started) {
255 LOCATION_LOGD("location resumed by setting");
256 ret = priv->mod->ops.start (priv->mod->handler, gps_status_cb, gps_position_cb, gps_velocity_cb, gps_satellite_cb, self);
257 if (ret == LOCATION_ERROR_NONE) {
258 priv->is_started = TRUE;
264 location_gps_start (LocationGps *self)
266 LOCATION_LOGD("location_gps_start");
267 LocationGpsPrivate* priv = GET_PRIVATE(self);
268 g_return_val_if_fail (priv->mod, LOCATION_ERROR_NOT_AVAILABLE);
269 g_return_val_if_fail (priv->mod->handler, LOCATION_ERROR_NOT_AVAILABLE);
270 g_return_val_if_fail (priv->mod->ops.start, LOCATION_ERROR_NOT_AVAILABLE);
272 if (priv->is_started == TRUE) return LOCATION_ERROR_NONE;
274 int ret = LOCATION_ERROR_NONE;
276 if (!location_setting_get_int(VCONFKEY_LOCATION_ENABLED)) {
277 ret = LOCATION_ERROR_NOT_ALLOWED;
280 ret = priv->mod->ops.start (priv->mod->handler, gps_status_cb, gps_position_cb, gps_velocity_cb, gps_satellite_cb, self);
281 if (ret == LOCATION_ERROR_NONE) {
282 priv->is_started = TRUE;
289 if(priv->set_noti == FALSE) {
290 location_setting_add_notify (VCONFKEY_LOCATION_ENABLED, location_setting_gps_cb, self);
291 location_setting_add_notify (VCONFKEY_LOCATION_GPS_STATE, location_setting_search_cb, self);
292 priv->set_noti = TRUE;
299 location_gps_stop (LocationGps *self)
301 LOCATION_LOGD("location_gps_stop");
302 LocationGpsPrivate* priv = GET_PRIVATE(self);
303 g_return_val_if_fail (priv->mod, LOCATION_ERROR_NOT_AVAILABLE);
304 g_return_val_if_fail (priv->mod->handler, LOCATION_ERROR_NOT_AVAILABLE);
305 g_return_val_if_fail (priv->mod->ops.stop, LOCATION_ERROR_NOT_AVAILABLE);
307 int ret = LOCATION_ERROR_NONE;
309 if ( priv->is_started == TRUE) {
310 ret = priv->mod->ops.stop (priv->mod->handler);
311 if (ret == LOCATION_ERROR_NONE) {
312 priv->is_started = FALSE;
319 if (priv->pos_timer ) g_source_remove (priv->pos_timer);
320 if (priv->vel_timer ) g_source_remove (priv->vel_timer);
324 if(priv->set_noti == TRUE) {
325 location_setting_ignore_notify (VCONFKEY_LOCATION_ENABLED, location_setting_gps_cb);
326 location_setting_ignore_notify (VCONFKEY_LOCATION_GPS_STATE, location_setting_search_cb);
327 priv->set_noti = FALSE;
334 location_gps_dispose (GObject *gobject)
336 LOCATION_LOGD("location_gps_dispose");
338 LocationGpsPrivate* priv = GET_PRIVATE(gobject);
340 if (priv->pos_timer) g_source_remove (priv->pos_timer);
341 if (priv->vel_timer) g_source_remove (priv->vel_timer);
345 if(priv->set_noti == TRUE) {
346 location_setting_ignore_notify (VCONFKEY_LOCATION_ENABLED, location_setting_gps_cb);
347 location_setting_ignore_notify (VCONFKEY_LOCATION_GPS_STATE, location_setting_search_cb);
348 priv->set_noti = FALSE;
354 location_gps_finalize (GObject *gobject)
356 LOCATION_LOGD("location_gps_finalize");
357 LocationGpsPrivate* priv = GET_PRIVATE(gobject);
359 module_free(priv->mod, "gps");
362 if (priv->boundary_list) {
363 g_list_free_full (priv->boundary_list, free_boundary_list);
364 priv->boundary_list = NULL;
368 location_position_free(priv->pos);
373 location_velocity_free(priv->vel);
378 location_accuracy_free(priv->acc);
383 location_satellite_free(priv->sat);
386 G_OBJECT_CLASS (location_gps_parent_class)->finalize (gobject);
390 location_gps_set_property (GObject *object,
395 LocationGpsPrivate* priv = GET_PRIVATE(object);
397 g_return_if_fail (priv->mod);
398 g_return_if_fail (priv->mod->handler);
399 LocModGpsOps ops = priv->mod->ops;
402 switch (property_id){
403 case PROP_DEV_NAME: {
404 char* devname = g_value_dup_string(value);
405 LOCATION_LOGD("Set prop>> device_name: %s", devname);
407 ops.set_devname(priv->mod->handler, devname);
411 case PROP_BOUNDARY: {
412 GList *boundary_list = g_list_copy(g_value_get_pointer(value));
413 ret = set_prop_boundary(&priv->boundary_list, boundary_list);
414 if(ret != 0) LOCATION_LOGD("Set boundary. Error[%d]", ret);
417 case PROP_REMOVAL_BOUNDARY: {
418 LocationBoundary *req_boundary = (LocationBoundary*) g_value_dup_boxed(value);
419 ret = set_prop_removal_boundary(&priv->boundary_list, req_boundary);
420 if(ret != 0) LOCATION_LOGD("Removal boundary. Error[%d]", ret);
423 case PROP_POS_INTERVAL: {
424 guint interval = g_value_get_uint(value);
425 LOCATION_LOGD("Set prop>> update-interval: %u", interval);
427 if(interval < LOCATION_UPDATE_INTERVAL_MAX)
428 priv->pos_interval = interval;
430 priv->pos_interval = (guint)LOCATION_UPDATE_INTERVAL_MAX;
433 priv->pos_interval = (guint)LOCATION_UPDATE_INTERVAL_DEFAULT;
435 if (priv->pos_timer) {
436 g_source_remove (priv->pos_timer);
437 priv->pos_timer = g_timeout_add (priv->pos_interval * 1000, _position_timeout_cb, object);
442 case PROP_VEL_INTERVAL: {
443 guint interval = g_value_get_uint(value);
444 LOCATION_LOGD("Set prop>> update-interval: %u", interval);
446 if(interval < LOCATION_UPDATE_INTERVAL_MAX)
447 priv->vel_interval = interval;
449 priv->vel_interval = (guint)LOCATION_UPDATE_INTERVAL_MAX;
452 priv->vel_interval = (guint)LOCATION_UPDATE_INTERVAL_DEFAULT;
454 if (priv->vel_timer) {
455 g_source_remove (priv->vel_timer);
456 priv->vel_timer = g_timeout_add (priv->vel_interval * 1000, _velocity_timeout_cb, object);
461 case PROP_SAT_INTERVAL: {
462 guint interval = g_value_get_uint(value);
463 LOCATION_LOGD("Set prop>> update-interval: %u", interval);
465 if(interval < LOCATION_UPDATE_INTERVAL_MAX)
466 priv->sat_interval = interval;
468 priv->sat_interval = (guint)LOCATION_UPDATE_INTERVAL_MAX;
471 priv->sat_interval = (guint)LOCATION_UPDATE_INTERVAL_DEFAULT;
476 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
482 location_gps_get_property (GObject *object,
487 LocationGpsPrivate *priv = GET_PRIVATE (object);
489 g_return_if_fail (priv->mod);
490 g_return_if_fail (priv->mod->handler);
491 LocModGpsOps ops = priv->mod->ops;
492 switch (property_id) {
493 case PROP_DEV_NAME: {
494 char* devname = NULL;
496 ops.get_devname(priv->mod->handler, &devname);
497 LOCATION_LOGD ("Get prop>> device_name: %s", devname);
498 g_value_set_string (value, devname);
502 case PROP_METHOD_TYPE:
503 g_value_set_int(value, LOCATION_METHOD_GPS);
505 case PROP_LAST_POSITION:
506 g_value_set_boxed (value, priv->pos);
508 case PROP_POS_INTERVAL:
509 g_value_set_uint(value, priv->pos_interval);
511 case PROP_VEL_INTERVAL:
512 g_value_set_uint(value, priv->vel_interval);
514 case PROP_SAT_INTERVAL:
515 g_value_set_uint(value, priv->sat_interval);
518 g_value_set_pointer(value, g_list_first(priv->boundary_list));
521 char *nmea_data = NULL;
522 if (ops.get_nmea && LOCATION_ERROR_NONE == ops.get_nmea(priv->mod->handler, &nmea_data) && nmea_data) {
523 LOCATION_LOGD("Get prop>> Lastest nmea: \n%s", nmea_data);
524 g_value_set_string(value, nmea_data);
527 LOCATION_LOGW("Get prop>> Lastest nmea: failed");
528 g_value_set_string(value, NULL);
532 case PROP_SATELLITE: {
533 LocationSatellite *satellite = NULL;
534 if (ops.get_satellite && priv->mod->handler && LOCATION_ERROR_NONE == ops.get_satellite(priv->mod->handler, &satellite) && satellite){
535 LOCATION_LOGD("Get prop>> Last sat: num_used(%d) num_view(%d)", satellite->num_of_sat_used, satellite->num_of_sat_inview);
536 g_value_set_boxed (value, satellite);
537 location_satellite_free(satellite);
539 LOCATION_LOGW("Get prop>> Last sat: failed");
540 g_value_set_boxed (value, NULL);
545 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
551 location_gps_get_position (LocationGps *self,
552 LocationPosition **position,
553 LocationAccuracy **accuracy)
555 int ret = LOCATION_ERROR_NOT_AVAILABLE;
556 LOCATION_LOGD("location_gps_get_position");
558 LocationGpsPrivate *priv = GET_PRIVATE (self);
559 g_return_val_if_fail (priv->mod, LOCATION_ERROR_NOT_AVAILABLE);
560 setting_retval_if_fail(VCONFKEY_LOCATION_ENABLED);
562 LocModGpsOps ops = priv->mod->ops;
563 g_return_val_if_fail (priv->mod->handler, LOCATION_ERROR_NOT_AVAILABLE);
564 g_return_val_if_fail (ops.get_position, LOCATION_ERROR_NOT_AVAILABLE);
567 *position = location_position_copy (priv->pos);
568 ret = LOCATION_ERROR_NONE;
572 *accuracy = location_accuracy_copy (priv->acc);
579 location_gps_get_last_position (LocationGps *self,
580 LocationPosition **position,
581 LocationAccuracy **accuracy)
583 LOCATION_LOGD("location_gps_get_last_position");
584 // Enable to get a last position even though GPS_ENABLE dose not set on
586 LocationGpsPrivate *priv = GET_PRIVATE (self);
587 g_return_val_if_fail (priv->mod, LOCATION_ERROR_NOT_AVAILABLE);
589 LocModGpsOps ops = priv->mod->ops;
590 g_return_val_if_fail (priv->mod->handler, LOCATION_ERROR_NOT_AVAILABLE);
591 g_return_val_if_fail (ops.get_last_position, LOCATION_ERROR_NOT_AVAILABLE);
592 return ops.get_last_position(priv->mod->handler, position, accuracy);
597 location_gps_get_velocity (LocationGps *self,
598 LocationVelocity **velocity,
599 LocationAccuracy **accuracy)
601 LOCATION_LOGD("location_gps_get_velocity");
603 int ret = LOCATION_ERROR_NOT_AVAILABLE;
605 LocationGpsPrivate *priv = GET_PRIVATE (self);
606 g_return_val_if_fail (priv->mod, LOCATION_ERROR_NOT_AVAILABLE);
607 setting_retval_if_fail(VCONFKEY_LOCATION_ENABLED);
609 LocModGpsOps ops = priv->mod->ops;
610 g_return_val_if_fail (priv->mod->handler, LOCATION_ERROR_NOT_AVAILABLE);
611 g_return_val_if_fail (ops.get_velocity, LOCATION_ERROR_NOT_AVAILABLE);
614 *velocity = location_velocity_copy (priv->vel);
615 ret = LOCATION_ERROR_NONE;
619 *accuracy = location_accuracy_copy (priv->acc);
626 location_gps_get_last_velocity (LocationGps *self,
627 LocationVelocity **velocity,
628 LocationAccuracy **accuracy)
630 LOCATION_LOGD("location_gps_get_last_velocity");
632 LocationGpsPrivate *priv = GET_PRIVATE (self);
633 g_return_val_if_fail (priv->mod, LOCATION_ERROR_NOT_AVAILABLE);
634 setting_retval_if_fail(VCONFKEY_LOCATION_ENABLED);
636 LocModGpsOps ops = priv->mod->ops;
637 g_return_val_if_fail (priv->mod->handler, LOCATION_ERROR_NOT_AVAILABLE);
638 g_return_val_if_fail (ops.get_last_velocity, LOCATION_ERROR_NOT_AVAILABLE);
639 return ops.get_last_velocity(priv->mod->handler, velocity, accuracy);
644 location_gps_get_satellite (LocationGps *self,
645 LocationSatellite **satellite)
647 int ret = LOCATION_ERROR_NOT_AVAILABLE;
648 LOCATION_LOGD("location_gps_get_satellite");
650 LocationGpsPrivate *priv = GET_PRIVATE (self);
651 g_return_val_if_fail (priv->mod, LOCATION_ERROR_NOT_AVAILABLE);
652 setting_retval_if_fail(VCONFKEY_LOCATION_ENABLED);
655 *satellite = location_satellite_copy (priv->sat);
656 ret = LOCATION_ERROR_NONE;
663 location_gps_get_last_satellite (LocationGps *self,
664 LocationSatellite **satellite)
666 LOCATION_LOGD("location_gps_get_last_satellite");
668 LocationGpsPrivate *priv = GET_PRIVATE (self);
669 g_return_val_if_fail (priv->mod, LOCATION_ERROR_NOT_AVAILABLE);
670 setting_retval_if_fail(VCONFKEY_LOCATION_ENABLED);
672 LocModGpsOps ops = priv->mod->ops;
673 g_return_val_if_fail (priv->mod->handler, LOCATION_ERROR_NOT_AVAILABLE);
674 g_return_val_if_fail (ops.get_last_satellite, LOCATION_ERROR_NOT_AVAILABLE);
675 return ops.get_last_satellite(priv->mod->handler, satellite);
679 location_ielement_interface_init (LocationIElementInterface *iface)
681 iface->start = (TYPE_START_FUNC)location_gps_start;
682 iface->stop = (TYPE_STOP_FUNC)location_gps_stop;
683 iface->get_position = (TYPE_GET_POSITION)location_gps_get_position;
684 iface->get_last_position = (TYPE_GET_POSITION)location_gps_get_last_position;
685 iface->get_velocity = (TYPE_GET_VELOCITY)location_gps_get_velocity;
686 iface->get_last_velocity = (TYPE_GET_VELOCITY)location_gps_get_last_velocity;
687 iface->get_satellite = (TYPE_GET_SATELLITE)location_gps_get_satellite;
688 iface->get_last_satellite = (TYPE_GET_SATELLITE)location_gps_get_last_satellite;
692 location_gps_init (LocationGps *self)
694 LOCATION_LOGD("location_gps_init");
695 LocationGpsPrivate* priv = GET_PRIVATE(self);
697 priv->mod = (LocationGpsMod*)module_new("gps");
698 if(!priv->mod) LOCATION_LOGW("module loading failed");
700 priv->is_started = FALSE;
701 priv->set_noti = FALSE;
702 priv->enabled= FALSE;
704 priv->pos_interval = LOCATION_UPDATE_INTERVAL_DEFAULT;
705 priv->vel_interval = LOCATION_UPDATE_INTERVAL_DEFAULT;
706 priv->sat_interval = LOCATION_UPDATE_INTERVAL_DEFAULT;
708 priv->pos_updated_timestamp = 0;
709 priv->vel_updated_timestamp = 0;
710 priv->sat_updated_timestamp = 0;
716 priv->zone_status = ZONE_STATUS_NONE;
717 priv->boundary_list = NULL;
725 location_gps_class_init (LocationGpsClass *klass)
727 LOCATION_LOGD("location_gps_class_init");
728 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
730 gobject_class->set_property = location_gps_set_property;
731 gobject_class->get_property = location_gps_get_property;
733 gobject_class->dispose = location_gps_dispose;
734 gobject_class->finalize = location_gps_finalize;
736 g_type_class_add_private (klass, sizeof (LocationGpsPrivate));
738 signals[SERVICE_ENABLED] = g_signal_new ("service-enabled",
739 G_TYPE_FROM_CLASS (klass),
742 G_STRUCT_OFFSET (LocationGpsClass, enabled),
748 signals[SERVICE_DISABLED] = g_signal_new ("service-disabled",
749 G_TYPE_FROM_CLASS (klass),
752 G_STRUCT_OFFSET (LocationGpsClass, disabled),
758 signals[SERVICE_UPDATED] = g_signal_new ("service-updated",
759 G_TYPE_FROM_CLASS (klass),
762 G_STRUCT_OFFSET (LocationGpsClass, updated),
764 location_VOID__UINT_POINTER_POINTER,
770 signals[ZONE_IN] = g_signal_new ("zone-in",
771 G_TYPE_FROM_CLASS (klass),
774 G_STRUCT_OFFSET (LocationGpsClass, zone_in),
776 location_VOID__UINT_POINTER_POINTER,
782 signals[ZONE_OUT] = g_signal_new ("zone-out",
783 G_TYPE_FROM_CLASS (klass),
786 G_STRUCT_OFFSET (LocationGpsClass, zone_out),
788 location_VOID__UINT_POINTER_POINTER,
794 properties[PROP_DEV_NAME] = g_param_spec_string ("dev-name",
795 "gps device name prop",
800 properties[PROP_METHOD_TYPE] = g_param_spec_int ("method",
802 "location method type name",
808 properties[PROP_LAST_POSITION] = g_param_spec_boxed ("last-position",
809 "gps last position prop",
810 "gps last position data",
811 LOCATION_TYPE_POSITION,
814 properties[PROP_POS_INTERVAL] = g_param_spec_uint ("pos-interval",
815 "gps position interval prop",
816 "gps position interval data",
817 LOCATION_UPDATE_INTERVAL_MIN,
818 LOCATION_UPDATE_INTERVAL_MAX,
819 LOCATION_UPDATE_INTERVAL_DEFAULT,
822 properties[PROP_VEL_INTERVAL] = g_param_spec_uint ("vel-interval",
823 "gps velocity interval prop",
824 "gps velocity interval data",
825 LOCATION_UPDATE_INTERVAL_MIN,
826 LOCATION_UPDATE_INTERVAL_MAX,
827 LOCATION_UPDATE_INTERVAL_DEFAULT,
830 properties[PROP_SAT_INTERVAL] = g_param_spec_uint ("sat-interval",
831 "gps satellite interval prop",
832 "gps satellite interval data",
833 LOCATION_UPDATE_INTERVAL_MIN,
834 LOCATION_UPDATE_INTERVAL_MAX,
835 LOCATION_UPDATE_INTERVAL_DEFAULT,
838 properties[PROP_BOUNDARY] = g_param_spec_pointer ("boundary",
843 properties[PROP_REMOVAL_BOUNDARY] = g_param_spec_boxed("removal-boundary",
844 "gps removal boundary prop",
845 "gps removal boundary data",
846 LOCATION_TYPE_BOUNDARY,
850 properties[PROP_NMEA] = g_param_spec_string ("nmea",
851 "gps NMEA name prop",
856 properties[PROP_SATELLITE] = g_param_spec_boxed ("satellite",
857 "gps satellite prop",
858 "gps satellite data",
859 LOCATION_TYPE_SATELLITE,
862 g_object_class_install_properties (gobject_class,