# auto generated tet_scen
all
"Starting Full Test Suite"
- /unit/utc_location_init
- /unit/utc_location_new
- /unit/utc_location_free
- /unit/utc_location_start
- /unit/utc_location_stop
- /unit/utc_location_get_position
- /unit/utc_location_get_velocity
+ /unit/stc_gps_nmea
+ /unit/stc_gps_position
+ /unit/stc_gps_satellite
+ /unit/stc_gps_velocity
+ /unit/stc_gps_zone
+ /unit/utc_location_free
/unit/utc_location_get_address
- /unit/utc_location_get_address_from_position
- /unit/utc_location_get_position_from_address
- /unit/utc_location_get_position_from_freeformed_address
- /unit/utc_signals_service_disabled
- /unit/utc_signals_service_enabled
- /unit/utc_signals_service_updated
- /unit/utc_signals_zone_in
+ /unit/utc_location_get_last_known_position
+ /unit/utc_location_get_address_from_position
+ /unit/utc_location_get_position_from_address
+ /unit/utc_location_get_position_from_freeformed_address
+ /unit/utc_location_get_position
+ /unit/utc_location_get_last_position
+ /unit/utc_location_get_velocity
+ /unit/utc_location_get_last_velocity
+ /unit/utc_location_get_satellite
+ /unit/utc_location_get_last_satellite
+ /unit/utc_location_init
+ /unit/utc_location_new
+ /unit/utc_location_start
+ /unit/utc_location_stop
+ /unit/utc_properties_method
+ /unit/utc_signals_service_disabled
+ /unit/utc_signals_service_enabled
+ /unit/utc_signals_service_updated
+ /unit/utc_signals_zone_in
/unit/utc_signals_zone_out
- /unit/utc_properties_method
- /unit/utc_properties_boundary
- /unit/utc_properties_last_position
- /unit/stc_gps_position
- /unit/stc_gps_velocity
- /unit/stc_gps_satellite
- /unit/stc_gps_nmea
- /unit/stc_gps_zone
"Completed Full Test Suite"
# EOF
# TC1 = utc_frameworkName_apiName_func
# TC2 = utc_ApplicationLib_recurGetDayOfWeek_func
TC1 = stc_gps_position
-TC2 = stc_gps_velocity
-TC3 = stc_gps_satellite
-TC4 = stc_gps_nmea
-TC5 = stc_gps_zone
+TC2 = stc_gps_velocity
+TC3 = stc_gps_satellite
+TC4 = stc_gps_nmea
+TC5 = stc_gps_zone
TC6 = utc_location_init
TC7 = utc_location_new
-TC8 = utc_location_start
-TC9 = utc_location_stop
-TC10 = utc_location_free
-TC11 = utc_location_get_position
-TC12 = utc_location_get_velocity
-TC13 = utc_properties_last_position
-TC14 = utc_properties_method
-TC16 = utc_properties_boundary
-TC17 = utc_signals_service_disabled
-TC18 = utc_signals_service_enabled
-TC19 = utc_signals_service_updated
-TC20 = utc_signals_zone_in
-TC21 = utc_signals_zone_out
-TC22 = utc_location_get_address
-TC23 = utc_location_get_address_from_position
-TC24 = utc_location_get_position_from_address
-TC25 = utc_location_get_position_from_freeformed_address
+TC8 = utc_location_start
+TC9 = utc_location_stop
+TC10 = utc_location_free
+TC11 = utc_location_get_position
+TC12 = utc_location_get_last_position
+TC13 = utc_location_get_last_known_position
+TC14 = utc_location_get_velocity
+TC15 = utc_location_get_last_velocity
+TC16 = utc_location_get_satellite
+TC17 = utc_location_get_last_satellite
+TC18 = utc_properties_method
+TC19 = utc_signals_service_disabled
+TC20 = utc_signals_service_enabled
+TC21 = utc_signals_service_updated
+TC22 = utc_signals_zone_in
+TC23 = utc_signals_zone_out
+TC24 = utc_location_get_address
+TC25 = utc_location_get_address_from_position
+TC26 = utc_location_get_position_from_address
+TC27 = utc_location_get_position_from_freeformed_address
#
# add your Package Config Info Here
#
# e.g.,
# PKGS=calendar
-PKGS= location gconf-2.0
+PKGS= gconf-2.0 network vconf location
-LDLIBS = `pkg-config --libs $(PKGS)`
-LDLIBS +=$(TET_ROOT)/lib/tet3/tcm_s.o
-LDLIBS +=-L$(TET_ROOT)/lib/tet3 -ltcm_s
-LDLIBS +=-L$(TET_ROOT)/lib/tet3 -lapi_s
+LDLIBS = $(TET_ROOT)/lib/tet3/tcm_s.o
+LDLIBS += -L$(TET_ROOT)/lib/tet3 -ltcm_s
+LDLIBS += -L$(TET_ROOT)/lib/tet3 -lapi_s
+LDLIBS += `pkg-config --libs $(PKGS)`
+
+TTLIBS = $(TET_ROOT)/lib/tet3/tcm_s.o
+TTLIBS += -L$(TET_ROOT)/lib/tet3 -ltcm_s
+TTLIBS += -L$(TET_ROOT)/lib/tet3 -lapi_s
+TTLIBS += `pkg-config --libs $(PKGS)`
CC = gcc
-INCS = -I. `pkg-config --cflags $(PKGS)`
-INCS += -I$(TET_ROOT)/inc/tet3
-CFLAGS = $(INCS)
-CFLAGS += -Wall -D_TETWARE_MODE
+INCS = -I$(TET_ROOT)/inc/tet3
+INCS += -I.`pkg-config --cflags $(PKGS)`
+CFLAGS = -Wall -D_TETWARE_MODE
+CFLAGS += $(INCS)
###################################################
-# Modify here
+# Modify here
# depending on the Test Case you want to build
-#
+#
# e.g.,
-#
-TCLIST = $(TC1) $(TC2) $(TC3) $(TC4) $(TC5) $(TC6) $(TC7) $(TC8) $(TC9) $(TC10) $(TC11) $(TC12) $(TC13) $(TC14) $(TC16) $(TC17) $(TC18) $(TC19) $(TC20) $(TC21) $(TC22) $(TC23) $(TC24) $(TC25)
+#
+TCLIST = $(TC1) $(TC2) $(TC3) $(TC4) $(TC5) $(TC6) $(TC7) $(TC8) $(TC9) $(TC10) $(TC11) $(TC12) $(TC13) $(TC14) $(TC16) $(TC17) $(TC18) $(TC19) $(TC20) $(TC21) $(TC22) $(TC23) $(TC24) $(TC25) $(TC26) $(TC27)
+
+all: $(TCLIST)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+clean:
+ rm -f $(TCLIST)
+ rm -f *.o
gpointer userdata)
{
LocationSatellite *sat = NULL;
- g_object_get (loc, "satellite", &sat, NULL);
- if (sat) {
+ int ret = 0;
+
+ ret = location_get_satellite (loc, &sat);
+ if (ret == LOCATION_ERROR_NONE) {
tet_result(TET_PASS);
location_satellite_free (sat);
} else tet_result(TET_FAIL);
#include <glib.h>
#include <location.h>
+static gboolean g_is_found = FALSE;
+
static void startup(), cleanup();
void (*tet_startup) () = startup;
void (*tet_cleanup) () = cleanup;
int ret;
LocationObject* loc;
+static void comp_boundary(LocationBoundary *bound, gpointer user_data)
+{
+ LocationBoundary *check_bound = (LocationBoundary *) user_data;
+
+ if(bound && bound->type == check_bound->type) {
+ switch(bound->type) {
+ case LOCATION_BOUNDARY_RECT:
+ if(bound->rect.right_bottom->latitude == check_bound->rect.right_bottom->latitude &&
+ bound->rect.right_bottom->longitude == check_bound->rect.right_bottom->longitude &&
+ bound->rect.left_top->latitude == check_bound->rect.left_top->latitude &&
+ bound->rect.left_top->longitude == check_bound->rect.left_top->longitude ){
+ g_is_found = TRUE;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+
static gboolean
exit_loop (gpointer data)
{
static void
utc_set_boundary_in_suwonHQ()
{
+ int ret = 0;
LocationPosition *rb = location_position_new(0, 37.253, 127.058, 0, LOCATION_STATUS_2D_FIX);
LocationPosition *lt = location_position_new(0, 37.261, 127.052, 0, LOCATION_STATUS_2D_FIX);
LocationBoundary *bound = location_boundary_new_for_rect(lt, rb);
location_position_free (rb);
location_position_free (lt);
- g_object_set(loc, "boundary", bound, NULL);
- if (loc) {
- tet_result(TET_PASS);
- location_boundary_free (bound);
- } else tet_result(TET_FAIL);
+ ret = location_boundary_add(loc, bound);
+ if (!ret) tet_result(TET_PASS);
+ else tet_result(TET_FAIL);
+
+ location_boundary_free (bound);
}
static void
utc_get_boundary_in_suwonHQ()
{
- LocationBoundary* bound = NULL;
-
- g_object_get(loc, "boundary", &bound, NULL);
- if ( bound &&
- bound->type ==LOCATION_BOUNDARY_RECT &&
- bound->rect.right_bottom->latitude == 37.253 &&
- bound->rect.right_bottom->longitude == 127.058 &&
- bound->rect.left_top->latitude == 37.261 &&
- bound->rect.left_top->longitude == 127.052 ){
- tet_result(TET_PASS);
- location_boundary_free (bound);
- }
- else
- tet_result(TET_FAIL);
+ LocationPosition *rb = location_position_new(0, 37.253, 127.058, 0, LOCATION_STATUS_2D_FIX);
+ LocationPosition *lt = location_position_new(0, 37.261, 127.052, 0, LOCATION_STATUS_2D_FIX);
+ LocationBoundary *bound = location_boundary_new_for_rect(lt, rb);
+ location_position_free (rb);
+ location_position_free (lt);
+
+ g_is_found = FALSE;
+ location_boundary_foreach(loc, comp_boundary, bound);
+ if(g_is_found) tet_result(TET_PASS);
+ else tet_result(TET_FAIL);
+
+ location_boundary_free (bound);
}
static void
static void
utc_set_boundary_in_Santorini()
{
+ int ret = 0;
LocationPosition *rb = location_position_new(0, 36.395, 25.41, 0, LOCATION_STATUS_2D_FIX);
LocationPosition *lt = location_position_new(0, 36.413, 25.388, 0, LOCATION_STATUS_2D_FIX);
LocationBoundary* bound = location_boundary_new_for_rect(lt, rb);
location_position_free (rb);
location_position_free (lt);
- g_object_set(loc, "boundary", bound, NULL);
- if (loc) {
- tet_result(TET_PASS);
- location_boundary_free (bound);
- } else tet_result(TET_FAIL);
+ ret = location_boundary_add(loc, bound);
+ if (!ret) tet_result(TET_PASS);
+ else tet_result(TET_FAIL);
+
+ location_boundary_free (bound);
}
static void
utc_get_boundary_in_Santorini()
{
- LocationBoundary* bound = NULL;
- g_object_get(loc, "boundary", &bound, NULL);
-
- if ( bound &&
- bound->type ==LOCATION_BOUNDARY_RECT &&
- bound->rect.right_bottom->latitude == 36.395 &&
- bound->rect.right_bottom->longitude == 25.41 &&
- bound->rect.left_top->latitude == 36.413 &&
- bound->rect.left_top->longitude == 25.388 ){
- tet_result(TET_PASS);
- location_boundary_free (bound);
- } else tet_result(TET_FAIL);
-
+ LocationPosition *rb = location_position_new(0, 36.395, 25.41, 0, LOCATION_STATUS_2D_FIX);
+ LocationPosition *lt = location_position_new(0, 36.413, 25.388, 0, LOCATION_STATUS_2D_FIX);
+ LocationBoundary* bound = location_boundary_new_for_rect(lt, rb);
+ location_position_free (rb);
+ location_position_free (lt);
+
+ g_is_found = FALSE;
+ location_boundary_foreach(loc, comp_boundary, bound);
+ if(g_is_found) tet_result(TET_PASS);
+ else tet_result(TET_FAIL);
+
+ location_boundary_free (bound);
}
static void
stc_gps_zone
utc_location_free
utc_location_get_address
+utc_location_get_last_known_position
utc_location_get_address_from_position
utc_location_get_position_from_address
utc_location_get_position_from_freeformed_address
utc_location_get_position
+utc_location_get_last_position
utc_location_get_velocity
+utc_location_get_last_velocity
+utc_location_get_satellite
+utc_location_get_last_satellite
utc_location_init
utc_location_new
utc_location_start
utc_location_stop
-utc_properties_boundary
-utc_properties_last_position
utc_properties_method
utc_signals_service_disabled
utc_signals_service_enabled
#include <tet_api.h>
#include <glib.h>
-#include <gconf/gconf-client.h>
#include <location.h>
static void startup(), cleanup();
int ret = LOCATION_ERROR_NONE;
int isNetStarted = 0;
-#define GCONF_PROXY_MODE "/system/proxy/mode"
-#define GCONF_HTTP_PROXY_HOST "/system/http_proxy/host"
-#define GCONF_HTTP_PROXY_PORT "/system/http_proxy/port"
-#define ENV_HTTP_PROXY "http_proxy"
-
-static gboolean
-exit_loop (gpointer data)
-{
- g_main_loop_quit (loop);
- return FALSE;
-}
-
static gboolean
exit_loop_fail (gpointer data)
{
}
static void startup()
-{
+{
location_init();
loc = location_new(LOCATION_METHOD_GPS);
loop = g_main_loop_new(NULL,FALSE);
- g_main_loop_run (loop);
-
- tet_printf("\n TC startup");
+
+ tet_printf("\n TC startup");
}
static void cleanup()
-{
+{
location_stop(loc);
location_free(loc);
tet_printf("\n TC End");
static void
utc_location_get_address_01()
-{
+{
g_signal_connect (loc, "service-enabled", G_CALLBACK(_get_address), loc);
location_start(loc);
- g_timeout_add_seconds(60, exit_loop_fail, NULL);
+ g_timeout_add_seconds(60, exit_loop_fail, loop);
g_main_loop_run (loop);
}
- static void
+static void
utc_location_get_address_02()
{
LocationAccuracy *acc = NULL;
else tet_result(TET_FAIL);
}
- static void
+static void
utc_location_get_address_03()
{
LocationAccuracy *acc = NULL;
#include <tet_api.h>
#include <glib.h>
-#include <gconf/gconf-client.h>
#include <location.h>
static void startup(), cleanup();
LocationObject* loc;
int ret;
int isNetStarted = 0;
-
-#define GCONF_PROXY_MODE "/system/proxy/mode"
-#define GCONF_HTTP_PROXY_HOST "/system/http_proxy/host"
-#define GCONF_HTTP_PROXY_PORT "/system/http_proxy/port"
-#define ENV_HTTP_PROXY "http_proxy"
+int g_state = 0;
static gboolean
exit_loop (gpointer data)
}
static void startup()
-{
+{
location_init();
loc = location_new(LOCATION_METHOD_GPS);
- loop = g_main_loop_new(NULL,FALSE);
- g_main_loop_run (loop);
-
- tet_printf("\n TC startup");
+ loop = g_main_loop_new(NULL,FALSE);
+ tet_printf("\n TC startup");
}
static void cleanup()
-{
+{
location_free(loc);
tet_printf("\n TC End");
}
static void
utc_location_get_address_from_position_01()
-{
+{
LocationPosition *pos = location_position_new(0, 37.257809, 127.056383, 0, LOCATION_STATUS_2D_FIX);
LocationAccuracy *acc = NULL;
LocationAddress *addr = NULL;
ret = location_get_address_from_position(loc, pos, &addr, &acc);
location_position_free(pos);
- tet_printf("Returned value: %d", ret);
+ tet_printf("Returned value: %d", ret);
if (ret == LOCATION_ERROR_NONE ||
ret == LOCATION_ERROR_CONFIGURATION) {
location_address_free(addr);
location_accuracy_free(acc);
- tet_result(TET_PASS);
+ tet_result(TET_PASS);
} else tet_result(TET_FAIL);
}
LocationPosition *pos = location_position_new(0, 37.257809, 127.056383, 0, LOCATION_STATUS_2D_FIX);
LocationAccuracy *acc = NULL;
LocationAddress *addr = NULL;
-
+
ret = location_get_address_from_position(NULL, pos, &addr, &acc);
location_position_free(pos);
location_address_free(addr);
--- /dev/null
+/*
+ * libslp-location
+ *
+ * Copyright (c) 2010-2011 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>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <tet_api.h>
+#include <glib.h>
+#include <location.h>
+
+static void startup(), cleanup();
+void (*tet_startup) () = startup;
+void (*tet_cleanup) () = cleanup;
+
+static void utc_location_get_last_known_position_01();
+static void utc_location_get_last_known_position_02();
+
+struct tet_testlist tet_testlist[] = {
+ {utc_location_get_last_known_position_01,1},
+ {utc_location_get_last_known_position_02,2},
+ {NULL,0},
+};
+
+int ret;
+LocationObject* loc;
+
+static void startup()
+{
+ ret = location_init();
+ loc = location_new(LOCATION_METHOD_GPS);
+ tet_printf("\n TC startup");
+}
+
+static void cleanup()
+{
+ if( loc )
+ location_free(loc);
+ tet_printf("\n TC End");
+}
+
+static void
+utc_location_get_last_known_position_01()
+{
+ int ret = 0;
+ LocationLastPosition last_known_position = {0, };
+
+ ret = location_get_last_known_position(loc, LOCATION_METHOD_HYBRID, &last_known_position);
+ if (ret == LOCATION_ERROR_NONE) tet_result(TET_PASS);
+ else tet_result(TET_FAIL);
+}
+
+static void
+utc_location_get_last_known_position_02()
+{
+ int ret = 0;
+ LocationLastPosition last_known_position = {0, };
+ ret = location_get_last_known_position(NULL, LOCATION_METHOD_HYBRID, &last_known_position);
+ if (ret == LOCATION_ERROR_NONE) tet_result(TET_PASS);
+ else tet_result(TET_FAIL);
+}
+
--- /dev/null
+/*
+ * libslp-location
+ *
+ * Copyright (c) 2010-2011 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>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <tet_api.h>
+#include <glib.h>
+#include <location.h>
+
+static void startup(), cleanup();
+void (*tet_startup) () = startup;
+void (*tet_cleanup) () = cleanup;
+
+static void utc_location_get_last_position_01();
+static void utc_location_get_last_position_02();
+static void utc_location_get_last_position_03();
+static void utc_location_get_last_position_04();
+
+struct tet_testlist tet_testlist[] = {
+ {utc_location_get_last_position_01,1},
+ {utc_location_get_last_position_02,2},
+ {utc_location_get_last_position_03,3},
+ {utc_location_get_last_position_04,4},
+ {NULL,0},
+};
+
+int ret;
+LocationObject* loc;
+
+static void startup()
+{
+ location_init();
+ loc = location_new(LOCATION_METHOD_GPS);
+ tet_printf("\n TC startup");
+}
+
+static void cleanup()
+{
+ location_free(loc);
+ tet_printf("\n TC End");
+}
+
+static void
+utc_location_get_last_position_01()
+{
+ LocationPosition *last_pos = NULL;
+ LocationAccuracy *last_acc = NULL;
+
+ ret = location_get_last_position (loc, LOCATION_METHOD_GPS, &last_pos, &last_acc);
+ if (ret == LOCATION_ERROR_NONE) tet_result(TET_PASS);
+ else tet_result(TET_FAIL);
+}
+
+static void
+utc_location_get_last_position_02()
+{
+ LocationAccuracy *last_acc = NULL;
+ LocationPosition *last_pos = NULL;
+
+ ret = location_get_last_position (NULL, LOCATION_METHOD_HYBRID, &last_pos, &last_acc);
+ tet_printf("Returned value: %d", ret);
+ if (ret == LOCATION_ERROR_NONE) tet_result(TET_PASS);
+ else tet_result(TET_FAIL);
+}
+
+static void
+utc_location_get_last_position_03()
+{
+ LocationAccuracy *last_acc = NULL;
+ ret = location_get_last_position (loc, LOCATION_METHOD_GPS, NULL, &last_acc);
+ tet_printf("Returned value: %d", ret);
+ if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
+ else tet_result(TET_FAIL);
+}
+
+static void
+utc_location_get_last_position_04()
+{
+ LocationPosition *last_pos = NULL;
+ ret = location_get_last_position (loc, LOCATION_METHOD_GPS, &last_pos, NULL);
+ tet_printf("Returned value: %d", ret);
+ if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
+ else tet_result(TET_FAIL);
+}
--- /dev/null
+/*
+ * libslp-location
+ *
+ * Copyright (c) 2010-2011 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>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <tet_api.h>
+#include <glib.h>
+#include <location.h>
+
+static void startup(), cleanup();
+void (*tet_startup) () = startup;
+void (*tet_cleanup) () = cleanup;
+
+static void utc_location_get_last_satellite_01();
+static void utc_location_get_last_satellite_02();
+static void utc_location_get_last_satellite_03();
+
+struct tet_testlist tet_testlist[] = {
+ {utc_location_get_last_satellite_01,1},
+ {utc_location_get_last_satellite_02,2},
+ {utc_location_get_last_satellite_03,3},
+ {NULL,0},
+};
+
+int ret;
+LocationObject* loc;
+
+static void startup()
+{
+ location_init();
+ loc = location_new(LOCATION_METHOD_GPS);
+ tet_printf("\n TC startup");
+}
+
+static void cleanup()
+{
+ location_free(loc);
+ tet_printf("\n TC End");
+}
+
+static void
+utc_location_get_last_satellite_01()
+{
+ int ret = 0;
+ LocationSatellite *last_sat = NULL;
+
+ ret = location_get_last_satellite (loc, &last_sat);
+ tet_printf("Returned value: %d", ret);
+ if (ret == LOCATION_ERROR_NONE) {
+ location_satellite_free(last_sat);
+ tet_result(TET_PASS);
+ } else tet_result(TET_FAIL);
+
+}
+
+static void
+utc_location_get_last_satellite_02()
+{
+ LocationSatellite *last_sat = NULL;
+ ret = location_get_last_satellite (NULL, &last_sat);
+ tet_printf("Returned value: %d", ret);
+ if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
+ else tet_result(TET_FAIL);
+}
+
+static void
+utc_location_get_last_satellite_03()
+{
+ ret = location_get_last_satellite (loc, NULL);
+ tet_printf("Returned value: %d", ret);
+ if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
+ else tet_result(TET_FAIL);
+}
--- /dev/null
+/*
+ * libslp-location
+ *
+ * Copyright (c) 2010-2011 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>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <tet_api.h>
+#include <glib.h>
+#include <location.h>
+
+static void startup(), cleanup();
+void (*tet_startup) () = startup;
+void (*tet_cleanup) () = cleanup;
+
+static void utc_location_get_last_velocity_01();
+static void utc_location_get_last_velocity_02();
+static void utc_location_get_last_velocity_03();
+static void utc_location_get_last_velocity_04();
+
+struct tet_testlist tet_testlist[] = {
+ {utc_location_get_last_velocity_01,1},
+ {utc_location_get_last_velocity_02,2},
+ {utc_location_get_last_velocity_03,3},
+ {utc_location_get_last_velocity_04,4},
+ {NULL,0},
+};
+
+int ret;
+LocationObject* loc;
+
+static void startup()
+{
+ location_init();
+ loc = location_new(LOCATION_METHOD_GPS);
+ tet_printf("\n TC startup");
+}
+
+static void cleanup()
+{
+ location_free(loc);
+ tet_printf("\n TC End");
+}
+
+
+static void
+utc_location_get_last_velocity_01()
+{
+ LocationVelocity *last_vel = NULL;
+ LocationAccuracy *last_acc = NULL;
+ ret = location_get_last_velocity (loc, &last_vel, &last_acc);
+ tet_printf("Returned value: %d", ret);
+ if (ret == LOCATION_ERROR_NONE) {
+ location_velocity_free (last_vel);
+ location_accuracy_free (last_acc);
+ tet_result(TET_PASS);
+ } else tet_result(TET_FAIL);
+
+}
+
+
+static void
+utc_location_get_last_velocity_02()
+{
+ LocationVelocity *last_vel = NULL;
+ LocationAccuracy *last_acc = NULL;
+ ret = location_get_last_velocity (NULL, &last_vel, &last_acc);
+ tet_printf("Returned value: %d", ret);
+ if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
+ else tet_result(TET_FAIL);
+}
+
+static void
+utc_location_get_last_velocity_03()
+{
+ LocationAccuracy *last_acc = NULL;
+ ret = location_get_velocity (loc, NULL, &last_acc);
+ tet_printf("Returned value: %d", ret);
+ if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
+ else tet_result(TET_FAIL);
+}
+
+static void
+utc_location_get_last_velocity_04()
+{
+ LocationVelocity *last_vel = NULL;
+ ret = location_get_velocity (loc, &last_vel, NULL);
+ tet_printf("Returned value: %d", ret);
+ if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
+ else tet_result(TET_FAIL);
+}
LocationObject* loc;
int ret;
int isNetStarted = 0;
-
-#define GCONF_PROXY_MODE "/system/proxy/mode"
-#define GCONF_HTTP_PROXY_HOST "/system/http_proxy/host"
-#define GCONF_HTTP_PROXY_PORT "/system/http_proxy/port"
-#define ENV_HTTP_PROXY "http_proxy"
+int g_state = 0;
+gboolean is_found = FALSE;
static gboolean
exit_loop (gpointer data)
}
static void startup()
-{
+{
location_init();
loc = location_new(LOCATION_METHOD_GPS);
- loop = g_main_loop_new(NULL,FALSE);
- g_main_loop_run (loop);
+ loop = g_main_loop_new(NULL,FALSE);
- tet_printf("\n TC startup");
+ tet_printf("\n TC startup");
}
static void cleanup()
-{
+{
location_free(loc);
tet_printf("\n TC End");
}
+static void comp_position (gpointer data, gpointer user_data)
+{
+ if (!data) return;
+
+ LocationPosition *pos = (LocationPosition *)data;
+
+ if (pos) {
+ if (37.325276 <= pos->latitude && pos->latitude <= 37.345276 &&
+ -121.900059 <= pos->longitude && pos->longitude<= -121.880059) {
+ is_found = TRUE;
+ }
+
+ location_position_free(pos);
+ }
+}
+
+static void free_accuracy (gpointer data, gpointer user_data)
+{
+ if (!data) return;
+
+ LocationAccuracy *acc = (LocationAccuracy *)data;
+
+ if (acc) location_accuracy_free(acc);
+}
+
static void
utc_location_get_position_from_address_01()
-{
- LocationPosition *pos = NULL;
- LocationAccuracy *acc = NULL;
+{
+ GList *pos_list = NULL;
+ GList *acc_list = NULL;
LocationAddress *addr = location_address_new ("1", "Post Street", NULL, "san jose", "ca", NULL, "95113");
- ret = location_get_position_from_address (loc, addr, &pos, &acc);
+ ret = location_get_position_from_address (loc, addr, &pos_list, &acc_list);
location_address_free(addr);
tet_printf("Returned value: %d", ret);
- if( (ret == LOCATION_ERROR_NONE &&
- 37.325276 <= pos->latitude && pos->latitude <= 37.345276 &&
- -121.900059 <= pos->longitude && pos->longitude<= -121.880059) ||
- ret == LOCATION_ERROR_CONFIGURATION ) {
- location_position_free(pos);
- location_accuracy_free(acc);
- tet_result(TET_PASS);
+ if (ret == LOCATION_ERROR_NONE) {
+ is_found = FALSE;
+ g_list_foreach (pos_list, comp_position, NULL);
+ g_list_foreach (acc_list, free_accuracy, NULL);
+ if (is_found)
+ tet_result(TET_PASS);
+ else
+ tet_result(TET_FAIL);
} else tet_result(TET_FAIL);
}
static void
utc_location_get_position_from_address_02()
{
- LocationPosition *pos = NULL;
- LocationAccuracy *acc = NULL;
+ GList *pos_list = NULL;
+ GList *acc_list = NULL;
LocationAddress *addr = location_address_new ("1", "Post Street", NULL, "san jose", "ca", NULL, "95113");
- ret = location_get_position_from_address (NULL, addr, &pos, &acc);
+ ret = location_get_position_from_address (NULL, addr, &pos_list, &acc_list);
location_address_free(addr);
tet_printf("Returned value: %d", ret);
if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
static void
utc_location_get_position_from_address_03()
{
- LocationPosition *pos = NULL;
- LocationAccuracy *acc = NULL;
- ret = location_get_position_from_address(loc, NULL, &pos, &acc);
+ GList *pos_list = NULL;
+ GList *acc_list = NULL;
+ ret = location_get_position_from_address(loc, NULL, &pos_list, &acc_list);
tet_printf("Returned value: %d", ret);
if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
else tet_result(TET_FAIL);
utc_location_get_position_from_address_04()
{
LocationAddress *addr = location_address_new ("1", "Post Street", NULL, "san jose", "ca", NULL, "95113");;
- LocationAccuracy *acc = NULL;
- ret = location_get_position_from_address(loc, addr, NULL, &acc);
+ GList *acc_list = NULL;
+ ret = location_get_position_from_address(loc, addr, NULL, &acc_list);
location_address_free (addr);
tet_printf("Returned value: %d", ret);
if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
#include <tet_api.h>
#include <glib.h>
-#include <gconf/gconf-client.h>
#include <location.h>
static void startup(), cleanup();
LocationObject* loc;
int ret;
int isNetStarted = 0;
-
-#define GCONF_PROXY_MODE "/system/proxy/mode"
-#define GCONF_HTTP_PROXY_HOST "/system/http_proxy/host"
-#define GCONF_HTTP_PROXY_PORT "/system/http_proxy/port"
-#define ENV_HTTP_PROXY "http_proxy"
+gboolean is_found = FALSE;
static gboolean
exit_loop (gpointer data)
}
static void startup()
-{
+{
location_init();
loc = location_new(LOCATION_METHOD_GPS);
- loop = g_main_loop_new(NULL,FALSE);
- g_main_loop_run (loop);
-
- tet_printf("\n TC startup");
+ loop = g_main_loop_new(NULL,FALSE);
+ tet_printf("\n TC startup");
}
static void cleanup()
-{
+{
location_free(loc);
tet_printf("\n TC End");
}
+static void comp_position (gpointer data, gpointer user_data)
+{
+ if (!data) return;
+ LocationPosition *pos = (LocationPosition *)data;
+ if (pos) {
+ if (37.325276 <= pos->latitude && pos->latitude <= 37.345276 &&
+ -121.900059 <= pos->longitude && pos->longitude<= -121.880059) {
+ is_found = TRUE;
+ }
+ location_position_free (pos);
+ }
+}
+
+static void free_accuracy (gpointer data, gpointer user_data)
+{
+ if (!data) return;
+
+ LocationAccuracy *acc = (LocationAccuracy *)data;
+ if (acc) location_accuracy_free(acc);
+}
+
static void
utc_location_get_position_from_freeformed_address_01()
-{
- LocationPosition *pos = NULL;
- LocationAccuracy *acc = NULL;
+{
+ GList *pos_list = NULL;
+ GList *acc_list = NULL;
char* addr_str = g_strdup("4 N 2nd Street 95113");
- ret = location_get_position_from_freeformed_address(loc, addr_str, &pos, &acc);
+ ret = location_get_position_from_freeformed_address(loc, addr_str, &pos_list, &acc_list);
g_free(addr_str);
tet_printf("Returned value: %d", ret);
- if( (ret == LOCATION_ERROR_NONE &&
- 37.325276 <= pos->latitude && pos->latitude <= 37.345276 &&
- -121.900059 <= pos->longitude && pos->longitude<= -121.880059) ||
- ret == LOCATION_ERROR_CONFIGURATION ) {
- location_position_free (pos);
- location_accuracy_free (acc);
- tet_result(TET_PASS);
+ if (ret == LOCATION_ERROR_NONE ) {
+ g_list_foreach (pos_list, comp_position, NULL);
+ g_list_foreach (acc_list, free_accuracy, NULL);
+ if (is_found == TRUE)
+ tet_result(TET_PASS);
+ else
+ tet_result(TET_FAIL);
}
else
tet_result(TET_FAIL);
-
}
static void
utc_location_get_position_from_freeformed_address_02()
{
- LocationPosition *pos = NULL;
- LocationAccuracy *acc = NULL;
+ GList *pos_list = NULL;
+ GList *acc_list = NULL;
char* addr_str = g_strdup("4 N 2nd Street 95113");
- ret = location_get_position_from_freeformed_address(NULL, addr_str, &pos, &acc);
+ ret = location_get_position_from_freeformed_address(NULL, addr_str, &pos_list, &acc_list);
g_free(addr_str);
tet_printf("Returned value: %d", ret);
if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
static void
utc_location_get_position_from_freeformed_address_03()
{
- LocationPosition *pos = NULL;
- LocationAccuracy *acc = NULL;
- ret = location_get_position_from_freeformed_address(loc, NULL, &pos, &acc);
+ GList *pos_list = NULL;
+ GList *acc_list = NULL;
+ ret = location_get_position_from_freeformed_address(loc, NULL, &pos_list, &acc_list);
tet_printf("Returned value: %d", ret);
if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
else tet_result(TET_FAIL);
static void
utc_location_get_position_from_freeformed_address_04()
{
- LocationAccuracy *acc = NULL;
+ GList *acc_list = NULL;
char* addr_str = g_strdup("4 N 2nd Street 95113");
- ret = location_get_position_from_freeformed_address(loc, addr_str, NULL, &acc);
+ ret = location_get_position_from_freeformed_address(loc, addr_str, NULL, &acc_list);
g_free (addr_str);
tet_printf("Returned value: %d", ret);
if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
--- /dev/null
+/*
+ * libslp-location
+ *
+ * Copyright (c) 2010-2011 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>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <tet_api.h>
+#include <glib.h>
+#include <location.h>
+
+static void startup(), cleanup();
+void (*tet_startup) () = startup;
+void (*tet_cleanup) () = cleanup;
+
+static void utc_location_get_satellite_01();
+static void utc_location_get_satellite_02();
+static void utc_location_get_satellite_03();
+
+struct tet_testlist tet_testlist[] = {
+ {utc_location_get_satellite_01,1},
+ {utc_location_get_satellite_02,2},
+ {utc_location_get_satellite_03,3},
+ {NULL,0},
+};
+
+static GMainLoop *loop = NULL;
+int ret;
+LocationObject* loc;
+
+static gboolean
+exit_loop (gpointer data)
+{
+ g_main_loop_quit (loop);
+ tet_result(TET_FAIL);
+ return FALSE;
+}
+
+static void startup()
+{
+ location_init();
+ loc = location_new(LOCATION_METHOD_GPS);
+ location_start(loc);
+ loop = g_main_loop_new(NULL,FALSE);
+ tet_printf("\n TC startup");
+}
+
+static void cleanup()
+{
+ location_stop(loc);
+ location_free(loc);
+ tet_printf("\n TC End");
+}
+
+static void
+_get_satellite (GObject *self,
+ guint _status,
+ gpointer userdata)
+{
+ LocationSatellite *sat = NULL;
+ LocationObject *loc = (LocationObject*)userdata;
+
+ ret = location_get_satellite (loc, &sat);
+ tet_printf("Returned value: %d", ret);
+ if (ret == LOCATION_ERROR_NONE) {
+ location_satellite_free(sat);
+ tet_result(TET_PASS);
+ } else tet_result(TET_FAIL);
+ g_main_loop_quit (loop);
+}
+
+static void
+utc_location_get_satellite_01()
+{
+ g_signal_connect (loc, "service-enabled", G_CALLBACK(_get_satellite), loc);
+ g_timeout_add_seconds(60, exit_loop, loop);
+ g_main_loop_run (loop);
+}
+
+static void
+utc_location_get_satellite_02()
+{
+ LocationSatellite *sat = NULL;
+ ret = location_get_satellite (NULL, &sat);
+ tet_printf("Returned value: %d", ret);
+ if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
+ else tet_result(TET_FAIL);
+}
+
+static void
+utc_location_get_satellite_03()
+{
+ LocationSatellite *sat = NULL;
+ ret = location_get_satellite (loc, NULL);
+ tet_printf("Returned value: %d", ret);
+ if (ret == LOCATION_ERROR_PARAMETER) tet_result(TET_PASS);
+ else tet_result(TET_FAIL);
+}
#include <glib.h>
#include <location.h>
+#include "test_common.c"
+
+static gboolean g_is_found = FALSE;
static void startup(), cleanup();
void (*tet_startup) () = startup;
void (*tet_cleanup) () = cleanup;
{utc_set_boundary_in_suwonHQ,1},
{utc_get_boundary_in_suwonHQ,2},
{NULL,0},
-};
+};
int ret;
LocationObject* loc;
+static void comp_boundary(LocationBoundary *bound, gpointer user_data)
+{
+ LocationBoundary *check_bound = (LocationBoundary *) user_data;
+
+ if(bound && bound->type == check_bound->type) {
+ switch(bound->type) {
+ case LOCATION_BOUNDARY_RECT:
+ if(bound->rect.right_bottom->latitude == check_bound->rect.right_bottom->latitude &&
+ bound->rect.right_bottom->longitude == check_bound->rect.right_bottom->longitude &&
+ bound->rect.left_top->latitude == check_bound->rect.left_top->latitude &&
+ bound->rect.left_top->longitude == check_bound->rect.left_top->longitude ){
+ g_is_found = TRUE;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+}
+
static void startup()
-{
+{
location_init();
loc = location_new(LOCATION_METHOD_GPS);
location_start(loc);
}
static void cleanup()
-{
+{
location_stop(loc);
location_free(loc);
tet_printf("\n TC End");
static void
utc_set_boundary_in_suwonHQ()
{
+ int ret = 0;
LocationPosition *rb = location_position_new(0, 37.258, 127.056, 0, LOCATION_STATUS_2D_FIX);
LocationPosition *lt = location_position_new(0, 37.260, 127.054, 0, LOCATION_STATUS_2D_FIX);
LocationBoundary* bound = location_boundary_new_for_rect(lt, rb);
- g_object_set(loc, "boundary", bound, NULL);
+
+ ret = location_boundary_add(loc, bound);
+ if (!ret) {
+ tet_result(TET_PASS);
+ } else tet_result(TET_FAIL);
+
location_position_free (rb);
location_position_free (lt);
location_boundary_free(bound);
- if (loc) {
- tet_result(TET_PASS);
- } else tet_result(TET_FAIL);
}
static void
utc_get_boundary_in_suwonHQ()
{
- LocationBoundary* bound = NULL;
- g_object_get(loc, "boundary", &bound, NULL);
- if ( bound &&
- bound->type == LOCATION_BOUNDARY_RECT &&
- bound->rect.right_bottom->latitude == 37.258 &&
- bound->rect.right_bottom->longitude == 127.056 &&
- bound->rect.left_top->latitude == 37.260 &&
- bound->rect.left_top->longitude == 127.054 ){
- tet_result(TET_PASS);
- location_boundary_free (bound);
- } else tet_result(TET_FAIL);
+ LocationPosition *rb = location_position_new(0, 37.258, 127.056, 0, LOCATION_STATUS_2D_FIX);
+ LocationPosition *lt = location_position_new(0, 37.260, 127.054, 0, LOCATION_STATUS_2D_FIX);
+ LocationBoundary* bound = location_boundary_new_for_rect(lt, rb);
+
+ g_is_found = FALSE;
+ location_boundary_foreach(loc, comp_boundary, bound);
+ if(g_is_found) tet_result(TET_PASS);
+ else tet_result(TET_FAIL);
+
+ location_position_free (rb);
+ location_position_free (lt);
+ location_boundary_free (bound);
}
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
#include <tet_api.h>
#include <glib.h>
#include <location.h>
struct tet_testlist tet_testlist[] = {
{utc_zone_in,1},
{NULL,0},
-};
+};
static GMainLoop *loop = NULL;
int ret;
}
static void startup()
-{
+{
location_init();
loc = location_new(LOCATION_METHOD_GPS);
location_start(loc);
- loop = g_main_loop_new(NULL,FALSE);
+ loop = g_main_loop_new(NULL,FALSE);
LocationPosition *rb = location_position_new(0, 37.254, 127.057, 0, LOCATION_STATUS_2D_FIX);
LocationPosition *lt = location_position_new(0, 37.261, 127.050, 0, LOCATION_STATUS_2D_FIX);
LocationBoundary* bound = location_boundary_new_for_rect(lt, rb);
+ location_boundary_add(loc, bound);
+
location_position_free (rb);
location_position_free (lt);
- g_object_set(loc, "boundary", bound, NULL);
- location_boundary_free (bound);
+ location_boundary_free (bound);
tet_printf("\n TC startup");
}
static void cleanup()
-{
+{
location_stop(loc);
location_free(loc);
tet_printf("\n TC End");
{
g_signal_connect (loc, "zone-in", G_CALLBACK(cb_zone_in), loc);
g_timeout_add_seconds(60, exit_loop, NULL);
- g_main_loop_run (loop);
+ g_main_loop_run (loop);
}
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
#include <tet_api.h>
#include <glib.h>
#include <location.h>
}
static void startup()
-{
+{
location_init();
loc = location_new(LOCATION_METHOD_GPS);
location_start(loc);
- loop = g_main_loop_new(NULL,FALSE);
+ loop = g_main_loop_new(NULL,FALSE);
LocationPosition *rb = location_position_new(0, 36.395, 25.41, 0, LOCATION_STATUS_2D_FIX);
LocationPosition *lt = location_position_new(0, 36.413, 25.388, 0, LOCATION_STATUS_2D_FIX);
LocationBoundary* bound = location_boundary_new_for_rect(lt, rb);
+ location_boundary_add(loc, bound);
+
location_position_free (rb);
location_position_free (lt);
- g_object_set(loc, "boundary", bound, NULL);
location_boundary_free (bound);
tet_printf("\n TC startup");
}
static void cleanup()
-{
+{
location_stop(loc);
location_free(loc);
tet_printf("\n TC End");
{
g_signal_connect (loc, "zone-out", G_CALLBACK(_cb_zone_out), loc);
g_timeout_add_seconds(60, exit_loop, NULL);
- g_main_loop_run (loop);
+ g_main_loop_run (loop);
}
-libslp-location (0.3.31-3) unstable; urgency=low
+libslp-location (0.3.34-4) unstable; urgency=low
- * Change PKG name to "org.tizen" in test codes.
+ * Rollback
* Git: pkgs/l/libslp-location
- * Tag: libslp-location_0.3.31-3
+ * Tag: libslp-location_0.3.34-4
- -- Yunhan Kim <yhan.kim@samsung.com> Fri, 23 Dec 2011 20:04:55 +0900
+ -- Minjune Kim <sena06.kim@samsung.com> Thu, 23 Feb 2012 14:30:58 +0900
+
+libslp-location (0.3.34-3) unstable; urgency=low
+
+ * Add POI func & Route prototype
+ * Git: pkgs/l/libslp-location
+ * Tag: libslp-location_0.3.34-3
+
+ -- root <sena06.kim@samsung.com> Thu, 23 Feb 2012 14:29:51 +0900
+
+libslp-location (0.3.34-2) unstable; urgency=low
+
+ * Add location_get_last_XXX and location_get_satellite proto. Add timestamp on satellite info
+ * Add TC
+ * Git: pkgs/l/libslp-location
+ * Tag: libslp-location_0.3.34-2
+
+ -- Minjune Kim <sena06.kim@samsung.com> Mon, 13 Feb 2012 21:03:22 +0900
+
+libslp-location (0.3.34-1) unstable; urgency=low
+
+ * Support to get multi positions using geocode service.
+ * Correct typo.
+ * Git: pkgs/l/libslp-location
+ * Tag: libslp-location_0.3.34-1
+
+ -- Minjune Kim <sena06.kim@samsung.com> Fri, 03 Feb 2012 15:01:49 +0900
+
+libslp-location (0.3.33-2) unstable; urgency=low
+
+ * Remove a needless conditional code.
+ * Git: pkgs/l/libslp-location
+ * Tag: libslp-location_0.3.33-2
+
+ -- Minjune Kim <sena06.kim@samsung.com> Sun, 29 Jan 2012 09:48:48 +0900
+
+libslp-location (0.3.33-1) unstable; urgency=low
+
+ * Enable to get last known position for each method.
+ * Git: pkgs/l/libslp-location
+ * Tag: libslp-location_0.3.33-1
+
+ -- Minjune Kim <sena06.kim@samsung.com> Thu, 19 Jan 2012 19:44:12 +0900
+
+libslp-location (0.3.32-1) unstable; urgency=low
+
+ * Fix a bug that a module is not started when a service turns on.
+ * Git: pkgs/l/libslp-location
+ * Tag: libslp-location_0.3.32-1
+
+ -- Minjune Kim <sena06.kim@samsung.com> Fri, 06 Jan 2012 17:10:12 +0900
libslp-location (0.3.31-2) unstable; urgency=low
#setting
if [ "${USER}" = "root" ]
then
-vconftool set -t int db/location/position/Timestamp "0" -f
-vconftool set -t string db/location/position/LastPosition "" -f
-vconftool set -t int db/location/position/LastAccuracy "0" -f
+vconftool set -t int db/location/lastposition/gps/Timestamp "0" -f
+vconftool set -t double db/location/lastposition/gps/Latitude "0.0" -f
+vconftool set -t double db/location/lastposition/gps/Longitude "0.0" -f
+vconftool set -t double db/location/lastposition/gps/Altitude "0.0" -f
+vconftool set -t double db/location/lastposition/gps/HorAccuracy "0.0" -f
+vconftool set -t double db/location/lastposition/gps/VerAccuracy "0.0" -f
+vconftool set -t int db/location/lastposition/wps/Timestamp "0" -f
+vconftool set -t double db/location/lastposition/wps/Latitude "0.0" -f
+vconftool set -t double db/location/lastposition/wps/Longitude "0.0" -f
+vconftool set -t double db/location/lastposition/wps/Altitude "0.0" -f
+vconftool set -t double db/location/lastposition/wps/HorAccuracy "0.0" -f
+vconftool set -t int db/location/lastposition/sps/Timestamp "0" -f
+vconftool set -t double db/location/lastposition/sps/Latitude "0.0" -f
+vconftool set -t double db/location/lastposition/sps/Longitude "0.0" -f
+vconftool set -t double db/location/lastposition/sps/Altitude "0.0" -f
+vconftool set -t double db/location/lastposition/sps/HorAccuracy "0.0" -f
+vconftool set -t double db/location/lastposition/sps/VerAccuracy "0.0" -f
vconftool set -t int db/location/setting/GpsEnabled "0" -g 6514 -f
vconftool set -t int db/location/setting/AgpsEnabled "0" -g 6514 -f
vconftool set -t int db/location/setting/NetworkEnabled "0" -g 6514 -f
vconftool set -t int db/location/setting/SensorEnabled "0" -g 6514 -f
else
-vconftool set -t int db/location/position/Timestamp "0" -f
-vconftool set -t string db/location/position/LastPosition "" -f
-vconftool set -t int db/location/position/LastAccuracy "0" -f
+
+vconftool set -t int db/location/lastposition/gps/Timestamp "0" -f
+vconftool set -t double db/location/lastposition/gps/Latitude "0.0" -f
+vconftool set -t double db/location/lastposition/gps/Longitude "0.0" -f
+vconftool set -t double db/location/lastposition/gps/Altitude "0.0" -f
+vconftool set -t double db/location/lastposition/gps/HorAccuracy "0.0" -f
+vconftool set -t double db/location/lastposition/gps/VerAccuracy "0.0" -f
+vconftool set -t int db/location/lastposition/wps/Timestamp "0" -f
+vconftool set -t double db/location/lastposition/wps/Latitude "0.0" -f
+vconftool set -t double db/location/lastposition/wps/Longitude "0.0" -f
+vconftool set -t double db/location/lastposition/wps/Altitude "0.0" -f
+vconftool set -t double db/location/lastposition/wps/HorAccuracy "0.0" -f
+vconftool set -t int db/location/lastposition/sps/Timestamp "0" -f
+vconftool set -t double db/location/lastposition/sps/Latitude "0.0" -f
+vconftool set -t double db/location/lastposition/sps/Longitude "0.0" -f
+vconftool set -t double db/location/lastposition/sps/Altitude "0.0" -f
+vconftool set -t double db/location/lastposition/sps/HorAccuracy "0.0" -f
+vconftool set -t double db/location/lastposition/sps/VerAccuracy "0.0" -f
vconftool set -t int db/location/setting/GpsEnabled "0" -g -f
vconftool set -t int db/location/setting/AgpsEnabled "0" -f
vconftool set -t int db/location/setting/NetworkEnabled "0" -f
{
LocationAccuracyLevel level; ///< The accuracy level of the location information.
gdouble horizontal_accuracy; ///< The horizontal position uncertainty of the location in meters.
- gdouble vertical_accuracy; ///< The vertical position unvertainty of the location in meters.
+ gdouble vertical_accuracy; ///< The vertical position uncertainty of the location in meters.
};
GType location_accuracy_get_type(void);
* @post None.
* @param [in] level - The accuracy level of the location information.
* @param [in] horizontal_accuracy - The horizontal position uncertainty of the location in meters.
- * @param [in] vertical_accuracy - The vertical position unvertainty of the location in meters.
+ * @param [in] vertical_accuracy - The vertical position uncertainty of the location in meters.
* @return a new #LocationAccuracy
* @retval NULL if error occured
*/
gchar *street; ///< Full street name.
gchar *district; ///< Municipal district name.
gchar *city; ///< City name.
- gchar *state; ///< State or provinc region of a nation.
+ gchar *state; ///< State or province region of a nation.
gchar *country_code; ///< Country name.
gchar *postal_code; ///< Postal delivery code.
};
* @param [in] street - Full street name.
* @param [in] district - Municipal district name.
* @param [in] city - City name.
- * @param [in] state - State or provinc region of a nation.
+ * @param [in] state - State or province region of a nation.
* @param [in] country_code - Country name.
* @param [in] postal_code - Postal delivery code.
* @return a new #LocationAddress
} LocationPolygon;
/**
- * @brief This represents boundary information such as rectagular or circle area.
+ * @brief This represents boundary information such as rectangular or circle area.
*/
struct _LocationBoundary{
LocationBoundaryType type; ///< The boundary type of this information.
union {
- LocationRect rect; ///< The geographical information of a rectagle.
+ LocationRect rect; ///< The geographical information of a rectangle.
LocationCircle circle; ///< The geographical information of a circle.
LocationPolygon polygon; ///< The geographical information of a polygon.
};
#define LOCATION_TYPE_BOUNDARY (location_boundary_get_type ())
/**
- * @brief Create a rectagular type of new #LocationBoundary with given information.
+ * @brief Create a rectangular type of new #LocationBoundary with given information.
* @remarks None.
* @pre #location_init should be called before.\n
* @post None.
/**
* @brief
* Add Boundary on LocationFW.
- * You should call this fuction when you want to receive a corssing signal(zone-in/zone-out) from #LocationBoundary.
- * @remarks It suppoorts multi-boundaries. \n
+ * You should call this fuction when you want to receive a crossing signal(zone-in/zone-out) from #LocationBoundary.
+ * @remarks It supports multi-boundaries. \n
However a duplicated boundary would not be allowed.
* @pre
* #location_new should be called before.\n
/**
* @brief
* Remove Boundary on LocationFW.
- * You should call this function when you don't want to receive a corssing signal(zone-in/zone-out) from #LocationBoundary any more.
- * @remarks It suppoorts multi-boundaries.
+ * You should call this function when you don't want to receive a crossing signal(zone-in/zone-out) from #LocationBoundary any more.
+ * @remarks It supports multi-boundaries.
* @pre
* #location_init should be called before.\n
* @post None.
#include "location.h"
#include "location-common-util.h"
+#include "location-setting.h"
#include "location-log.h"
static gint compare_position (gconstpointer a, gconstpointer b)
return LOCATION_ERROR_NONE;
}
+int get_last_known_position (LocationMethod method, LocationLastPosition *last_pos)
+{
+ int timestamp = 0;
+ double longitude = 0.0, latitude = 0.0, altitude = 0.0;
+ double hor_accuracy = 0.0, ver_accuracy = 0.0;
+ LOCATION_LOGD("Method [%d]", method);
+ switch (method) {
+ case LOCATION_METHOD_SPS:
+ if (vconf_get_int(SPS_LAST_TIMESTAMP, ×tamp) ||
+ vconf_get_dbl(SPS_LAST_LATITUDE, &latitude) ||
+ vconf_get_dbl(SPS_LAST_LONGITUDE, &longitude) ||
+ vconf_get_dbl(SPS_LAST_ALTITUDE, &altitude) ||
+ vconf_get_dbl(SPS_LAST_HORACCURACY, &hor_accuracy) ||
+ vconf_get_dbl(SPS_LAST_VERACCURACY, &ver_accuracy)) {
+ return -1;
+ }
+ break;
+ case LOCATION_METHOD_WPS:
+ if (vconf_get_int(WPS_LAST_TIMESTAMP, ×tamp) ||
+ vconf_get_dbl(WPS_LAST_LATITUDE, &latitude) ||
+ vconf_get_dbl(WPS_LAST_LONGITUDE, &longitude) ||
+ vconf_get_dbl(WPS_LAST_ALTITUDE, &altitude) ||
+ vconf_get_dbl(WPS_LAST_HORACCURACY, &hor_accuracy)) {
+ return -1;
+ }
+ break;
+ case LOCATION_METHOD_GPS:
+ if (vconf_get_int(GPS_LAST_TIMESTAMP, ×tamp) ||
+ vconf_get_dbl(GPS_LAST_LATITUDE, &latitude) ||
+ vconf_get_dbl(GPS_LAST_LONGITUDE, &longitude) ||
+ vconf_get_dbl(GPS_LAST_ALTITUDE, &altitude) ||
+ vconf_get_dbl(GPS_LAST_HORACCURACY, &hor_accuracy) ||
+ vconf_get_dbl(GPS_LAST_VERACCURACY, &ver_accuracy)) {
+ return -1;
+ }
+ break;
+ case LOCATION_METHOD_HYBRID:
+ default:
+ return -1;
+
+ }
+
+ last_pos->method = method;
+ last_pos->timestamp = (guint) timestamp;
+ last_pos->longitude = (gdouble) longitude;
+ last_pos->latitude = (gdouble) latitude;
+ last_pos->altitude = (gdouble) altitude;
+ last_pos->horizontal_accuracy = (gdouble) hor_accuracy;
+ last_pos->vertical_accuracy = (gdouble) ver_accuracy;
+
+ return 0;
+}
+
int set_prop_boundary(GList **prev_boundary_list, GList *new_boundary_list);
int set_prop_removal_boundary(GList **prev_boundary_list, LocationBoundary *boundary);
+int get_last_known_position (LocationMethod method, LocationLastPosition *last_pos);
+
G_END_DECLS
#endif
static int
location_geocode_get_geocode (LocationGeocode *self,
const LocationAddress *address,
- LocationPosition **position,
- LocationAccuracy **accuracy)
+ GList **position_list,
+ GList **accuracy_list)
{
LOCATION_LOGD("location_geocode_get_geocode");
LocationGeocodePrivate* priv = GET_PRIVATE(self);
g_return_val_if_fail (priv->mod, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail (priv->mod->handler, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail (priv->mod->ops.get_geocode, LOCATION_ERROR_NOT_AVAILABLE);
- return (priv->mod->ops.get_geocode)(priv->mod->handler, address, position, accuracy);
+ return (priv->mod->ops.get_geocode)(priv->mod->handler, address, position_list, accuracy_list);
}
static int
location_geocode_get_geocode_freeform (LocationGeocode *self,
const gchar *address,
- LocationPosition **position,
- LocationAccuracy **accuracy)
+ GList **position_list,
+ GList **accuracy_list)
{
LOCATION_LOGD("location_geocode_get_geocode_freeform");
LocationGeocodePrivate* priv = GET_PRIVATE(self);
g_return_val_if_fail (priv->mod, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail (priv->mod->handler, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail (priv->mod->ops.get_geocode_freetext, LOCATION_ERROR_NOT_AVAILABLE);
- return (priv->mod->ops.get_geocode_freetext)(priv->mod->handler, address, position, accuracy);
+ return (priv->mod->ops.get_geocode_freetext)(priv->mod->handler, address, position_list, accuracy_list);
}
static int
typedef struct _LocationGpsPrivate {
LocationGpsMod* mod;
gboolean is_started;
+ gboolean set_noti;
gboolean enabled;
guint interval;
LocationPosition* pos;
LocationGpsPrivate* priv = GET_PRIVATE(self);
g_return_if_fail (priv->mod);
g_return_if_fail (priv->mod->handler);
- if (0 == location_setting_get_key_val(key) && priv->mod->ops.stop) {
+
+ int ret = LOCATION_ERROR_NONE;
+
+ if (0 == location_setting_get_key_val(key) && priv->mod->ops.stop && priv->is_started) {
LOCATION_LOGD("location stopped by setting");
- priv->mod->ops.stop(priv->mod->handler);
+ ret = priv->mod->ops.stop(priv->mod->handler);
+ if (ret == LOCATION_ERROR_NONE) priv->is_started = FALSE;
}
- else if (1 == location_setting_get_key_val(key) && priv->mod->ops.start) {
+ else if (1 == location_setting_get_key_val(key) && priv->mod->ops.start && !priv->is_started) {
LOCATION_LOGD("location resumed by setting");
- priv->mod->ops.start (priv->mod->handler, gps_status_cb, gps_position_cb, gps_velocity_cb, self);
+ ret = priv->mod->ops.start (priv->mod->handler, gps_status_cb, gps_position_cb, gps_velocity_cb, self);
+ if (ret == LOCATION_ERROR_NONE) priv->is_started = TRUE;
}
}
g_return_val_if_fail (priv->mod, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail (priv->mod->handler, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail (priv->mod->ops.start, LOCATION_ERROR_NOT_AVAILABLE);
- setting_retval_if_fail (GPS_ENABLED);
+
if (priv->is_started == TRUE) return LOCATION_ERROR_NONE;
- int ret = priv->mod->ops.start (priv->mod->handler, gps_status_cb, gps_position_cb, gps_velocity_cb, self);
- if (ret == LOCATION_ERROR_NONE) {
- priv->is_started = TRUE;
- location_setting_add_notify (GPS_ENABLED, location_setting_gps_cb, self);
+ int ret = LOCATION_ERROR_NONE;
+ int noti_err = 0;
+
+ if (!location_setting_get_int(GPS_ENABLED)) {
+ ret = LOCATION_ERROR_NOT_ALLOWED;
+ }
+ else {
+ ret = priv->mod->ops.start (priv->mod->handler, gps_status_cb, gps_position_cb, gps_velocity_cb, self);
+ if (ret == LOCATION_ERROR_NONE) {
+ priv->is_started = TRUE;
+ }
+ else {
+ return ret;
+ }
+ }
+
+ if(priv->set_noti == FALSE) {
+ noti_err = location_setting_add_notify (GPS_ENABLED, location_setting_gps_cb, self);
+ if (noti_err != 0) {
+ return LOCATION_ERROR_UNKNOWN;
+ }
+ priv->set_noti = TRUE;
}
+
return ret;
}
g_return_val_if_fail (priv->mod, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail (priv->mod->handler, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail (priv->mod->ops.stop, LOCATION_ERROR_NOT_AVAILABLE);
- if (priv->is_started == FALSE) return LOCATION_ERROR_NONE;
- int ret = priv->mod->ops.stop (priv->mod->handler);
- if (ret == LOCATION_ERROR_NONE) {
- priv->is_started = FALSE;
- location_setting_ignore_notify (GPS_ENABLED, location_setting_gps_cb);
+ int ret = LOCATION_ERROR_NONE;
+ int noti_err = 0;
+
+ if ( priv->is_started == TRUE) {
+ ret = priv->mod->ops.stop (priv->mod->handler);
+ if (ret == LOCATION_ERROR_NONE) {
+ priv->is_started = FALSE;
+ }
+ else {
+ return ret;
+ }
}
+
+ if(priv->set_noti == TRUE) {
+ noti_err = location_setting_ignore_notify (GPS_ENABLED, location_setting_gps_cb);
+ if (noti_err != 0) {
+ return LOCATION_ERROR_UNKNOWN;
+ }
+ priv->set_noti = FALSE;
+ }
+
return ret;
}
if(!priv->mod) LOCATION_LOGW("module loading failed");
priv->is_started = FALSE;
+ priv->set_noti = FALSE;
priv->enabled= FALSE;
priv->interval = LOCATION_UPDATE_INTERVAL_DEFAULT;
location_hybrid_start (LocationHybrid *self)
{
LOCATION_LOGD("location_hybrid_start");
- setting_retval_if_fail(GPS_ENABLED);
int ret_gps = LOCATION_ERROR_NONE;
int ret_wps = LOCATION_ERROR_NONE;
if (ret_gps != LOCATION_ERROR_NONE &&
ret_wps != LOCATION_ERROR_NONE &&
- ret_sps != LOCATION_ERROR_NONE)
- return LOCATION_ERROR_NOT_AVAILABLE;
+ ret_sps != LOCATION_ERROR_NONE) {
+ if (ret_gps == LOCATION_ERROR_NOT_ALLOWED ||
+ ret_wps == LOCATION_ERROR_NOT_ALLOWED ||
+ ret_sps == LOCATION_ERROR_NOT_ALLOWED) {
+ priv->is_started = TRUE;
+ return LOCATION_ERROR_NOT_ALLOWED;
+ }
+ else {
+ return LOCATION_ERROR_NOT_AVAILABLE;
+ }
+ }
priv->is_started = TRUE;
return LOCATION_ERROR_NONE;
if(priv->wps) ret_wps = location_stop(priv->wps);
if(priv->sps) ret_sps = location_stop(priv->sps);
+ priv->is_started = FALSE;
+
if (ret_gps != LOCATION_ERROR_NONE &&
ret_wps != LOCATION_ERROR_NONE &&
ret_sps != LOCATION_ERROR_NONE)
return LOCATION_ERROR_NOT_AVAILABLE;
- priv->is_started = FALSE;
return LOCATION_ERROR_NONE;
}
int
location_ielement_get_geocode (LocationIElement *self,
const LocationAddress *address,
- LocationPosition **position,
- LocationAccuracy **accuracy)
+ GList **position_list,
+ GList **accuracy_list)
{
g_return_val_if_fail (LOCATION_IS_IELEMENT (self), LOCATION_ERROR_PARAMETER);
g_return_val_if_fail (address, LOCATION_ERROR_PARAMETER);
- g_return_val_if_fail (position, LOCATION_ERROR_PARAMETER);
- g_return_val_if_fail (accuracy, LOCATION_ERROR_PARAMETER);
g_return_val_if_fail (LOCATION_IELEMENT_GET_INTERFACE (self)->get_geocode, LOCATION_ERROR_NOT_AVAILABLE);
- return LOCATION_IELEMENT_GET_INTERFACE (self)->get_geocode (self, address, position, accuracy);
+
+ return LOCATION_IELEMENT_GET_INTERFACE (self)->get_geocode (self, address, position_list, accuracy_list);
}
int
location_ielement_get_geocode_freeform (LocationIElement *self,
const gchar *address,
- LocationPosition **position,
- LocationAccuracy **accuracy)
+ GList **position_list,
+ GList **accuracy_list)
{
g_return_val_if_fail (LOCATION_IS_IELEMENT (self), LOCATION_ERROR_PARAMETER);
g_return_val_if_fail (address, LOCATION_ERROR_PARAMETER);
- g_return_val_if_fail (position, LOCATION_ERROR_PARAMETER);
- g_return_val_if_fail (accuracy, LOCATION_ERROR_PARAMETER);
g_return_val_if_fail (LOCATION_IELEMENT_GET_INTERFACE (self)->get_geocode_freeform, LOCATION_ERROR_NOT_AVAILABLE);
- return LOCATION_IELEMENT_GET_INTERFACE (self)->get_geocode_freeform (self, address, position, accuracy);
+
+ return LOCATION_IELEMENT_GET_INTERFACE (self)->get_geocode_freeform (self, address, position_list, accuracy_list);
}
int
typedef int (*TYPE_STOP_FUNC) (LocationIElement *self);
typedef int (*TYPE_GET_POSITION)(LocationIElement *self, LocationPosition **position, LocationAccuracy **accuracy);
typedef int (*TYPE_GET_VELOCITY)(LocationIElement *self, LocationVelocity **velocity, LocationAccuracy **accuracy);
-typedef int (*TYPE_GET_GEOCODE)(LocationIElement *self, const LocationAddress *address, LocationPosition **position, LocationAccuracy **accuracy);
-typedef int (*TYPE_GET_GEOCODE_FREEFORM)(LocationIElement *self, const gchar *address, LocationPosition **position, LocationAccuracy **accuracy);
+typedef int (*TYPE_GET_GEOCODE)(LocationIElement *self, const LocationAddress *address, GList **position_list, GList **accuracy_list);
+typedef int (*TYPE_GET_GEOCODE_FREEFORM)(LocationIElement *self, const gchar *address, GList **position_list, GList **accuracy_list);
typedef int (*TYPE_GET_REVERSEGEOCODE)(LocationIElement *self, const LocationPosition *position, LocationAddress **address, LocationAccuracy **accuracy);
typedef int (*TYPE_GET_GEOCODE_ASYNC)(LocationIElement *self, const LocationAddress *address, LocationPositionCB callback, gpointer userdata);
typedef int (*TYPE_GET_GEOCODE_FREEFORM_ASYNC)(LocationIElement *self, const gchar *address, LocationPositionCB callback, gpointer userdata);
int location_ielement_stop(LocationIElement *self);
int location_ielement_get_position (LocationIElement *self, LocationPosition **position, LocationAccuracy **accuracy);
int location_ielement_get_velocity (LocationIElement *self, LocationVelocity **velocity, LocationAccuracy **accuracy);
-int location_ielement_get_geocode (LocationIElement *self, const LocationAddress *address, LocationPosition **position, LocationAccuracy **accuracy);
-int location_ielement_get_geocode_freeform (LocationIElement *self, const gchar *address, LocationPosition **position, LocationAccuracy **accuracy);
+int location_ielement_get_geocode (LocationIElement *self, const LocationAddress *address, GList **position_list, GList **accuracy_list);
+int location_ielement_get_geocode_freeform (LocationIElement *self, const gchar *address, GList **position_list, GList **accuracy_list);
int location_ielement_get_reversegeocode (LocationIElement *self, const LocationPosition *position, LocationAddress **address, LocationAccuracy **accuracy);
int location_ielement_get_geocode_async (LocationIElement *self, const LocationAddress *address, LocationPositionCB callback, gpointer userdata);
int location_ielement_get_geocode_freeform_async (LocationIElement *self, const gchar *address, LocationPositionCB callback, gpointer userdata);
gboolean module_init(void);
gpointer module_new(const char* module_name);
void module_free(gpointer mod, const char* module_name);
-
+
+gboolean module_is_supported(const char *module_name);
+
G_END_DECLS
#endif
*/
typedef struct{
int (*get_service_name)(gpointer handle, gchar **servicename); ///< This is used for getting a service name from a plug-in.
- int (*get_geocode)(gpointer handle, const LocationAddress *address, LocationPosition **position, LocationAccuracy **accuracy); ///< This is used for getting a geocode from a plug-in.
- int (*get_geocode_freetext)(gpointer handle, const gchar *address, LocationPosition **position, LocationAccuracy **accuracy); ///< This is used for getting a geocode by using a free-fromed address from a plug-in.
+ int (*get_geocode)(gpointer handle, const LocationAddress *address, GList **position_list, GList **accuracy_list); ///< This is used for getting a geocode from a plug-in.
+ int (*get_geocode_freetext)(gpointer handle, const gchar *address, GList **position_list, GList **accuracy_list); ///< This is used for getting a geocode by using a free-fromed address from a plug-in.
int (*get_reverse_geocode)(gpointer handle, const LocationPosition *position, LocationAddress **address, LocationAccuracy **accuracy); ///< This is used for getting a reverse geocode from a plug-in.
int (*get_geocode_async)(gpointer handle, const LocationAddress *address, LocationPositionCB callback, gpointer userdata); ///< This is used for getting a geocode from a plug-in asynchronously.
int (*get_geocode_freetext_async)(gpointer handle, const gchar *address, LocationPositionCB callback, gpointer userdata); ///< This is used for getting a geocode by using a free-fromed address from a plug-in asynchronously.
struct _LocationPosition
{
guint timestamp; ///< Time stamp.
- guint updated_timestamp; ///< lastest updated time stamp.
+ guint updated_timestamp; ///< latest updated time stamp.
gdouble latitude; ///< Latitude data.
gdouble longitude; ///< Longitude data.
gdouble altitude; ///< Altitude data.
*/
struct _LocationLastPosition
{
+ LocationMethod method; ///< Location Method.
guint timestamp; ///< Time stamp.
gdouble latitude; ///< Latitude data.
gdouble longitude; ///< Longitude data.
- gdouble accuracy; ///< Accuracy data.
+ gdouble altitude; ///< Altitude data.
+ gdouble horizontal_accuracy; ///< Horizontal accuracy data.
+ gdouble vertical_accuracy; ///< Vertical accuracy data.
};
GType location_position_get_type (void);
void location_position_free (LocationPosition *position);
/**
- * @brief Compares two positoins for equality, returning TRUE if they are equal.
+ * @brief Compares two positions for equality, returning TRUE if they are equal.
* @remarks None.
* @pre #location_init should be called before.\n
* @post None.
guint prn; ///< The PRNs(Pseudo-Random Noise code) of a satellite.
gboolean used; ///< TRUE if currently used satellite.
guint elevation; ///< The elevation of a satellite.
- guint azimuth; ///< The degress from true north 000 to 359 of a satellite.
+ guint azimuth; ///< The degree from true north 000 to 359 of a satellite.
gint snr; ///< The signal-to-noise ratio, dB of a satellite.
} LocationSatelliteDetail;
/**
- * @brief This represents position information such as number of satelltes in used or in view.
+ * @brief This represents position information such as number of satellites in used or in view.
*/
struct _LocationSatellite
{
+ guint timestamp; ///< Time stamp.
guint num_of_sat_inview; ///< The number of satellites in view.
guint num_of_sat_used; ///< The number of satellites in used.
LocationSatelliteDetail* sat_inview; ///< The information of satellites in view .
* @param [out] prn - The PRNs(Pseudo-Random Noise code) of a #LocationSatellite
* @param [out] used - TRUE if a #LocationSatellite in used.
* @param [out] elevation - The elevation of a #LocationSatellite
- * @param [out] azimuth - The degress from true north 000 to 359 of a#LocationSatellite
+ * @param [out] azimuth - The degree from true north 000 to 359 of a#LocationSatellite
* @param [out] snr - The signal-to-noise ratio, dB of #LocationSatellite
* @return gboolean
* @retval\n
* @param [in] prn - The PRNs(Pseudo-Random Noise code) of a #LocationSatellite
* @param [in] used - TRUE if a #LocationSatellite in used.
* @param [in] elevation - The elevation of a #LocationSatellite
- * @param [in] azimuth - The degress from true north 000 to 359 of a#LocationSatellite
+ * @param [in] azimuth - The degree from true north 000 to 359 of a#LocationSatellite
* @param [in] snr - The signal-to-noise ratio, dB of #LocationSatellite
* @return gboolean
* @retval\n
return -1;
}
LOCATION_LOGD("vconf notify removed [%s]", path);
- return -1;
+ return 0;
}
/**
* @file location-setting.h
- * @brief This file contains the defintions and functions for setting.
+ * @brief This file contains the definitions and functions for setting.
* @addtogroup LocationInternal
* @{
* @}
#define VCONF_LOCATION_PATH "db/location"
-#define LOCATION_POSITION_PATH VCONF_LOCATION_PATH"/position"
-#define LAST_TIMESTAMP LOCATION_POSITION_PATH"/Timestamp"
-#define LAST_POSITION LOCATION_POSITION_PATH"/LastPosition"
-#define LAST_ACCURACY LOCATION_POSITION_PATH"/LastAccuracy"
+#define LOCATION_LAST_POSITION_PATH VCONF_LOCATION_PATH"/lastposition"
+#define GPS_LAST_POSITION_PATH LOCATION_LAST_POSITION_PATH"/gps"
+#define WPS_LAST_POSITION_PATH LOCATION_LAST_POSITION_PATH"/wps"
+#define SPS_LAST_POSITION_PATH LOCATION_LAST_POSITION_PATH"/sps"
+
+#define GPS_LAST_TIMESTAMP GPS_LAST_POSITION_PATH"/Timestamp"
+#define GPS_LAST_LATITUDE GPS_LAST_POSITION_PATH"/Latitude"
+#define GPS_LAST_LONGITUDE GPS_LAST_POSITION_PATH"/Longitude"
+#define GPS_LAST_ALTITUDE GPS_LAST_POSITION_PATH"/Altitude"
+#define GPS_LAST_HORACCURACY GPS_LAST_POSITION_PATH"/HorAccuracy"
+#define GPS_LAST_VERACCURACY GPS_LAST_POSITION_PATH"/VerAccuracy"
+
+#define WPS_LAST_TIMESTAMP WPS_LAST_POSITION_PATH"/Timestamp"
+#define WPS_LAST_LATITUDE WPS_LAST_POSITION_PATH"/Latitude"
+#define WPS_LAST_LONGITUDE WPS_LAST_POSITION_PATH"/Longitude"
+#define WPS_LAST_ALTITUDE WPS_LAST_POSITION_PATH"/Altitude"
+#define WPS_LAST_HORACCURACY WPS_LAST_POSITION_PATH"/HorAccuracy"
+#define WPS_LAST_VERACCURACY WPS_LAST_POSITION_PATH"/VerAccuracy"
+
+#define SPS_LAST_TIMESTAMP SPS_LAST_POSITION_PATH"/Timestamp"
+#define SPS_LAST_LATITUDE SPS_LAST_POSITION_PATH"/Latitude"
+#define SPS_LAST_LONGITUDE SPS_LAST_POSITION_PATH"/Longitude"
+#define SPS_LAST_ALTITUDE SPS_LAST_POSITION_PATH"/Altitude"
+#define SPS_LAST_HORACCURACY SPS_LAST_POSITION_PATH"/HorAccuracy"
+#define SPS_LAST_VERACCURACY SPS_LAST_POSITION_PATH"/VerAccuracy"
#define GPS_ENABLED VCONFKEY_LOCATION_ENABLED
#define LOCATION_SETTING_PATH VCONF_LOCATION_PATH"/setting"
GList *boundary_list = prev_bound;
LocationBoundary *boundary = NULL;
- if (prev_enabled == FALSE) enable_signaling(obj, signals, prev_enabled, enabled, pos->status);
-
- if(*prev_pos || !*prev_acc || location_accuracy_level_compare(*prev_acc, acc) != -1 ||
+ if(!*prev_pos || !*prev_acc || location_accuracy_level_compare(*prev_acc, acc) != -1 ||
(pos->timestamp - (*prev_pos)->timestamp) > POS_EXPIRATION_TIME) {
if(*prev_pos) {
guint updated_timestamp = 0;
- if (prev_enabled == FALSE) enable_signaling(obj, signals, prev_enabled, enabled, LOCATION_STATUS_NO_FIX);
-
if(*prev_vel) {
updated_timestamp = (*prev_vel)->updated_timestamp;
if(!location_velocity_equal(*prev_vel, vel)) {
typedef struct _LocationSpsPrivate {
LocationSpsMod* mod;
gboolean is_started;
+ gboolean set_noti;
gboolean enabled;
guint interval;
LocationPosition *pos;
LocationSpsPrivate* priv = GET_PRIVATE(self);
g_return_if_fail (priv->mod);
g_return_if_fail (priv->mod->handler);
- if (0 == location_setting_get_key_val(key) && priv->mod->ops.stop) {
- LOCATION_LOGD("location stopped by setting");
- priv->mod->ops.stop(priv->mod->handler);
+
+ int ret = LOCATION_ERROR_NONE;
+
+ if (location_setting_get_key_val(key) == 0) {
+ if (priv->mod->ops.stop && priv->is_started) {
+ ret = priv->mod->ops.stop(priv->mod->handler);
+ if (ret == LOCATION_ERROR_NONE) priv->is_started = FALSE;
+ }
}
- else if (1 == location_setting_get_key_val(key) && priv->mod->ops.start) {
- LOCATION_LOGD("location resumed by setting");
- priv->mod->ops.start (priv->mod->handler, sps_status_cb, sps_position_cb, sps_velocity_cb, self);
+ else {
+ if (location_setting_get_int(SENSOR_ENABLED) &&
+ priv->mod->ops.start && !priv->is_started) {
+ LOCATION_LOGD("location resumed by setting");
+ ret = priv->mod->ops.start (priv->mod->handler, sps_status_cb, sps_position_cb, sps_velocity_cb, self);
+ if (ret == LOCATION_ERROR_NONE) priv->is_started = TRUE;
+ }
}
+
}
static int
g_return_val_if_fail (priv->mod->handler, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail (priv->mod->ops.start, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail (priv->mod->ops.update_data, LOCATION_ERROR_NOT_AVAILABLE);
- setting_retval_if_fail(GPS_ENABLED);
- setting_retval_if_fail(SENSOR_ENABLED);
+
if( priv->is_started == TRUE) return LOCATION_ERROR_NONE;
- int ret = priv->mod->ops.start(priv->mod->handler, sps_status_cb, sps_position_cb, sps_velocity_cb, self);
- if(ret == LOCATION_ERROR_NONE){
- priv->is_started = TRUE;
- location_setting_add_notify (GPS_ENABLED, location_setting_sps_cb, self);
- location_setting_add_notify (SENSOR_ENABLED, location_setting_sps_cb, self);
+ int ret = LOCATION_ERROR_NONE;
+ int noti_err = 0;
+
+ if (!location_setting_get_int(GPS_ENABLED) || !location_setting_get_int(SENSOR_ENABLED)) {
+ ret = LOCATION_ERROR_NOT_ALLOWED;
+ }
+ else {
+ ret = priv->mod->ops.start(priv->mod->handler, sps_status_cb, sps_position_cb, sps_velocity_cb, self);
+ if (ret == LOCATION_ERROR_NONE) {
+ priv->is_started = TRUE;
+ }
+ else {
+ return ret;
+ }
+
priv->mod->ops.update_data(priv->mod->handler, priv->pos_base, priv->vel_base, priv->acc_info, priv->sat_info);
}
+
+ if (priv->set_noti == FALSE) {
+ noti_err = location_setting_add_notify (GPS_ENABLED, location_setting_sps_cb, self);
+ if (noti_err != 0) {
+ return LOCATION_ERROR_UNKNOWN;
+ }
+ noti_err = location_setting_add_notify (SENSOR_ENABLED, location_setting_sps_cb, self);
+ if (noti_err != 0) {
+ return LOCATION_ERROR_UNKNOWN;
+ }
+ priv->set_noti = TRUE;
+ }
+
return ret;
}
g_return_val_if_fail (priv->mod, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail (priv->mod->handler, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail (priv->mod->ops.stop, LOCATION_ERROR_NOT_AVAILABLE);
- if (priv->is_started == FALSE) return LOCATION_ERROR_NONE;
- int ret = priv->mod->ops.stop (priv->mod->handler);
- if (ret == LOCATION_ERROR_NONE){
- priv->is_started = FALSE;
- location_setting_ignore_notify (GPS_ENABLED, location_setting_sps_cb);
- location_setting_ignore_notify (SENSOR_ENABLED, location_setting_sps_cb);
+ int ret = LOCATION_ERROR_NONE;
+ int noti_err = 0;
+
+ if (priv->is_started == TRUE) {
+ ret = priv->mod->ops.stop (priv->mod->handler);
+ if (ret == LOCATION_ERROR_NONE) {
+ priv->is_started = FALSE;
+ }
+ else {
+ return ret;
+ }
+ }
+
+ if (priv->set_noti == TRUE) {
+ noti_err = location_setting_ignore_notify (GPS_ENABLED, location_setting_sps_cb);
+ if (noti_err != 0) {
+ return LOCATION_ERROR_UNKNOWN;
+ }
+ noti_err = location_setting_ignore_notify (SENSOR_ENABLED, location_setting_sps_cb);
+ if (noti_err != 0) {
+ return LOCATION_ERROR_UNKNOWN;
+ }
+ priv->set_noti = FALSE;
}
+
return ret;
}
G_BEGIN_DECLS
+#ifndef LOCATION_DEPRECATED_API
+#define LOCATION_DEPRECATED_API __attribute__ ((deprecated))
+#endif
+
/**
* @file location-types.h
* @brief This file contains the Location related structure, enumeration, and asynchronous function definitions.
LOCATION_ERROR_NETWORK_NOT_CONNECTED, ///< Network is not connected.
LOCATION_ERROR_CONFIGURATION, ///< Configuration setting is not correct.
LOCATION_ERROR_PARAMETER, ///< Input parameter is not correct.
+ LOCATION_ERROR_NOT_FOUND, ///< Output is not found.
LOCATION_ERROR_UNKNOWN, ///< Unknown error.
} LocationError;
UPDATE_TYPE_NONE = -1, ///< Undefined update type.
POSITION_UPDATED = 0, ///< This type is used when position information is updated.
VELOCITY_UPDATED, ///< This type is used when velocity information is updated.
+ SATELLITE_UPDATED, ///< This type is used when satellite information is updated.
ADDRESS_UPDATED, ///< This type is used when address information is updated. This is not implemented yet.
GEOCODE_UPDATED, ///< This type is used when geocode information is updated. This is not implemented yet.
REVERSEGEOCODE_UPDATED ///< This type is used when reverse geocode information is updated. This is not implemented yet.
typedef struct _LocationPosition LocationPosition;
/**
- * @brief This represents last known position information such as latitude-longitud values and accuracy.
+ * @brief This represents last known position information such as latitude-longitude values and accuracy.
*/
typedef struct _LocationLastPosition LocationLastPosition;
typedef struct _LocationAddress LocationAddress;
/**
- * @brief This represents boundary information such as rectagular or circle area.
+ * @brief This represents boundary information such as rectangular or circle area.
*/
typedef struct _LocationBoundary LocationBoundary;
/**
- * @brief This represents position information such as number of satelltes in used or in view.
+ * @brief This represents position information such as number of satellites in used or in view.
*/
typedef struct _LocationSatellite LocationSatellite;
typedef struct _LocationPOIInfo LocationPOIInfo;
/**
- * @brief This represents callback function which will be called to give postiion information.
+ * @brief This represents callback function which will be called to give position information.
*/
-typedef void (*LocationPositionCB)(LocationError error, LocationPosition *position, LocationAccuracy *acc, gpointer userdata);
+typedef void (*LocationPositionCB)(LocationError error, GList *position_list, GList *accuracy_list, gpointer userdata);
/**
* @brief This represents callback function which will be called to give address information.
typedef struct _LocationWpsPrivate {
LocationWpsMod* mod;
gboolean is_started;
+ gboolean set_noti;
gboolean enabled;
guint interval;
LocationPosition *pos;
LocationWpsPrivate* priv = GET_PRIVATE(self);
g_return_if_fail (priv->mod);
g_return_if_fail (priv->mod->handler);
- if (0 == location_setting_get_key_val(key) && priv->mod->ops.stop) {
- LOCATION_LOGD("location stopped by setting");
- priv->mod->ops.stop(priv->mod->handler);
+
+ int ret = LOCATION_ERROR_NONE;
+
+ if (location_setting_get_key_val(key) == 0) {
+ if (priv->mod->ops.stop && priv->is_started) {
+ ret = priv->mod->ops.stop(priv->mod->handler);
+ if (ret == LOCATION_ERROR_NONE) priv->is_started = FALSE;
+ }
}
- else if (1 == location_setting_get_key_val(key) && priv->mod->ops.start) {
- LOCATION_LOGD("location resumed by setting");
- priv->mod->ops.start (priv->mod->handler, wps_status_cb, wps_position_cb, wps_velocity_cb, self);
+ else {
+ if (1 == location_setting_get_int(NETWORK_ENABLED) && priv->mod->ops.start && !priv->is_started) {
+ LOCATION_LOGD("location resumed by setting");
+ ret = priv->mod->ops.start (priv->mod->handler, wps_status_cb, wps_position_cb, wps_velocity_cb, self);
+ if (ret == LOCATION_ERROR_NONE) priv->is_started = TRUE;
+ }
}
+
}
static int
g_return_val_if_fail (priv->mod, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail (priv->mod->handler, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail (priv->mod->ops.start, LOCATION_ERROR_NOT_AVAILABLE);
- setting_retval_if_fail (GPS_ENABLED);
- setting_retval_if_fail (NETWORK_ENABLED);
+
if (priv->is_started == TRUE) return LOCATION_ERROR_NONE;
- int ret = priv->mod->ops.start (priv->mod->handler, wps_status_cb, wps_position_cb, wps_velocity_cb, self);
- if (ret == LOCATION_ERROR_NONE) {
- priv->is_started = TRUE;
- location_setting_add_notify (GPS_ENABLED, location_setting_wps_cb, self);
- location_setting_add_notify (NETWORK_ENABLED, location_setting_wps_cb, self);
+ int ret = LOCATION_ERROR_NONE;
+ int noti_err = 0;
+
+ if (!location_setting_get_int(GPS_ENABLED) || !location_setting_get_int(NETWORK_ENABLED)) {
+ ret = LOCATION_ERROR_NOT_ALLOWED;
+ }
+ else {
+ ret = priv->mod->ops.start (priv->mod->handler, wps_status_cb, wps_position_cb, wps_velocity_cb, self);
+ if (ret == LOCATION_ERROR_NONE) {
+ priv->is_started = TRUE;
+ }
+ else {
+ return ret;
+ }
}
+
+ if (priv->set_noti == FALSE) {
+ noti_err = location_setting_add_notify (GPS_ENABLED, location_setting_wps_cb, self);
+ if (noti_err != 0) {
+ return LOCATION_ERROR_UNKNOWN;
+ }
+ noti_err = location_setting_add_notify (NETWORK_ENABLED, location_setting_wps_cb, self);
+ if (noti_err != 0) {
+ return LOCATION_ERROR_UNKNOWN;
+ }
+ priv->set_noti = TRUE;
+ }
+
return ret;
}
g_return_val_if_fail (priv->mod, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail (priv->mod->handler, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail (priv->mod->ops.stop, LOCATION_ERROR_NOT_AVAILABLE);
- if( priv->is_started == FALSE) return LOCATION_ERROR_NONE;
- int ret = priv->mod->ops.stop (priv->mod->handler);
- if (ret == LOCATION_ERROR_NONE) {
- priv->is_started = FALSE;
- location_setting_ignore_notify (GPS_ENABLED, location_setting_wps_cb);
- location_setting_ignore_notify (NETWORK_ENABLED, location_setting_wps_cb);
+ int ret = LOCATION_ERROR_NONE;
+ int noti_err = 0;
+
+ if (priv->is_started == TRUE) {
+ ret = priv->mod->ops.stop (priv->mod->handler);
+ if (ret == LOCATION_ERROR_NONE) {
+ priv->is_started = FALSE;
+ }
+ else {
+ return ret;
+ }
}
+
+ if (priv->set_noti == TRUE) {
+ noti_err = location_setting_ignore_notify (GPS_ENABLED, location_setting_wps_cb);
+ if (noti_err != 0) {
+ return LOCATION_ERROR_UNKNOWN;
+ }
+ noti_err = location_setting_ignore_notify (NETWORK_ENABLED, location_setting_wps_cb);
+ if (noti_err != 0) {
+ return LOCATION_ERROR_UNKNOWN;
+ }
+ priv->set_noti = FALSE;
+ }
+
return ret;
}
if(!priv->mod) LOCATION_LOGW("module loading failed");
priv->is_started = FALSE;
+ priv->set_noti = FALSE;
priv->enabled= FALSE;
priv->interval = LOCATION_UPDATE_INTERVAL_DEFAULT;
LocationAccuracy **accuracy)
{
g_return_val_if_fail (obj, LOCATION_ERROR_PARAMETER);
+ g_return_val_if_fail (position, LOCATION_ERROR_PARAMETER);
+ g_return_val_if_fail (accuracy, LOCATION_ERROR_PARAMETER);
return location_ielement_get_position (LOCATION_IELEMENT(obj), position, accuracy);
}
EXPORT_API int
-location_get_last_known_position (LocationObject *obj,
+location_get_last_position (LocationObject *obj, LocationMethod method,
+ LocationPosition **position,
+ LocationAccuracy **accuracy)
+{
+ g_return_val_if_fail (position, LOCATION_ERROR_PARAMETER);
+ g_return_val_if_fail (accuracy, LOCATION_ERROR_PARAMETER);
+
+ return LOCATION_ERROR_NONE;
+}
+
+EXPORT_API int
+location_get_last_known_position (LocationObject *obj, LocationMethod method,
LocationLastPosition *last_position)
{
g_return_val_if_fail (last_position, LOCATION_ERROR_PARAMETER);
- int ret = -1;
- int lat, lon, acc;
- char position[MAX_KEY_LENGTH + 1] = {0,};
-
- snprintf(position, MAX_KEY_LENGTH + 1, "%s", location_setting_get_string(LAST_POSITION));
- if (position[0] != '\0') {
- location_last_position_a2i(position, &lat, &lon);
- LOCATION_LOGD("location_last_position_a2i [%s][%d/%d]", position, lat, lon);
- acc = location_setting_get_int(LAST_ACCURACY);
-
- last_position->latitude = lat * 0.0001;
- last_position->longitude = lon * 0.0001;
- last_position->accuracy = acc * 0.0001;
- LOCATION_LOGD("last_position [%f/%f]", last_position->latitude, last_position->longitude);
- ret = LOCATION_ERROR_NONE;
- } else {
- LOCATION_LOGD("location_last_position is empty");
- ret = LOCATION_ERROR_UNKNOWN;
+ LocationMethod redefined_method = method;
+
+ if (!obj) redefined_method = LOCATION_METHOD_HYBRID;
+
+ if (redefined_method == LOCATION_METHOD_HYBRID) {
+ int gps_timestamp = 0, wps_timestamp = 0, sps_timestamp = 0;
+ int latest_timestamp = 0;
+
+ redefined_method = LOCATION_METHOD_SPS;
+ vconf_get_int(GPS_LAST_TIMESTAMP, &gps_timestamp);
+ vconf_get_int(WPS_LAST_TIMESTAMP, &wps_timestamp);
+ vconf_get_int(SPS_LAST_TIMESTAMP, &sps_timestamp);
+
+ redefined_method = LOCATION_METHOD_SPS;
+ latest_timestamp = sps_timestamp;
+ if (gps_timestamp > sps_timestamp) {
+ redefined_method = LOCATION_METHOD_GPS;
+ latest_timestamp = gps_timestamp;
+ }
+
+ if (wps_timestamp > latest_timestamp) {
+ redefined_method = LOCATION_METHOD_WPS;
+ }
+
}
- return ret;
+ if (get_last_known_position (redefined_method, last_position)) {
+ return LOCATION_ERROR_UNKNOWN;
+ }
+
+ return LOCATION_ERROR_NONE;
+}
+
+EXPORT_API int
+location_get_satellite (LocationObject *obj, LocationSatellite **satellite)
+{
+ g_return_val_if_fail (obj, LOCATION_ERROR_PARAMETER);
+ g_return_val_if_fail (satellite, LOCATION_ERROR_PARAMETER);
+
+ return LOCATION_ERROR_NONE;;
+}
+
+EXPORT_API int
+location_get_last_satellite (LocationObject *obj, LocationSatellite **satellite)
+{
+ g_return_val_if_fail (obj, LOCATION_ERROR_PARAMETER);
+ g_return_val_if_fail (satellite, LOCATION_ERROR_PARAMETER);
+
+ return LOCATION_ERROR_NONE;;
}
EXPORT_API int
location_get_position_from_address (LocationObject *obj,
const LocationAddress *address,
- LocationPosition **position,
- LocationAccuracy **accuracy)
+ GList **position_list,
+ GList **accuracy_list)
{
g_return_val_if_fail (obj, LOCATION_ERROR_PARAMETER);
g_return_val_if_fail (geocode, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail (is_connected_network(), LOCATION_ERROR_NETWORK_NOT_CONNECTED);
- return location_ielement_get_geocode (LOCATION_IELEMENT(geocode), address, position, accuracy);
+ return location_ielement_get_geocode (LOCATION_IELEMENT(geocode), address, position_list, accuracy_list);
}
EXPORT_API int
location_get_position_from_freeformed_address (LocationObject *obj,
const gchar *address,
- LocationPosition **position,
- LocationAccuracy **accuracy)
+ GList **position_list,
+ GList **accuracy_list)
{
g_return_val_if_fail (obj, LOCATION_ERROR_PARAMETER);
g_return_val_if_fail (geocode, LOCATION_ERROR_NOT_AVAILABLE);
g_return_val_if_fail (is_connected_network(), LOCATION_ERROR_NETWORK_NOT_CONNECTED);
- return location_ielement_get_geocode_freeform (LOCATION_IELEMENT(geocode), address, position, accuracy);
+ return location_ielement_get_geocode_freeform (LOCATION_IELEMENT(geocode), address, position_list, accuracy_list);
}
EXPORT_API int
LocationAccuracy **accuracy)
{
g_return_val_if_fail (obj, LOCATION_ERROR_PARAMETER);
+ g_return_val_if_fail (velocity, LOCATION_ERROR_PARAMETER);
+ g_return_val_if_fail (accuracy, LOCATION_ERROR_PARAMETER);
+
return location_ielement_get_velocity (LOCATION_IELEMENT(obj), velocity, accuracy);
}
EXPORT_API int
+location_get_last_velocity (LocationObject *obj,
+ LocationVelocity **velocity,
+ LocationAccuracy **accuracy)
+{
+ g_return_val_if_fail (obj, LOCATION_ERROR_PARAMETER);
+ g_return_val_if_fail (velocity, LOCATION_ERROR_PARAMETER);
+ g_return_val_if_fail (accuracy, LOCATION_ERROR_PARAMETER);
+ return LOCATION_ERROR_NONE;
+}
+
+EXPORT_API int
location_get_address (LocationObject *obj,
LocationAddress **address,
LocationAccuracy **accuracy)
#include <location.h>
static GMainLoop *loop = NULL;
+static void cb_service_enabled (GObject *self, guint status, gpointer userdata)
+{
+ LocationObject *loc = (LocationObject*)userdata;
+ LocationAccuracy *acc = NULL;
+ LocationPosition *pos = NULL;
+ LocationVelocity *vel = NULL;
+ LocationAddress *addr = NULL;
+ LocationMethod method;
+
+ g_object_get(loc, "method", &method, NULL);
+ g_debug("Get property>> method:%d", method);
+
+ if (LOCATION_ERROR_NONE == location_get_position (loc, &pos, &acc)) {
+ g_debug ("SYNC>> Current position> time: %d, lat: %f, long: %f, alt: %f, status: %d",
+ pos->timestamp, pos->latitude, pos->longitude, pos->altitude, pos->status);
+ g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)",
+ acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+ location_position_free(pos);
+ location_accuracy_free(acc);
+ } else g_warning ("SYNC>> Current position> failed");
+
+ if (LOCATION_ERROR_NONE == location_get_velocity (loc, &vel, &acc)) {
+ g_debug ("SYNC>> Current velocity> time: %d, speed: %f, direction:%f, climb:%f",
+ vel->timestamp, vel->speed, vel->direction, vel->climb);
+ g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)",
+ acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+ location_velocity_free(vel);
+ location_accuracy_free(acc);
+ } else g_warning ("SYNC>> Current velocity> failed");
+
+ if (LOCATION_ERROR_NONE == location_get_address(loc, &addr, &acc)) {
+ g_debug ("SYNC>> Current address> %s %s %s %s %s %s %s",
+ addr->building_number, addr->street, addr->district, addr->city, addr->state, addr->postal_code, addr->country_code);
+ g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+ location_address_free(addr);
+ location_accuracy_free(acc);
+ } else g_warning ("SYNC>> Current address> failed");
+}
+
+static void
+cb_service_updated (GObject *self,
+ guint type,
+ gpointer data,
+ gpointer accuracy,
+ gpointer userdata)
+{
+ LocationAccuracy *acc = (LocationAccuracy*) accuracy;
+ switch (type) {
+ case POSITION_UPDATED: {
+ LocationPosition *pos = (LocationPosition*) data;
+ g_debug ("ASYNC>> Current position> time: %d, lat: %f, long: %f, alt: %f, status: %d",
+ pos->timestamp, pos->latitude, pos->longitude, pos->altitude, pos->status);
+ g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)",
+ acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+ }
+ break;
+ case VELOCITY_UPDATED: {
+ LocationVelocity *vel = (LocationVelocity*) data;
+ g_debug ("ASYNC>> Current velocity> time: %d, speed: %f, direction:%f, climb:%f",
+ vel->timestamp, vel->speed, vel->direction, vel->climb);
+ g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)",
+ acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+ }
+ break;
+ default:
+ g_warning ("ASYNC>> Undefined update type");
+ break;
+ }
+}
+
+
int main (int argc, char *argv[])
{
LocationObject *loc = NULL;
g_object_set(loc, "update-interval", interval, NULL);
+ g_signal_connect (loc, "service-enabled", G_CALLBACK(cb_service_enabled), loc);
+ g_signal_connect (loc, "service-updated", G_CALLBACK(cb_service_updated), loc);
+
location_start(loc);
loop = g_main_loop_new (NULL, TRUE);
g_main_loop_run (loop); // GMainLoop is needed for receiving signals.
// ...
return 0;
}
- * @endcode
- */
+* @endcode
+*/
int location_start (LocationObject *obj);
/**
}
* @endcode
*/
-int location_get_position (LocationObject *obj, LocationPosition **position, LocationAccuracy **accuracy);
+int location_get_position (LocationObject *obj, LocationPosition **position, LocationAccuracy **accuracy);
/**
* @brief
- * Get last known position information with estimate of the accuracy.
- * @remarks None.
+ * Get last position information with estimate of the accuracy.
+ * @remarks This API is not implemented now. \n
+ * Out parameters are should be freed.
* @pre
* #location_init should be called before.
* @post None.
* @param [in]
* obj - a #LocationObject created by #location_new
+ * @param [out]
+ * position - a new #LocationPosition
+ * @param [out]
+ * accuracy - a new #LocationAccuracy
+ * @return int
+ * @retval 0 Success
+ *
+ * Please refer #LocationError for more information.
+ * @see location_get_position
+ * @par Example
+ * @code
+#include <location.h>
+
+int main (int argc, char *argv[])
+{
+ LocationObject *loc = NULL;
+ int ret = 0;
+ LocationPosition *last_pos = NULL;
+ LocationAccuracy *last_acc = NULL;
+
+ location_init ();
+ loc = location_new (LOCATION_METHOD_GPS);
+ if(!loc){
+ g_debug("location_new failed");
+ return -1;
+ }
+
+ if (LOCATION_ERROR_NONE == location_get_last_position (loc, LOCATION_METHOD_GPS, &last_pos, &last_acc)) {
+ g_debug ("SYNC>> Last position> time: %d, lat: %f, long: %f, alt: %f, status: %d",
+ last_pos->timestamp, last_pos->latitude, last_pos->longitude, last_pos->altitude, last_pos->status);
+ g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)",
+ last_acc->level, last_acc->horizontal_accuracy, last_acc->vertical_accuracy);
+ location_position_free(last_pos);
+ location_accuracy_free(last_acc);
+ } else g_warning ("SYNC>> Last position> failed");
+
+ location_free (loc);
+
+ return 0;
+}
+ * @endcode
+ */
+int location_get_last_position (LocationObject *obj, LocationMethod method, LocationPosition **position, LocationAccuracy **accuracy);
+
+/**
+ * @brief
+ * Get last satellite information.
+ * @remarks This API is not implemented now. \n
+ * Out parameters are should be freed.
+ * @pre
+ * #location_init should be called before.
+ * @post None.
* @param [in]
- * last_position - a #LocationLastPosition
+ * obj - a #LocationObject created by #location_new
+ * @param [out] satellite - a new #LocationSatellite
+ * @return int
+ * @retval 0 Success
+ * Please refer #LocationError for more information.
+ * @see location_get_last_satellite
+ * @par Example
+ * @code
+#include <location.h>
+
+int main (int argc, char *argv[])
+{
+ LocationObject *loc = NULL;
+ int ret = 0, idx = 0;
+ LocationSatellite *sat = NULL;
+ guint prn;
+ gboolean used;
+ guint elevation;
+ guint azimuth;
+ gint snr;
+
+ location_init ();
+ loc = location_new (LOCATION_METHOD_GPS);
+ if(!loc){
+ g_debug("location_new failed");
+ return -1;
+ }
+
+ if (LOCATION_ERROR_NONE == location_get_satellite (loc, &sat)) {
+ g_debug ("SYNC>> Current Sattelite> satellite in view = %d, satellite in used = %d", sat->num_of_sat_inview, sat->num_of_sat_used);
+ g_debug ("\tinview satellite information = ");
+ for (idx=0; idx<sat->num_of_sat_inview; idx++) {
+ location_satellite_get_satellite_details(sat, idx, &prn, &used, &elevation, &azimuth, &snr);
+ g_debug ("\t\t[%02d] used: %d, prn: %d, elevation: %d, azimuth: %d, snr: %d", idx, used, prn, elevation, azimuth, snr);
+ }
+ location_satellite_free (sat);
+ } else g_warning ("SYNC>> Current satellite> failed");
+
+ location_free (loc);
+
+ return 0;
+}
+ * @endcode
+ */
+int location_get_satellite (LocationObject *obj, LocationSatellite **satellite);
+
+/**
+ * @brief
+ * Get last satellite information.
+ * @remarks This API is not implemented now. \n
+ * Out parameters are should be freed.
+ * @pre
+ * #location_init should be called before.
+ * @post None.
+ * @param [in]
+ * obj - a #LocationObject created by #location_new
+ * @param [out]
+ * satellite - a new #LocationSatellite
* @return int
* @retval 0 Success
*
+ * Please refer #LocationError for more information.
* @par Example
* @code
#include <location.h>
int main (int argc, char *argv[])
{
LocationObject *loc = NULL;
- LocationLastPosition last_pos;
+ int ret = 0, idx = 0;
+ LocationSatellite *last_sat = NULL;
+ guint prn;
+ gboolean used;
+ guint elevation;
+ guint azimuth;
+ gint snr;
+
location_init ();
loc = location_new (LOCATION_METHOD_GPS);
- if (!loc) {
+ if(!loc){
g_debug("location_new failed");
return -1;
}
- location_get_last_known_position(loc, &last_pos);
- g_debug ("Last known position > lat: %f, long: %f, acc: %f", last_pos.latitude, last_pos.longitude, last_pos.accuracy);
+ if (LOCATION_ERROR_NONE == location_get_last_satellite (loc, &last_sat)) {
+ g_debug ("SYNC>> Last Sattelite> satellite in view = %d, satellite in used = %d", last_sat->num_of_sat_inview, last_sat->num_of_sat_used);
+ g_debug ("\tinview satellite information = ");
+ for (idx=0; idx<last_sat->num_of_sat_inview; idx++) {
+ location_satellite_get_satellite_details(last_sat, idx, &prn, &used, &elevation, &azimuth, &snr);
+ g_debug ("\t\t[%02d] used: %d, prn: %d, elevation: %d, azimuth: %d, snr: %d", idx, used, prn, elevation, azimuth, snr);
+ }
+ location_satellite_free (last_sat);
+ } else g_warning ("SYNC>> Last satellite> failed");
location_free (loc);
+
return 0;
}
* @endcode
*/
-int location_get_last_known_position (LocationObject *obj, LocationLastPosition *last_position);
+int location_get_last_satellite (LocationObject *obj, LocationSatellite **satellite);
+/**
+ * @brief
+ * Get last known position information with estimate of the accuracy.
+ * @remarks This API would be DEPRECATED. \n
+ * @see location_get_last_position
+ */
+int location_get_last_known_position (LocationObject *obj, LocationMethod method, LocationLastPosition *last_position) LOCATION_DEPRECATED_API;
/**
* @brief
* @param [in]
* address - a #LocationAddress
* @param [out]
- * position - a new #LocationPosition
+ * position_list - a list of #LocationPosition
* @param [out]
- * accuracy - a new #LocationAccuracy
+ * accuracy_list - a list of #LocationAccuracy
* @return int
* @retval 0 Success.
*
* @code
#include <location.h>
+static void PrintPos (gpointer data, gpointer user_data)
+{
+ LocationPosition *pos = (LocationPosition *)data;
+
+ if (pos) {
+ g_debug("time: [%d], latitude: [%f], longitude: [%f], altitude: [%f]\n", pos->timestamp, pos->latitude, pos->longitude, pos->altitude);
+ location_position_free (pos);
+ }
+}
+
+static void PrintAcc (gpointer data, gpointer user_data)
+{
+ LocationAccuracy *acc = (LocationAccuracy *)data;
+
+ if (acc) {
+ g_debug("level: [%d], horizontal_accuracy: [%f], vertical_accuracy: [%f]\n", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+ location_accuracy_free (acc);
+ }
+}
+
int main (int argc, char *argv[])
{
LocationObject *loc = NULL;
return -1;
}
- LocationPosition *pos = NULL;
- LocationAccuracy *acc = NULL;
+ GList *pos_list = NULL;
+ GList *acc_list = NULL;
LocationAddress *addr = NULL;
addr = location_address_new ("1", "Post Street", NULL, "san jose", "ca", NULL, "95113");
- if (LOCATION_ERROR_NONE == location_get_position_from_address(loc, addr, &pos, &acc)) {
- g_debug ("SYNC>> position from address> time: %d, lat: %f, long: %f, alt: %f, status: %d",
- pos->timestamp, pos->latitude, pos->longitude, pos->altitude, pos->status);
- g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)",
- acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
- location_position_free (pos);
- location_accuracy_free (acc);
+ if (LOCATION_ERROR_NONE == location_get_position_from_address(loc, addr, &pos_list, &acc_list)) {
+ g_list_foreach (pos_list, PrintPos, NULL);
+ g_list_foreach (acc_list, PrintAcc, NULL);
} else g_warning ("SYNC>> position from address> failed");
- location_address_free (addr);
+ if (pos_list) {
+ g_list_free (pos_list);
+ }
+ if (acc_list) {
+ g_list_free (acc_list);
+ }
+
+ location_address_free (addr);
location_free (loc);
return 0;
}
* @endcode
*/
-int location_get_position_from_address (LocationObject *obj, const LocationAddress *address, LocationPosition **position, LocationAccuracy **accuracy);
+int location_get_position_from_address (LocationObject *obj, const LocationAddress *address, GList **position_list, GList **accuracy_list);
/**
* @brief
* @code
#include <location.h>
+static void PrintPos (gpointer data, gpointer user_data)
+{
+ LocationPosition *pos = (LocationPosition *)data;
+
+ if (pos) {
+ g_debug("time: [%d], latitude: [%f], longitude: [%f], altitude: [%f]\n", pos->timestamp, pos->latitude, pos->longitude, pos->altitude);
+ }
+}
+
+static void PrintAcc (gpointer data, gpointer user_data)
+{
+ LocationAccuracy *acc = (LocationAccuracy *)data;
+
+ if (acc) {
+ g_debug("level: [%d], horizontal_accuracy: [%f], vertical_accuracy: [%f]\n", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+ }
+}
static void
-cb_position_from_address (LocationError error, LocationPosition *pos, LocationAccuracy *acc, gpointer userdata)
+cb_position_from_address (LocationError error, GList *position_list, GList *accuracy_list, gpointer userdata)
{
- g_debug ("ASYNC>> location_get_position_from_address_async> time: %d, lat: %f, long: %f, alt: %f, status: %d",
- pos->timestamp, pos->latitude, pos->longitude, pos->altitude, pos->status);
- g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+ if (position_list && accuracy_list) {
+ g_list_foreach (position_list, PrintPos);
+ g_list_foreach (accuracy_list, PrintAcc);
+ }
}
void get_position_from_address(LocationObject* loc)
* @param [in]
* address - Free-formed address string to be used
* @param [out]
- * position - a new #LocationPosition
+ * position_list - a list of #LocationPosition
* @param [out]
- * accuracy - a new #LocationAccuracy
+ * accuracy_list - a list of #LocationAccuracy
* @return int
* @retval 0 Success
*
* @code
#include <location.h>
+static void PrintPos (gpointer data, gpointer user_data)
+{
+ LocationPosition *pos = (LocationPosition *)data;
+
+ if (pos) {
+ g_debug("time: [%d], latitude: [%f], longitude: [%f], altitude: [%f]\n", pos->timestamp, pos->latitude, pos->longitude, pos->altitude);
+ location_position_free (pos);
+ }
+}
+
+static void PrintAcc (gpointer data, gpointer user_data)
+{
+ LocationAccuracy *acc = (LocationAccuracy *)data;
+
+ if (acc) {
+ g_debug("level: [%d], horizontal_accuracy: [%f], vertical_accuracy: [%f]\n", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+ location_accuracy_free (acc);
+ }
+}
+
int main (int argc, char *argv[])
{
LocationObject *loc = NULL;
return -1;
}
- LocationPosition *pos = NULL;
- LocationAccuracy *acc = NULL;
+ GList *pos_list = NULL;
+ GList *acc_list = NULL;
char* addr_str = g_strdup("4 N 2nd Street 95113");
//Calling application must have an active data connection before using this function.
- if (LOCATION_ERROR_NONE == location_get_position_from_freeformed_address(loc, addr_str, &pos, &acc)) {
- g_debug ("SYNC>> position from freeformed address> time: %d, lat: %f, long: %f, alt: %f, status: %d",
- pos->timestamp, pos->latitude, pos->longitude, pos->altitude, pos->status);
- g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
- location_position_free (pos);
- location_accuracy_free (acc);
+ if (LOCATION_ERROR_NONE == location_get_position_from_freeformed_address(loc, addr_str, &pos_list, &acc_list)) {
+ g_list_foreach (pos_list, PrintPos, NULL);
+ g_list_foreach (acc_list, PrintAcc, NULL);
} else g_warning ("SYNC>> position from freeformed address> failed");
g_free(addr_str);
-
location_free (loc);
return 0;
}
* @endcode
*/
-int location_get_position_from_freeformed_address (LocationObject *obj, const gchar *address, LocationPosition **position, LocationAccuracy **accuracy);
+int location_get_position_from_freeformed_address (LocationObject *obj, const gchar *address, GList **position_list, GList **accuracy_list);
/**
* @brief
* @code
#include <location.h>
+static void PrintPos (gpointer data, gpointer user_data)
+{
+ LocationPosition *pos = (LocationPosition *)data;
+
+ if (pos) {
+ g_debug("time: [%d], latitude: [%f], longitude: [%f], altitude: [%f]\n", pos->timestamp, pos->latitude, pos->longitude, pos->altitude);
+ }
+}
+
+static void PrintAcc (gpointer data, gpointer user_data)
+{
+ LocationAccuracy *acc = (LocationAccuracy *)data;
+
+ if (acc) {
+ g_debug("level: [%d], horizontal_accuracy: [%f], vertical_accuracy: [%f]\n", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+ }
+}
+
static void
-cb_position_from_freeformed_address (LocationError error, LocationPosition *pos, LocationAccuracy *acc, gpointer userdata)
+cb_position_from_freeformed_address (LocationError error, GList *position_list, GList *accuracy_list, gpointer userdata)
{
- g_debug ("ASYNC>> location_get_position_from_freeformed_address_async> time: %d, lat: %f, long: %f, alt: %f, status: %d",
- pos->timestamp, pos->latitude, pos->longitude, pos->altitude, pos->status);
- g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+ if (position_list && accuracy_list) {
+ g_list_foreach (position_list, PrintPos);
+ g_list_foreach (accuracy_list, PrintAcc);
+ }
}
void get_position_from_address(LocationObject* loc)
/**
* @brief
+ * Get last velocity information with estimate of the accuracy.
+ * @remarks This API is not implemented now. \n
+ * Out parameters are should be freed.
+ * @pre
+ * #location_init should be called before.\n
+ * @post None.
+ * @param [in]
+ * obj - a #LocationObject created by #location_new
+ * @param [out]
+ * velocity - a new #LocationVelocity
+ * @param [out]
+ * accuracy - a new #LocationAccuracy
+ * @return int
+ * @retval 0 Success
+ *
+ * Please refer #LocationError for more information.
+ * @see location_get_velocity
+ * @par Example
+ * @code
+#include <location.h>
+
+int main (int argc, char *argv[])
+{
+ LocationObject *loc = NULL;
+ LocationVelocity *last_vel = NULL;
+ LocationAccuracy *last_acc = NULL;
+ location_init ();
+
+ loc = location_new (LOCATION_METHOD_GPS);
+ if(!loc){
+ g_debug("location_new failed");
+ return -1;
+ }
+
+ if (LOCATION_ERROR_NONE == location_get_last_velocity (loc, &last_vel, &last_acc)) {
+ g_debug ("SYNC>> Last velocity> time: %d, speed: %f, direction:%f, climb:%f",
+ last_vel->timestamp, last_vel->speed, last_vel->direction, last_vel->climb);
+ g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)",
+ last_acc->level, last_acc->horizontal_accuracy, last_acc->vertical_accuracy);
+ location_velocity_free(last_vel);
+ location_accuracy_free(last_acc);
+ } else g_warning ("SYNC>> Last velocity> failed.");
+
+ location_free (loc);
+
+ return 0;
+}
+ * @endcode
+ */
+int location_get_last_velocity (LocationObject *obj, LocationVelocity **velocity, LocationAccuracy **accuracy);
+
+
+/**
+ * @brief
* Get current address information with estimate of the accuracy by using current position.
* @remarks Out parameters are should be freed.
* @pre
}
static void
+print_pos (gpointer data, gpointer user_data)
+{
+ LocationPosition *pos = (LocationPosition *)data;
+
+ if (pos) {
+ g_debug ("time: %d, lat: %f, long: %f, alt: %f, status: %d",
+ pos->timestamp, pos->latitude, pos->longitude, pos->altitude, pos->status);
+ location_position_free (pos);
+ }
+}
+
+static void
+print_acc (gpointer data, gpointer user_data)
+{
+ LocationAccuracy *acc = (LocationAccuracy *)data;
+
+ if (acc) {
+ g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+ location_accuracy_free (acc);
+ }
+}
+static void
cb_address (LocationError error,
LocationAddress *addr,
LocationAccuracy *acc,
}
static void
-cb_position_from_address (LocationError error, LocationPosition *pos, LocationAccuracy *acc, gpointer userdata)
+cb_position_from_address (LocationError error, GList *pos_list, GList *acc_list, gpointer userdata)
{
if (error != LOCATION_ERROR_NONE) {
g_debug("cb_position_from_address failed: error=%d\n", error);
return;
}
- g_debug ("ASYNC>> location_get_position_from_address_async> time: %d, lat: %f, long: %f, alt: %f, status: %d",
- pos->timestamp, pos->latitude, pos->longitude, pos->altitude, pos->status);
- g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+
+ g_list_foreach (pos_list, print_pos, NULL);
+ g_list_foreach (acc_list, print_acc, NULL);
}
static void
-cb_position_from_freeformed_address (LocationError error, LocationPosition *pos, LocationAccuracy *acc, gpointer userdata)
+cb_position_from_freeformed_address (LocationError error, GList *pos_list, GList *acc_list, gpointer userdata)
{
if (error != LOCATION_ERROR_NONE) {
g_debug("cb_position_from_freeformed_address failed: error=%d\n", error);
return;
}
- g_debug ("ASYNC>> location_get_position_from_freeformed_address_async> time: %d, lat: %f, long: %f, alt: %f, status: %d",
- pos->timestamp, pos->latitude, pos->longitude, pos->altitude, pos->status);
- g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+
+ g_list_foreach (pos_list, print_pos, NULL);
+ g_list_foreach (acc_list, print_acc, NULL);
}
static void
LocationObject *loc = NULL;
// If application is executed by AUL, this is not needed.
- g_setenv("PKG_NAME", "org.tizen.address-sample", 1);
+ g_setenv("PKG_NAME", "com.samsung.address-sample", 1);
g_type_init();
location_init ();
g_warning("location_new failed");
return -1;
}
+
LocationPosition *pos = NULL;
LocationAccuracy *acc = NULL;
+ GList *pos_list = NULL;
+ GList *acc_list = NULL;
LocationAddress *addr = NULL;
addr = location_address_new ("1", "Post Street", NULL, "san jose", "ca", NULL, "95113");
- LocationError err = location_get_position_from_address(loc, addr, &pos, &acc);
+ LocationError err = location_get_position_from_address(loc, addr, &pos_list, &acc_list);
if (LOCATION_ERROR_NONE == err) {
- g_debug ("SYNC>> location_get_position_from_address() success> time: %d, lat: %f, long: %f, alt: %f, status: %d",
- pos->timestamp, pos->latitude, pos->longitude, pos->altitude, pos->status);
- g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
- location_position_free (pos);
- location_accuracy_free (acc);
+ g_list_foreach (pos_list, print_pos, NULL);
+ g_list_foreach (acc_list, print_acc, NULL);
} else g_warning ("SYNC>>>location_get_position_from_address() failed> error code:%d", err);
location_address_free (addr);
char* addr_str = g_strdup("4 N 2nd Street 95113");
- err = location_get_position_from_freeformed_address(loc, addr_str, &pos, &acc);
+ err = location_get_position_from_freeformed_address(loc, addr_str, &pos_list, &acc_list);
if (LOCATION_ERROR_NONE == err) {
- g_debug ("SYNC>> location_get_position_from_freeformed_address() success> time: %d, lat: %f, long: %f, alt: %f, status: %d",
- pos->timestamp, pos->latitude, pos->longitude, pos->altitude, pos->status);
- g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
- location_position_free (pos);
- location_accuracy_free (acc);
+ g_list_foreach (pos_list, print_pos, NULL);
+ g_list_foreach (acc_list, print_acc, NULL);
} else g_warning ("SYNC>> location_get_position_from_freeformed_address() failed> error code:%d", err);
g_free(addr_str);
g_signal_connect (loc, "service-disabled", G_CALLBACK(cb_service_disabled), loc);
g_timeout_add_seconds (3, async_request, loc);
- if( LOCATION_ERROR_NONE != location_start (loc) ){
- g_debug("location_start failed");
+ int ret = location_start (loc);
+ if( LOCATION_ERROR_NONE != ret ){
+ g_debug("location_start failed[%d]",ret);
return -1;
}
LocationObject *loc = NULL;
// If application is executed by AUL, this is not needed.
- g_setenv("PKG_NAME", "org.tizen.cps-test", 1);
+ g_setenv("PKG_NAME", "com.samsung.cps-test", 1);
location_init ();
LocationObject *loc = NULL;
// If application is executed by AUL, this is not needed.
- g_setenv("PKG_NAME", "org.tizen.gps-test", 1);
+ g_setenv("PKG_NAME", "com.samsung.gps-test", 1);
location_init ();
LocationObject *loc = NULL;
// If application is executed by AUL, this is not needed.
- g_setenv("PKG_NAME", "org.tizen.hybrid-test", 1);
+ g_setenv("PKG_NAME", "com.samsung.hybrid-test", 1);
location_init ();
LocationObject *loc = NULL;
// If application is executed by AUL, this is not needed.
- g_setenv("PKG_NAME", "org.tizen.ips-test", 1);
+ g_setenv("PKG_NAME", "com.samsung.ips-test", 1);
location_init ();
*/
#include <glib.h>
+#include <string.h>
#include <glib/gprintf.h>
#include <gconf/gconf-client.h>
#include <location/location.h>
return ret;
}
+static void PrintPos (gpointer data, gpointer user_data)
+{
+ LocationPosition *pos = (LocationPosition *)data;
+ if (pos) {
+ g_printf("time: [%d], latitude: [%f], longitude: [%f], altitude: [%f]\n", pos->timestamp, pos->latitude, pos->longitude, pos->altitude);
+ location_position_free (pos);
+ }
+}
+
+static void PrintAcc (gpointer data, gpointer user_data)
+{
+ LocationAccuracy *acc = (LocationAccuracy *)data;
+ if (acc) {
+ g_printf("level: [%d], horizontal_accuracy: [%f], vertical_accuracy: [%f]\n", acc->level, acc->horizontal_accuracy, acc->vertical_accuracy);
+ location_accuracy_free (acc);
+ }
+
+}
+
gulong g_sig_enable = 0;
gulong g_sig_disable = 0;
gulong g_sig_update = 0;
}
static void cb_position (LocationError error,
- LocationPosition *position,
- LocationAccuracy *acc,
+ GList *pos_list,
+ GList *acc_list,
gpointer userdata)
{
if (error != LOCATION_ERROR_NONE) {
g_printf("cb_position failed: error=%d\n", error);
return;
}
- char str[STR_MAX];
- g_printf("userdata[0x%x] time: [%d], latitude: [%f], longitude: [%f], altitude: [%f]\n", (unsigned int)userdata, position->timestamp, position->latitude, position->longitude, position->altitude);
- GetAccuracyLevel(str, acc->level);
- g_printf("level: [%s], horizontal_accuracy: [%f], vertical_accuracy: [%f]\n", str, acc->horizontal_accuracy, acc->vertical_accuracy);
+
+ g_list_foreach (pos_list, PrintPos, NULL);
+ g_list_foreach (acc_list, PrintAcc, NULL);
}
static void cb_address(LocationError error, LocationAddress *addr, LocationAccuracy *acc, gpointer userdata)
g_printf("4. location_start\n");
g_printf("5. location_stop\n");
g_printf("6. location_get_position\n");
- g_printf("6a. location_get_last_known_position\n");
+ g_printf("6a. location_get_last_position\n");
+ g_printf("6b. location_get_last_known_position - will be deprecated. \n");
g_printf("7. location_get_position_from_address\n");
g_printf("7a. location_get_position_from_address_async\n");
g_printf("8. location_get_position_from_freeformed_address\n");
g_printf("8a. location_get_position_from_freeformed_address_async\n");
g_printf("9. location_get_velocity\n");
- g_printf("10. location_get_address\n");
- g_printf("10a. location_get_address_async\n");
- g_printf("11. location_get_address_from_position\n");
- g_printf("11a. location_get_address_from_position_async\n");
- g_printf("12. location_get_distance\n");
- g_printf("13. location_is_supported_method\n");
- g_printf("14. location_is_enabled_gps\n");
+ g_printf("9a. location_get_last_velocity\n");
+ g_printf("10. location_get_satellite\n");
+ g_printf("10a. location_get_last_satellite\n");
+ g_printf("11. location_get_address\n");
+ g_printf("11a. location_get_address_async\n");
+ g_printf("12. location_get_address_from_position\n");
+ g_printf("12a. location_get_address_from_position_async\n");
+ g_printf("13. location_get_distance\n");
+ g_printf("14. location_is_supported_method\n");
+ g_printf("15. location_is_enabled_gps\n");
g_printf("99. location_send_command\n");
g_printf("a?. signals:(1)'service-enabled',(2)'service-disabled',(3)'service-updated',(4)'zone-in',(5)'zone-out'\n");
g_printf("b?. disconnect signals:(1)'service-enabled',(2)'service-disabled',(3)'service-updated',(4)'zone-in',(5)'zone-out'\n");
GError *gerr = NULL;
// If application is executed by AUL, this is not needed.
- g_setenv("PKG_NAME", "org.tizen.location-api-test", 1);
+ g_setenv("PKG_NAME", "com.samsung.location-api-test", 1);
g_type_init();
if( !g_thread_supported() )
g_printf("Location object already existed: [0x%x]", (unsigned int)location_obj);
continue;
}
- g_printf("LOCATION_METHOD_HYBRID[0] LOCATION_METHOD_GPS[1] LOCATION_METHOD_WPS[2] LOCATION_METHOD_CPS[3] LOCATION_METHOD_IPS[4] LOCATION_METHOD_SPS[5]\n");
+ g_printf("LOCATION_METHOD_HYBRID[0] LOCATION_METHOD_GPS[1] LOCATION_METHOD_WPS[2] LOCATION_METHOD_SPS[5]\n");
g_printf("Select Location Method: ");
LocationMethod method = PromptInt();
location_obj = location_new(method);
if(pos) location_position_free(pos);
if(acc) location_accuracy_free(acc);
} else if (0 == g_strcmp0("6a",strOpt)) {
+ g_printf("LOCATION_METHOD_HYBRID[0] LOCATION_METHOD_GPS[1] LOCATION_METHOD_WPS[2] LOCATION_METHOD_SPS[5]\n");
+ g_printf("Select Location Method: ");
+ LocationMethod method = PromptInt();
+ LocationPosition *last_pos;
+ LocationAccuracy *last_acc;
+ int ret = 0;
+
+ ret = location_get_last_position (location_obj, LOCATION_METHOD_GPS, &last_pos, &last_acc);
+ if (ret == LOCATION_ERROR_NONE) {
+ g_debug ("SYNC>> Last position> time: %d, lat: %f, long: %f, alt: %f, status: %d",
+ last_pos->timestamp, last_pos->latitude, last_pos->longitude, last_pos->altitude, last_pos->status);
+ g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)",
+ last_acc->level, last_acc->horizontal_accuracy, last_acc->vertical_accuracy);
+ location_position_free(last_pos);
+ location_accuracy_free(last_acc);
+ } else g_warning ("SYNC>> Last position> failed. Error[%d]",ret);
+
+ } else if (0 == g_strcmp0("6b",strOpt)) {
+ g_printf("LOCATION_METHOD_HYBRID[0] LOCATION_METHOD_GPS[1] LOCATION_METHOD_WPS[2] LOCATION_METHOD_SPS[5]\n");
+ g_printf("Select Location Method: ");
+ LocationMethod method = PromptInt();
LocationLastPosition last_pos;
- ret = location_get_last_known_position(location_obj, &last_pos);
+ ret = location_get_last_known_position(location_obj, method, &last_pos);
GetLocationError(str, ret);
g_printf("location_get_last_known_position: returned value [%s]\n", str);
if (ret == LOCATION_ERROR_NONE) {
- g_printf("last position latitude: [%f], longitude: [%f], accuracy: [%f]\n", last_pos.latitude, last_pos.longitude, last_pos.accuracy);
+ g_printf("last position method[%d], latitude: [%f], longitude: [%f], altitude: [%f], horizontal_accuracy: [%f], vertical_accuracy: [%f]\n", last_pos.method, last_pos.latitude, last_pos.longitude, last_pos.altitude, last_pos.horizontal_accuracy, last_pos.vertical_accuracy);
}
} else if (0 == g_strcmp0("7",strOpt)) {
LocationAddress *add = NULL;
- LocationPosition *pos = NULL;
- LocationAccuracy *acc = NULL;
+ GList *pos_list = NULL;
+ GList *acc_list = NULL;
- g_printf("[0].San jose [1].¼ö¿ø»ï¼º [2].Suwon HQ [*].Custom\n");
+ g_printf("[0].San jose [1].수원 삼성 [2].Suwon HQ [*].Custom\n");
g_printf("Select Address: ");
int opt = PromptInt();
if (opt == 0) add = location_address_new ("1", "Post Street", NULL, "san jose", "ca", NULL, "95113");
- else if (opt == 1) add = location_address_new (NULL, "»ï¼º·Î", "¸Åź3µ¿", "¼ö¿ø½Ã ¿µÅ뱸", "°æ±âµµ", NULL, NULL);
+ else if (opt == 1) add = location_address_new (NULL, "삼성전자", "매탄 3동", "수원시 영통구", "경기도", NULL, NULL);
else if (opt == 2) add = location_address_new (NULL, "Samsung Electro-Mechanics Co. LTD", "Maetan 3-dong", "Suwon Si Yeongtong-gu", "Gyeonggi-do", NULL, NULL);
else {
char building_number[255], street[255], state[255], country_code[255], city[255], district[255], postal_code[255];
postal_code[strlen(postal_code)-1]='\0';
add = location_address_new(building_number, street, district, city, state, country_code, postal_code);
}
- ret = location_get_position_from_address (location_obj, add, &pos, &acc);
+ ret = location_get_position_from_address (location_obj, add, &pos_list, &acc_list);
if(add) location_address_free (add);
GetLocationError(str, ret);
g_printf("location_get_position_from_adress: returned value [%s]\n", str);
- if (ret == LOCATION_ERROR_NONE)
- g_printf("time: [%d], latitude: [%f], longitude: [%f], altitude: [%f]\n", pos->timestamp, pos->latitude, pos->longitude, pos->altitude);
- if(pos) location_position_free(pos);
- if(acc) location_accuracy_free(acc);
+ if (ret == LOCATION_ERROR_NONE) {
+ g_list_foreach (pos_list, PrintPos, NULL);
+ g_list_foreach (acc_list, PrintAcc, NULL);
+ }
} else if (0 == g_strcmp0("7a",strOpt)) {
IdleData* data = g_new0(IdleData, 1);
data->obj = location_obj;
data->pos_cb = cb_position;
data->user_data = location_obj;
- g_printf("[0].San jose [1].¼ö¿ø»ï¼º [2].Suwon HQ [*].Custom\n");
+ g_printf("[0].San jose [1].수원 삼성 [2].Suwon HQ [*].Custom\n");
g_printf("Select Address: ");
int opt = PromptInt();
if (opt == 0) data->addr = location_address_new ("1", "Post Street", NULL, "san jose", "ca", NULL, "95113");
- else if (opt == 1) data->addr = location_address_new (NULL, "»ï¼º·Î", "¸Åź3µ¿", "¼ö¿ø½Ã ¿µÅ뱸", "°æ±âµµ", NULL, NULL);
+ else if (opt == 1) data->addr = location_address_new (NULL, "삼성전자", "매탄3동", "수원시 영통구", "경기도", NULL, NULL);
else if (opt == 2) data->addr = location_address_new (NULL, "Samsung Electro-Mechanics Co. LTD", "Maetan 3-dong", "Suwon Si Yeongtong-gu", "Gyeonggi-do", NULL, NULL);
else {
char building_number[255], street[255], state[255], country_code[255], city[255], district[255], postal_code[255];
g_idle_add((GSourceFunc)idle_position_from_address_async, data);
}else if (0 == g_strcmp0("8",strOpt)) {
gchar* addr = NULL;
- LocationPosition *pos = NULL;
- LocationAccuracy *acc = NULL;
+ GList *pos_list = NULL;
+ GList *acc_list = NULL;
- g_printf("[0].San jose [1].¼ö¿ø»ï¼º [2].Suwon HQ [*].Custom\n");
+ g_printf("[0].San jose [1].수원삼성 [2].Suwon HQ [*].Custom\n");
g_printf("Select Address: ");
int opt = PromptInt();
if(opt == 0){
addr = g_strdup("4 N 2nd Street 95113");
}else if(opt == 1){
- addr = g_strdup("´ëÇѹα¹ °æ±âµµ ¼ö¿ø½Ã ¿µÅ뱸 ¸Åźµ¿ 436-52");
+ addr = g_strdup("경기도 수원시 영통구 매탄 3동 삼성전자");
}else if(opt == 2){
addr = g_strdup("Samsung Electronics Co. LTD Maetan 3-dong, Suwon Si Yeongtong-gu, Gyeonggi-Do (Seoul 443-742 Korea), Rep of KOREA");
}else{
buf[strlen(buf)-1]='\0';
addr = g_strdup(buf);
}
- ret = location_get_position_from_freeformed_address(location_obj, addr, &pos, &acc);
+ ret = location_get_position_from_freeformed_address(location_obj, addr, &pos_list, &acc_list);
g_free(addr);
GetLocationError(str, ret);
g_printf("location_get_position_from_freeformed_adress: returned value [%s]\n", str);
if(ret == LOCATION_ERROR_NONE){
- g_printf("time: [%d], latitude: [%f], longitude: [%f], altitude: [%f]\n", pos->timestamp, pos->latitude, pos->longitude, pos->altitude);
+ g_list_foreach (pos_list, PrintPos, NULL);
+ g_list_foreach (acc_list, PrintAcc, NULL);
}
- if(pos) location_position_free(pos);
- if(acc) location_accuracy_free(acc);
}else if(0 == g_strcmp0("8a",strOpt) ){
IdleData* data = g_new0(IdleData, 1);
data->obj = location_obj;
data->pos_cb = cb_position;
data->user_data = location_obj;
- g_printf("[0].San jose [1].¼ö¿ø»ï¼º [2].Suwon HQ [*].Custom\n");
+ g_printf("[0].San jose [1].수원 삼성 [2].Suwon HQ [*].Custom\n");
g_printf("Select Address: ");
int opt = PromptInt();
if(opt == 0){
data->str_addr = g_strdup("4 N 2nd Street 95113");
}else if(opt == 1){
- data->str_addr = g_strdup("´ëÇѹα¹ °æ±âµµ ¼ö¿ø½Ã ¿µÅ뱸 ¸Åźµ¿ 436-52");
+ data->str_addr = g_strdup("경기도 수원시 영통구 매탄 3동 삼성전자");
}else if(opt == 2){
data->str_addr = g_strdup("Samsung Electronics Co. LTD Maetan 3-dong, Suwon Si Yeongtong-gu, Gyeonggi-Do (Seoul 443-742 Korea), Rep of KOREA");
}else{
}
if(vel) location_velocity_free(vel);
if(acc) location_accuracy_free(acc);
- } else if(0 == g_strcmp0("10",strOpt) ){
+ }else if(0 == g_strcmp0("9a",strOpt) ){
+ LocationVelocity *last_vel = NULL;
+ LocationAccuracy *last_acc = NULL;
+ if (LOCATION_ERROR_NONE == location_get_last_velocity (location_obj, &last_vel, &last_acc)) {
+ g_debug ("SYNC>> Last velocity> time: %d, speed: %f, direction:%f, climb:%f",
+ last_vel->timestamp, last_vel->speed, last_vel->direction, last_vel->climb);
+ g_debug ("\tAccuracy level %d (%.0f meters %.0f meters)",
+ last_acc->level, last_acc->horizontal_accuracy, last_acc->vertical_accuracy);
+ location_velocity_free(last_vel);
+ location_accuracy_free(last_acc);
+ } else g_warning ("SYNC>> Last velocity> failed.");
+ }else if(0 == g_strcmp0("10",strOpt) ){
+ int ret = 0, idx = 0;
+ LocationSatellite *sat = NULL;
+ guint prn;
+ gboolean used;
+ guint elevation;
+ guint azimuth;
+ gint snr;
+
+ ret = location_get_satellite (location_obj, &sat);
+ if (ret == LOCATION_ERROR_NONE) {
+ g_debug ("SYNC>> Current Sattelite> satellite in view = %d, satellite in used = %d", sat->num_of_sat_inview, sat->num_of_sat_used);
+ g_debug ("\tinview satellite information = ");
+ for (idx=0; idx<sat->num_of_sat_inview; idx++) {
+ location_satellite_get_satellite_details(sat, idx, &prn, &used, &elevation, &azimuth, &snr);
+ g_debug ("\t\t[%02d] used: %d, prn: %d, elevation: %d, azimuth: %d, snr: %d", idx, used, prn, elevation, azimuth, snr);
+ }
+ location_satellite_free (sat);
+ } else g_warning ("SYNC>> Current satellite> failed. Error[%d]", ret);
+ }else if(0 == g_strcmp0("10a",strOpt) ){
+ int ret = 0, idx = 0;
+ LocationSatellite *last_sat = NULL;
+ guint prn;
+ gboolean used;
+ guint elevation;
+ guint azimuth;
+ gint snr;
+
+ ret = location_get_last_satellite (location_obj, &last_sat);
+
+ if (ret == LOCATION_ERROR_NONE) {
+ g_debug ("SYNC>> Last Sattelite> satellite in view = %d, satellite in used = %d", last_sat->num_of_sat_inview, last_sat->num_of_sat_used);
+ g_debug ("\tinview satellite information = ");
+ for (idx=0; idx<last_sat->num_of_sat_inview; idx++) {
+ location_satellite_get_satellite_details(last_sat, idx, &prn, &used, &elevation, &azimuth, &snr);
+ g_debug ("\t\t[%02d] used: %d, prn: %d, elevation: %d, azimuth: %d, snr: %d", idx, used, prn, elevation, azimuth, snr);
+ }
+ location_satellite_free (last_sat);
+ } else g_warning ("SYNC>> Last satellite> failed");
+ } else if(0 == g_strcmp0("11",strOpt) ){
LocationAddress *addr = NULL;
LocationAccuracy *acc = NULL;
ret = location_get_address(location_obj, &addr, &acc);
GetAccuracyLevel(str, acc->level);
g_printf("level: [%s], horizontal_accuracy: [%f], vertical_accuracy: [%f]\n", str, acc->horizontal_accuracy, acc->vertical_accuracy);
}
- }else if(0 == g_strcmp0("10a",strOpt) ){
+ }else if(0 == g_strcmp0("11a",strOpt) ){
IdleData* data = g_new0(IdleData, 1);
data->obj = location_obj;
data->addr_cb = cb_address;
data->user_data = location_obj;
g_idle_add((GSourceFunc)idle_address_async, data);
- }else if(0 == g_strcmp0("11",strOpt) ){
+ }else if(0 == g_strcmp0("12",strOpt) ){
LocationPosition *pos = NULL;
LocationAddress *addr = NULL;
LocationAccuracy *acc = NULL;
}
if(addr) location_address_free(addr);
if(acc) location_accuracy_free(acc);
- }else if(0 == g_strcmp0("11a",strOpt) ){
+ }else if(0 == g_strcmp0("12a",strOpt) ){
IdleData* data = g_new0(IdleData, 1);
data->obj = location_obj;
data->addr_cb = cb_address;
data->pos = location_position_new(0, lat, lon, 0, LOCATION_STATUS_2D_FIX);
}
g_idle_add((GSourceFunc)idle_address_from_position_async, data);
- }else if(0 == g_strcmp0("12",strOpt) ) {
+ }else if(0 == g_strcmp0("13",strOpt) ) {
gulong distance;
int ret = 0;
g_printf("The approximate distance is [%lu]\n", distance);
g_printf("cf.) It is approximately 969954.114 meter\n");
}
- }else if(0 == g_strcmp0("13", strOpt)) {
+ }else if(0 == g_strcmp0("14", strOpt)) {
int method;
char method_str[STR_MAX] = {0, };
char input[8] = {0, };
g_printf("Method[%s] is %s.", method_str, is_supported ? "supported" : "not supported");
- }else if(0 == g_strcmp0("14", strOpt)) {
+ }else if(0 == g_strcmp0("15", strOpt)) {
gboolean is_enabled = FALSE;
is_enabled = location_is_enabled_gps(location_obj);
if(is_enabled == TRUE) g_printf("GPS is turned on");
LocationObject *loc = NULL;
// If application is executed by AUL, this is not needed.
- g_setenv("PKG_NAME", "org.tizen.sps-test", 1);
+ g_setenv("PKG_NAME", "com.samsung.sps-test", 1);
location_init ();
LocationObject *loc = NULL;
// If application is executed by AUL, this is not needed.
- g_setenv("PKG_NAME", "org.tizen.wps-test", 1);
+ g_setenv("PKG_NAME", "com.samsung.wps-test", 1);
location_init ();