Commit f5cb1ecf authored by Keith Preston's avatar Keith Preston

Syncing copy with local for Plazer development

parent e5727d5d
SUBDIRS = geoclue example backend applet data
SUBDIRS = geoclue example data @EXTRA_SUBDIRS@
EXTRA_DIST = geoclue.pc.in
DISTCLEANFILES = geoclue.pc
......
......@@ -2,7 +2,7 @@ AC_INIT(geoclue/position.c)
PACKAGE=geoclue
VERSION=0.4
VERSION=0.6
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
......@@ -16,6 +16,37 @@ AC_SUBST(DBUS_BINDING_TOOL)
AM_CONFIG_HEADER(config.h)
AM_GCONF_SOURCE_2
AC_PATH_PROG(GCONFTOOL, gconftool-2)
AC_ARG_ENABLE(dev,
[AC_HELP_STRING([--enable-dev],
[Only compile client libraries disable backends and applets])],
[enable_dev=yes],
[enable_dev=no])
PKG_CHECK_MODULES(DEPS, gconf-2.0 dbus-glib-1 gtk+-2.0)
AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)
DBUS_SERVICES_DIR=`pkg-config dbus-1 --variable=exec_prefix`/share/dbus-1/services
AC_SUBST(DBUS_SERVICES_DIR)
if test "x$enable_dev" = "xno"
then
dnl Check for GPSD headers
AC_CHECK_HEADERS([gps.h], [ac_cv_gps_h=yes])
......@@ -27,39 +58,48 @@ if test "x$ac_cv_libgps" != xyes; then
AC_MSG_ERROR([Install gpsd Debian package or its source-code equivalent])
fi
AM_GCONF_SOURCE_2
AC_PATH_PROG(GCONFTOOL, gconftool-2)
PKG_CHECK_MODULES(HTTPXML, libsoup-2.2 libxml-2.0)
AC_SUBST(HTTPXML_CFLAGS)
AC_SUBST(HTTPXML_LIBS)
PKG_CHECK_MODULES(YAHOO, gconf-2.0 libsoup-2.2 libxml-2.0 dbus-glib-1 gtk+-2.0)
AC_SUBST(YAHOO_CFLAGS)
AC_SUBST(YAHOO_LIBS)
PKG_CHECK_MODULES(APPLET, libpanelapplet-2.0)
AC_SUBST(APPLET_CFLAGS)
AC_SUBST(APPLET_LIBS)
PKG_CHECK_MODULES(YAHOO, gconf-2.0 libsoup-2.2 libxml-2.0 dbus-glib-1 gtk+-2.0)
AC_SUBST(YAHOO_CFLAGS)
AC_SUBST(YAHOO_LIBS)
PKG_CHECK_MODULES(DEPS, gconf-2.0 dbus-glib-1 gtk+-2.0)
AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)
DBUS_SERVICES_DIR=`pkg-config dbus-1 --variable=exec_prefix`/share/dbus-1/services
AC_SUBST(DBUS_SERVICES_DIR)
dnl substitute subdirs into makefiles
EXTRA_SUBDIRS="applet backend"
AC_OUTPUT(Makefile
geoclue/Makefile
example/Makefile
AC_OUTPUT(
applet/Makefile
data/Makefile
geoclue.pc
backend/Makefile
backend/map_yahoo/Makefile
backend/position_manual/Makefile
backend/geocode_yahoo/Makefile
backend/position_manual/Makefile
backend/position_hostip/Makefile
backend/position_gpsd/Makefile
)
fi
dnl substitute subdirs into makefiles
AC_SUBST(EXTRA_SUBDIRS)
AC_OUTPUT(Makefile
geoclue/Makefile
example/Makefile
data/Makefile
geoclue.pc
)
......@@ -78,5 +78,33 @@
</locale>
</schema>
<!-- find -->
<schema>
<key>/schemas/apps/geoclue/find/defaultservice</key>
<applyto>/apps/geoclue/find/defaultservice</applyto>
<owner>geoclue</owner>
<type>string</type>
<default>org.foinse_project.geoclue.find.yahoo</default>
<locale name="C">
<short>find provider service</short>
<long>DBus service of default geoclue find provider</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/geoclue/find/defaultpath</key>
<applyto>/apps/geoclue/find/defaultpath</applyto>
<owner>geoclue</owner>
<type>string</type>
<default>/org/foinse_project/geoclue/find/yahoo</default>
<locale name="C">
<short>find provider path</short>
<long>DBus path of default geoclue find provider</long>
</locale>
</schema>
</schemalist>
</gconfschemafile>
bin_PROGRAMS = geoclue-position-example geoclue-map-example geoclue-map-layout-example geoclue-geocode-example
bin_PROGRAMS = geoclue-position-example \
geoclue-map-example \
geoclue-map-example-moving \
geoclue-map-layout-example \
geoclue-geocode-example \
geoclue-find-example
geoclue_map_example_SOURCES = geoclue_map_example.c
geoclue_map_example_moving_SOURCES = geoclue_map_example_moving.c
geoclue_map_layout_example_SOURCES = geoclue_map_layout_example.c
geoclue_position_example_SOURCES = geoclue_position_example.c
geoclue_geocode_example_SOURCES = geoclue_geocode_example.c
geoclue_find_example_SOURCES = geoclue_find_example.c
AM_CPPFLAGS = $(DEPS_CFLAGS) -I$(top_srcdir)
AM_LDFLAGS = $(DEPS_LIBS) $(top_builddir)/geoclue/libgeoclue.la
......
......@@ -25,11 +25,24 @@ int main (int argc, char** argv)
{
g_type_init();
printf("Asking for location\n");
geoclue_position_init_specific("org.foinse_project.geoclue.position.gpsd","/org/foinse_project/geoclue/position/gpsd");
geoclue_position_init();
//geoclue_position_init_specific("org.foinse_project.geoclue.position.gpsd","/org/foinse_project/geoclue/position/gpsd");
gdouble lat, lon;
geoclue_position_current_position(&lat, &lon);
printf("You are at %f %f\n", lat, lon);
geoclue_position_current_altitude ( &lon );
double temp, temp2;
geoclue_position_current_velocity( &temp, &temp2 ) ;
printf("2d vel %f %f \n", temp, temp2);
temp = sqrt(temp * temp + temp2 * temp2);
printf("1d vel %f \n", temp);
geoclue_position_current_altitude( &temp ) ;
printf("Altitude %f \n", temp);
return 0;
}
......@@ -15,5 +15,16 @@ Cflags: -I${includedir}/geoclue -I${libdir}/geoclue/include
positionxml=${datadir}/geoclue/dbus/position_glue.xml
positionmarshallist=${datadir}/geoclue/dbus/position_signal_marshal.list
findxml=${datadir}/geoclue/dbus/find_glue.xml
findmarshallist=${datadir}/geoclue/dbus/find_signal_marshal.list
mapxml=${datadir}/geoclue/dbus/map_glue.xml
mapmarshallist=${datadir}/map/dbus/map_signal_marshal.list
mapmarshallist=${datadir}/geoclue/dbus/map_signal_marshal.list
geocodexml=${datadir}/geoclue/dbus/geocode_glue.xml
geocodemarshallist=${datadir}/geoclue/dbus/geocode_signal_marshal.list
masterxml=${datadir}/geoclue/dbus/master_glue.xml
mastermarshallist=${datadir}/geoclue/dbus/master_signal_marshal.list
desc_dir=${datadir}/geoclue/backend
......@@ -28,6 +28,8 @@ AM_LDFLAGS = $(DEPS_LIBS)
EXTRA_DIST = \
position_glue.xml \
position_signal_marshal.list \
find_glue.xml \
find_signal_marshal.list \
map_glue.xml \
map_signal_marshal.list \
master_glue.xml \
......@@ -40,6 +42,8 @@ EXTRA_DIST = \
libgeoclue_la_SOURCES = position.c \
position_signal_marshal.c \
find.c \
find_signal_marshal.c \
map.c \
map_gtk.c \
map_gtk_layout.c \
......@@ -51,6 +55,7 @@ libgeoclue_la_LIBADD = $(DEPS_LIBS)
libgeoclue_ladir=$(includedir)/geoclue/geoclue
libgeoclue_la_HEADERS = position.h \
find.h \
map.h \
map_gtk.h \
map_gtk_layout.h \
......@@ -62,6 +67,9 @@ BUILT_SOURCES = \
position_client_glue.h \
position_signal_marshal.h \
position_signal_marshal.c \
find_client_glue.h \
find_signal_marshal.h \
find_signal_marshal.c \
map_client_glue.h \
map_signal_marshal.h \
map_signal_marshal.c \
......@@ -75,6 +83,9 @@ CLEANFILES = \
position_client_glue.h \
position_signal_marshal.h \
position_signal_marshal.c \
find_client_glue.h \
find_signal_marshal.h \
find_signal_marshal.c \
map_client_glue.h \
map_signal_marshal.h \
map_signal_marshal.c \
......@@ -89,6 +100,8 @@ dbusspecdir = $(datadir)/geoclue/dbus
dbusspec_DATA = \
position_glue.xml \
position_signal_marshal.list \
find_glue.xml \
find_signal_marshal.list \
map_glue.xml \
map_signal_marshal.list \
geocode_glue.xml
......@@ -106,6 +119,16 @@ position_signal_marshal.c:position_signal_marshal.list
glib-genmarshal --prefix _geoclue_position --body $< > $@
find_client_glue.h:find_glue.xml
$(DBUS_BINDING_TOOL) --prefix=geoclue_find --mode=glib-client $< > $@
find_signal_marshal.h:find_signal_marshal.list
glib-genmarshal --prefix _geoclue_find --header $< > $@
find_signal_marshal.c:find_signal_marshal.list
glib-genmarshal --prefix _geoclue_find --body $< > $@
map_client_glue.h:map_glue.xml
$(DBUS_BINDING_TOOL) --prefix=geoclue_map --mode=glib-client $< > $@
......
......@@ -59,7 +59,37 @@ geoclueserver_add_backend(GeoclueMaster *obj, char* path)
g_io_channel_read_line(channel,&backendstrings[3],NULL, NULL, NULL);
backendstrings[4] = NULL;
printf("Added %s\n", backendstrings[0]);
obj->backends = g_list_prepend(obj->backends, (void*)backendstrings);
if(!strcmp(backendstrings[2], "org.foinse_project.geoclue.position\n") )
{
g_print("Found position provider: %s\n", backendstrings[2]);
obj->position_backends = g_list_prepend(obj->position_backends, (void*)backendstrings);
}
else if(!strcmp(backendstrings[2], "org.foinse_project.geoclue.map\n") )
{
g_print("Found mapping provider: %s\n", backendstrings[2]);
obj->map_backends = g_list_prepend(obj->map_backends, (void*)backendstrings);
}
else if(!strcmp(backendstrings[2], "org.foinse_project.geoclue.geocode\n") )
{
g_print("Found geocode provider: %s\n", backendstrings[2]);
obj->geocode_backends = g_list_prepend(obj->geocode_backends, (void*)backendstrings);
}
else if(!strcmp(backendstrings[2], "org.foinse_project.geoclue.find\n") )
{
g_print("Found find provider: %s\n", backendstrings[2]);
obj->find_backends = g_list_prepend(obj->find_backends, (void*)backendstrings);
}
else
{
g_printerr("Did not find compatible interface :%s: \n", backendstrings[2]);
free(backendstrings[0]);
free(backendstrings[1]);
free(backendstrings[2]);
free(backendstrings[3]);
free(backendstrings);
}
}
}
......@@ -77,7 +107,10 @@ geoclueserver_master_init (GeoclueMaster *obj)
NULL);
obj->backends = NULL;
obj->position_backends = NULL;
obj->map_backends = NULL;
obj->geocode_backends = NULL;
obj->find_backends = NULL;
GError *error = NULL;
DBusGProxy *driver_proxy;
GeoclueMasterClass *klass = GEOCLUE_MASTER_GET_CLASS(obj);
......@@ -174,15 +207,6 @@ gboolean geoclue_master_version (GeoclueMaster *obj, gint* OUT_major, gint* OUT_
gboolean geoclue_master_get_default_position_provider (GeoclueMaster *obj, char ** OUT_service, char ** OUT_path, char ** OUT_description, GError **error)
{
guint length = g_list_length(obj->backends);
printf("length %d\n",length);
int i;
for(i = 0; i < length; i++)
{
char** backend = g_list_nth_data(obj->backends, i);
printf("Services \n\t%s\n\t%s\n\t%s\n\t%s\n", backend[0], backend[1], backend[2], backend[3]);
}
*OUT_service = gconf_client_get_string(obj->client, "/apps/geoclue/position/defaultservice",NULL);
*OUT_path = gconf_client_get_string(obj->client, "/apps/geoclue/position/defaultpath",NULL);
......@@ -191,27 +215,25 @@ gboolean geoclue_master_get_default_position_provider (GeoclueMaster *obj, char
}
gboolean geoclue_master_get_all_position_providers (GeoclueMaster *obj, char *** OUT_service, char *** OUT_path, char *** OUT_description, GError **error)
{
guint length = g_list_length(obj->backends);
guint length = g_list_length(obj->position_backends);
*OUT_service = malloc(length * sizeof(char*));
*OUT_path = malloc(length * sizeof(char*));
*OUT_description = malloc(length * sizeof(char*));
printf("length %d\n",length);
int i;
for(i = 0; i < length; i++)
{
char** backend = g_list_nth_data(obj->backends, i);
char** backend = g_list_nth_data(obj->position_backends, i);
*OUT_service[i] = g_strdup(backend[0]);
*OUT_path[i] = g_strdup(backend[1]);
*OUT_description[i] = g_strdup(backend[3]);
printf("Services \n\t%s\n\t%s\n\t%s\n\t%s\n", backend[0], backend[1], backend[2], backend[3]);
}
*OUT_service = malloc(3 * sizeof(char*));
*OUT_path = malloc(3 * sizeof(char*));
(*OUT_service)[0] = strdup("org.foinse_project.geoclue.position.manual");
(*OUT_path)[0] = strdup("/org/foinse_project/geoclue/position/manual");
(*OUT_service)[1] = strdup("org.foinse_project.geoclue.position.hostip");
(*OUT_path)[1] = strdup("/org/foinse_project/geoclue/position/hostip");
(*OUT_service)[2] = NULL;
(*OUT_path)[2] = NULL;
*OUT_service[length] = NULL;
*OUT_path[length] = NULL;
*OUT_description[length] = NULL;
return TRUE;
}
......@@ -224,14 +246,36 @@ gboolean geoclue_master_position_provider_update (GeoclueMaster *obj, const char
gboolean geoclue_master_get_default_map_provider (GeoclueMaster *obj, char ** OUT_service, char ** OUT_path, char ** OUT_description, GError **error)
{
{
*OUT_service = gconf_client_get_string(obj->client, "/apps/geoclue/map/defaultservice",NULL);
*OUT_path = gconf_client_get_string(obj->client, "/apps/geoclue/map/defaultpath",NULL);
return TRUE;
}
gboolean geoclue_master_get_all_map_providers (GeoclueMaster *obj, char *** OUT_service, char *** OUT_path, char *** OUT_description, GError **error)
{
return TRUE;
{
guint length = g_list_length(obj->map_backends);
*OUT_service = malloc(length * sizeof(char*));
*OUT_path = malloc(length * sizeof(char*));
*OUT_description = malloc(length * sizeof(char*));
printf("length %d\n",length);
int i;
for(i = 0; i < length; i++)
{
char** backend = g_list_nth_data(obj->map_backends, i);
*OUT_service[i] = g_strdup(backend[0]);
*OUT_path[i] = g_strdup(backend[1]);
*OUT_description[i] = g_strdup(backend[3]);
printf("Services \n\t%s\n\t%s\n\t%s\n\t%s\n", backend[0], backend[1], backend[2], backend[3]);
}
*OUT_service[length] = NULL;
*OUT_path[length] = NULL;
*OUT_description[length] = NULL;
}
......@@ -243,6 +287,8 @@ gboolean geoclue_master_map_provider_update (GeoclueMaster *obj, const char * IN
gboolean geoclue_master_get_default_geocode_provider (GeoclueMaster *obj, char ** OUT_service, char ** OUT_path, char ** OUT_description, GError **error)
{
*OUT_service = gconf_client_get_string(obj->client, "/apps/geoclue/geocode/defaultservice",NULL);
*OUT_path = gconf_client_get_string(obj->client, "/apps/geoclue/geocode/defaultpath",NULL);
return TRUE;
}
......@@ -259,6 +305,26 @@ gboolean geoclue_master_geocode_provider_update (GeoclueMaster *obj, const char
}
gboolean geoclue_master_get_default_find_provider (GeoclueMaster *obj, char ** OUT_service, char ** OUT_path, char ** OUT_description, GError **error)
{
*OUT_service = gconf_client_get_string(obj->client, "/apps/geoclue/find/defaultservice",NULL);
*OUT_path = gconf_client_get_string(obj->client, "/apps/geoclue/find/defaultpath",NULL);
return TRUE;
}
gboolean geoclue_master_get_all_find_providers (GeoclueMaster *obj, char *** OUT_service, char *** OUT_path, char *** OUT_description, GError **error)
{
return TRUE;
}
gboolean geoclue_master_find_provider_update (GeoclueMaster *obj, const char * IN_service, const char * IN_path, const gint IN_accuracy, const gboolean IN_active, GError **error)
{
return TRUE;
}
......
......@@ -44,7 +44,11 @@ GType geoclueserver_master_get_type (void);
struct GeoclueMaster
{
GObject parent;
GList* backends;
GList* position_backends;
GList* map_backends;
GList* geocode_backends;
GList* find_backends;
GConfClient* client;
};
......@@ -78,6 +82,9 @@ gboolean geoclue_master_get_default_geocode_provider (GeoclueMaster *obj, char *
gboolean geoclue_master_get_all_geocode_providers (GeoclueMaster *obj, char *** OUT_service, char *** OUT_path, char *** OUT_description, GError **error);
gboolean geoclue_master_geocode_provider_update (GeoclueMaster *obj, const char * IN_service, const char * IN_path, const gint IN_accuracy, const gboolean IN_active, GError **error);
gboolean geoclue_master_get_default_find_provider (GeoclueMaster *obj, char ** OUT_service, char ** OUT_path, char ** OUT_description, GError **error);
gboolean geoclue_master_get_all_find_providers (GeoclueMaster *obj, char *** OUT_service, char *** OUT_path, char *** OUT_description, GError **error);
gboolean geoclue_master_find_provider_update (GeoclueMaster *obj, const char * IN_service, const char * IN_path, const gint IN_accuracy, const gboolean IN_active, GError **error);
......
......@@ -27,10 +27,15 @@
#include <stdio.h>
#include <map_signal_marshal.h>
//Change to yahoo hard code for now
#define GEOCLUE_MAP_DBUS_SERVICE "org.foinse_project.geoclue.map.yahoo"
#define GEOCLUE_MAP_DBUS_PATH "/org/foinse_project/geoclue/map/yahoo"
#include <geoclue_master_client_glue.h>
#define GEOCLUE_MAP_DBUS_INTERFACE "org.foinse_project.geoclue.map"
#define GEOCLUE_MASTER_DBUS_SERVICE "org.foinse_project.geoclue.master"
#define GEOCLUE_MASTER_DBUS_PATH "/org/foinse_project/geoclue/master"
#define GEOCLUE_MASTER_DBUS_INTERFACE "org.foinse_project.geoclue.master"
static DBusGConnection* geoclue_map_connection = NULL;
static DBusGProxy* geoclue_map_proxy = NULL;
......@@ -90,6 +95,67 @@ GEOCLUE_MAP_RETURNCODE geoclue_map_service_provider(char** name)
}
return GEOCLUE_MAP_SUCCESS;
}
GEOCLUE_MAP_RETURNCODE geoclue_map_init_specific(char* service, char* path)
{
GError* error = NULL;
geoclue_map_connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
if (geoclue_map_connection == NULL)
{
g_printerr ("GEOCLUE_MAP failed to open connection to bus: %s\n", error->message);
g_error_free (error);
return GEOCLUE_MAP_DBUS_ERROR;
}
geoclue_map_proxy = dbus_g_proxy_new_for_name (geoclue_map_connection,
service,
path,
GEOCLUE_MAP_DBUS_INTERFACE);
dbus_g_object_register_marshaller ( _geoclue_map_VOID__INT_BOXED_STRING,
G_TYPE_NONE,
G_TYPE_INT, DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_STRING, G_TYPE_INVALID);
dbus_g_proxy_add_signal (geoclue_map_proxy,
"get_map_finished",
G_TYPE_INT, DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_STRING, G_TYPE_INVALID);
dbus_g_proxy_connect_signal (geoclue_map_proxy,
"get_map_finished",
(GCallback) geoclue_map_get_map_finished,
(gpointer)NULL,
(GClosureNotify) NULL);
callbackfunction = NULL;
userdatastore = NULL;
return GEOCLUE_MAP_SUCCESS;
}
GEOCLUE_MAP_RETURNCODE geoclue_map_get_all_providers(char*** OUT_service, char*** OUT_path, char*** OUT_desc)
{
GError* error = NULL;
if (geoclue_map_connection == NULL)
{
geoclue_map_connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
}
DBusGProxy* master = dbus_g_proxy_new_for_name (geoclue_map_connection,
GEOCLUE_MASTER_DBUS_SERVICE,
GEOCLUE_MASTER_DBUS_PATH,
GEOCLUE_MASTER_DBUS_INTERFACE);
org_foinse_project_geoclue_master_get_all_position_providers (master, OUT_service, OUT_path, OUT_desc, &error);
if( error != NULL )
{
g_printerr ("Error getting all position provider: %s\n", error->message);
g_error_free (error);
return GEOCLUE_MAP_DBUS_ERROR;
}
return GEOCLUE_MAP_SUCCESS;
}
......@@ -103,10 +169,36 @@ GEOCLUE_MAP_RETURNCODE geoclue_map_init()
g_error_free (error);
return GEOCLUE_MAP_DBUS_ERROR;
}
DBusGProxy* master = dbus_g_proxy_new_for_name (geoclue_map_connection,
GEOCLUE_MASTER_DBUS_SERVICE,
GEOCLUE_MASTER_DBUS_PATH,
GEOCLUE_MASTER_DBUS_INTERFACE);
char* service;
char* path;
char* desc;
org_foinse_project_geoclue_master_get_default_map_provider (master, &service, &path, &desc, &error);
if( error != NULL )
{
g_printerr ("Error getting default map provider: %s\n", error->message);
g_error_free (error);
return GEOCLUE_MAP_DBUS_ERROR;
}
printf(" Getting Service %s and path %s\n",service, path);
geoclue_map_proxy = dbus_g_proxy_new_for_name (geoclue_map_connection,
GEOCLUE_MAP_DBUS_SERVICE,
GEOCLUE_MAP_DBUS_PATH,
service,
path,
GEOCLUE_MAP_DBUS_INTERFACE);
free(service);
free(path);
free(desc);
dbus_g_object_register_marshaller ( _geoclue_map_VOID__INT_BOXED_STRING,
G_TYPE_NONE,
......
......@@ -66,6 +66,9 @@ typedef enum _geoclue_map_returncode
* GEOCLUE_MAP_SERVICE_NOT_AVAILABLE = -2
*/
GEOCLUE_MAP_RETURNCODE geoclue_map_init();
GEOCLUE_MAP_RETURNCODE geoclue_map_init_specific(char* service, char* path);
GEOCLUE_MAP_RETURNCODE geoclue_map_get_all_providers(char*** OUT_service, char*** OUT_path, char*** OUT_desc);
/*!
* \brief geoclue_map cleanup
......
......@@ -136,7 +136,38 @@
<!-- end server methods -->
<!-- client methods -->
<method name="get_default_find_provider">
<arg type="s" name="service" direction="out" />
<arg type="s" name="path" direction="out" />
<arg type="s" name="description" direction="out" />
</method>
<method name="get_all_find_providers">
<arg type="as" name="service" direction="out" />
<arg type="as" name="path" direction="out" />
<arg type="as" name="description" direction="out" />
</method>
<signal name="new_find_provider_available">
<arg type="s" name="service" direction="out" />
<arg type="s" name="path" direction="out" />
<arg type="s" name="description" direction="out" />
</signal>
<!-- end client methods -->
<!-- server methods -->
<method name="find_provider_update">
<arg type="s" name="service" direction="in" />
<arg type="s" name="path" direction="in" />
<arg type="i" name="accuracy" direction="in" />
<arg type="b" name="active" direction="in" />
</method>
<!-- end server methods -->
......
......@@ -29,8 +29,6 @@
#include <position_signal_marshal.h>
#include <geoclue_master_client_glue.h>
//#define GEOCLUE_POSITION_DBUS_SERVICE "org.foinse_project.geoclue.position"
//#define GEOCLUE_POSITION_DBUS_PATH "/org/foinse_project/geoclue/position"
#define GEOCLUE_POSITION_DBUS_INTERFACE "org.foinse_project.geoclue.position"
#define GEOCLUE_MASTER_DBUS_SERVICE "org.foinse_project.geoclue.master"
......@@ -47,8 +45,6 @@ static void* userdatastore = NULL;
void geoclue_position_current_position_changed(void* userdata, gdouble lat, gdouble lon)
{
g_print("current position changed \n");
if(callbackfunction != NULL)
callbackfunction( lat, lon , userdatastore );
......@@ -215,6 +211,10 @@ GEOCLUE_POSITION_RETURNCODE geoclue_position_close()
GEOCLUE_POSITION_RETURNCODE geoclue_position_get_all_providers(char*** OUT_service, char*** OUT_path, char*** OUT_desc)
{
GError* error = NULL;
if (geoclue_position_connection == NULL)
{
geoclue_position_connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
}
DBusGProxy* master = dbus_g_proxy_new_for_name (geoclue_position_connection,
GEOCLUE_MASTER_DBUS_SERVICE,
......@@ -252,7 +252,7 @@ GEOCLUE_POSITION_RETURNCODE geoclue_position_current_position ( gdouble* OUT_lat
return GEOCLUE_POSITION_SUCCESS;
}
GEOCLUE_POSITION_RETURNCODE geoclue_position_current_position_error ( gdouble* OUT_latitude_error, gdouble* OUT_longitude_error )
GEOCLUE_POSITION_RETURNCODE geoclue_position_current_position_error ( gdouble* OUT_latitude_error, gdouble* OUT_longitude_error, GEOCLUE_POSITION_FIX* OUT_fix_type )
{
if(geoclue_position_connection == NULL)
return GEOCLUE_POSITION_NOT_INITIALIZED;
......@@ -260,7 +260,7 @@ GEOCLUE_POSITION_RETURNCODE geoclue_position_current_position_error ( gdouble* O
return GEOCLUE_POSITION_NOT_INITIALIZED;
GError* error = NULL;
org_foinse_project_geoclue_position_current_position_error ( geoclue_position_proxy, OUT_latitude_error, OUT_longitude_error, &error );
org_foinse_project_geoclue_position_current_position_error ( geoclue_position_proxy, OUT_latitude_error, OUT_longitude_error, OUT_fix_type, &error );
if( error != NULL )
{
g_printerr ("Error getting geoclue_position current_position_error: %s\n", error->message);
......@@ -306,23 +306,6 @@ GEOCLUE_POSITION_RETURNCODE geoclue_position_current_velocity ( gdouble* OUT_nor
return GEOCLUE_POSITION_SUCCESS;
}
GEOCLUE_POSITION_RETURNCODE geoclue_position_current_time ( gint* OUT_year, gint* OUT_month, gint* OUT_day, gint* OUT_hours, gint* OUT_minutes, gint* OUT_seconds )
{
if(geoclue_position_connection == NULL)
return GEOCLUE_POSITION_NOT_INITIALIZED;
if(geoclue_position_proxy == NULL)
return GEOCLUE_POSITION_NOT_INITIALIZED;
GError* error = NULL;
org_foinse_project_geoclue_position_current_time ( geoclue_position_proxy, OUT_year, OUT_month , OUT_day , OUT_hours , OUT_minutes , OUT_seconds , &error );
if( error != NULL )
{
g_printerr ("Error getting geoclue_position current_time: %s\n", error->message);
g_error_free (error);
return GEOCLUE_POSITION_DBUS_ERROR;
}
return GEOCLUE_POSITION_SUCCESS;
}
GEOCLUE_POSITION_RETURNCODE geoclue_position_satellites_in_view ( GArray** OUT_prn_numbers )
{
......@@ -342,7 +325,7 @@ GEOCLUE_POSITION_RETURNCODE geoclue_position_satellites_in_view ( GArray** OUT_p
return GEOCLUE_POSITION_SUCCESS;
}
GEOCLUE_POSITION_RETURNCODE geoclue_position_satellites_data ( const gint IN_prn_number, gdouble* OUT_elevation, gdouble* OUT_azimuth, gdouble* OUT_signal_noise_ratio )
GEOCLUE_POSITION_RETURNCODE geoclue_position_satellites_data ( const gint IN_prn_number, gdouble* OUT_elevation, gdouble* OUT_azimuth, gdouble* OUT_signal_noise_ratio, gboolean* OUT_differential, gboolean* OUT_ephemeris )
{
if(geoclue_position_connection == NULL)
return GEOCLUE_POSITION_NOT_INITIALIZED;
......@@ -350,7 +333,7 @@ GEOCLUE_POSITION_RETURNCODE geoclue_position_satellites_data ( const gint IN_prn
return GEOCLUE_POSITION_NOT_INITIALIZED;
GError* error = NULL;
org_foinse_project_geoclue_position_satellites_data ( geoclue_position_proxy, IN_prn_number , OUT_elevation, OUT_azimuth , OUT_signal_noise_ratio , &error );
org_foinse_project_geoclue_position_satellites_data ( geoclue_position_proxy, IN_prn_number , OUT_elevation, OUT_azimuth , OUT_signal_noise_ratio , OUT_differential, OUT_ephemeris, &error );
if( error != NULL )
{
g_printerr ("Error getting geoclue_position satellites_data : %s\n", error->message);
......@@ -360,78 +343,6 @@ GEOCLUE_POSITION_RETURNCODE geoclue_position_satellites_data ( const gint IN_prn
return GEOCLUE_POSITION_SUCCESS;