core: unconditionally enable the Location Services API
This required dbus-glib 0.86 or later, which was released 2010-03-24.
This commit is contained in:
14
configure.ac
14
configure.ac
@@ -27,7 +27,7 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
|
|||||||
IT_PROG_INTLTOOL([0.35.0])
|
IT_PROG_INTLTOOL([0.35.0])
|
||||||
AM_GLIB_GNU_GETTEXT
|
AM_GLIB_GNU_GETTEXT
|
||||||
|
|
||||||
PKG_CHECK_MODULES(MM, dbus-glib-1 >= 0.75 glib-2.0 >= 2.18 gmodule-2.0 gobject-2.0)
|
PKG_CHECK_MODULES(MM, dbus-glib-1 >= 0.86 glib-2.0 >= 2.18 gmodule-2.0 gobject-2.0)
|
||||||
|
|
||||||
PKG_CHECK_MODULES(GUDEV, gudev-1.0)
|
PKG_CHECK_MODULES(GUDEV, gudev-1.0)
|
||||||
AC_SUBST(GUDEV_CFLAGS)
|
AC_SUBST(GUDEV_CFLAGS)
|
||||||
@@ -125,18 +125,6 @@ esac
|
|||||||
NM_COMPILER_WARNINGS
|
NM_COMPILER_WARNINGS
|
||||||
|
|
||||||
|
|
||||||
dnl
|
|
||||||
dnl dbus-glib >= 0.86 is required for Location API support
|
|
||||||
dnl
|
|
||||||
with_location_api=no
|
|
||||||
PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= 0.86, with_location_api="yes", with_location_api="no")
|
|
||||||
if test x"$with_location_api" = xyes; then
|
|
||||||
AC_DEFINE(LOCATION_API, 1, [Define if you have dbus-glib 0.86 or higher])
|
|
||||||
else
|
|
||||||
AC_MSG_WARN([dbus-glib >= 0.86 is required for Location API support])
|
|
||||||
fi
|
|
||||||
AM_CONDITIONAL(WITH_LOCATION_API, test "x$with_location_api" = "xyes")
|
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl Distribution version string
|
dnl Distribution version string
|
||||||
dnl
|
dnl
|
||||||
|
@@ -78,10 +78,6 @@ auth_sources += \
|
|||||||
mm-auth-provider-polkit.h
|
mm-auth-provider-polkit.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
loc_sources = \
|
|
||||||
mm-modem-location.c \
|
|
||||||
mm-modem-location.h
|
|
||||||
|
|
||||||
modem_manager_SOURCES = \
|
modem_manager_SOURCES = \
|
||||||
main.c \
|
main.c \
|
||||||
mm-callback-info.c \
|
mm-callback-info.c \
|
||||||
@@ -117,7 +113,9 @@ modem_manager_SOURCES = \
|
|||||||
mm-plugin-base.c \
|
mm-plugin-base.c \
|
||||||
mm-plugin-base.h \
|
mm-plugin-base.h \
|
||||||
mm-properties-changed-signal.c \
|
mm-properties-changed-signal.c \
|
||||||
mm-properties-changed-signal.h
|
mm-properties-changed-signal.h \
|
||||||
|
mm-modem-location.c \
|
||||||
|
mm-modem-location.h
|
||||||
|
|
||||||
mm-manager-glue.h: $(top_srcdir)/introspection/mm-manager.xml
|
mm-manager-glue.h: $(top_srcdir)/introspection/mm-manager.xml
|
||||||
$(AM_V_GEN) dbus-binding-tool --prefix=mm_manager --mode=glib-server --output=$@ $<
|
$(AM_V_GEN) dbus-binding-tool --prefix=mm_manager --mode=glib-server --output=$@ $<
|
||||||
@@ -149,15 +147,11 @@ BUILT_SOURCES = \
|
|||||||
mm-modem-gsm-network-glue.h \
|
mm-modem-gsm-network-glue.h \
|
||||||
mm-modem-gsm-sms-glue.h
|
mm-modem-gsm-sms-glue.h
|
||||||
|
|
||||||
if WITH_LOCATION_API
|
|
||||||
mm-modem-location-glue.h: $(top_srcdir)/introspection/mm-modem-location.xml
|
mm-modem-location-glue.h: $(top_srcdir)/introspection/mm-modem-location.xml
|
||||||
$(AM_V_GEN) dbus-binding-tool --prefix=mm_modem_location --mode=glib-server --output=$@ $<
|
$(AM_V_GEN) dbus-binding-tool --prefix=mm_modem_location --mode=glib-server --output=$@ $<
|
||||||
|
|
||||||
modem_manager_SOURCES += $(loc_sources)
|
modem_manager_SOURCES += $(loc_sources)
|
||||||
|
|
||||||
BUILT_SOURCES += mm-modem-location-glue.h
|
BUILT_SOURCES += mm-modem-location-glue.h
|
||||||
else
|
|
||||||
EXTRA_DIST += $(loc_sources)
|
|
||||||
endif
|
|
||||||
|
|
||||||
CLEANFILES = $(BUILT_SOURCES)
|
CLEANFILES = $(BUILT_SOURCES)
|
||||||
|
@@ -35,27 +35,21 @@
|
|||||||
#include "mm-options.h"
|
#include "mm-options.h"
|
||||||
#include "mm-properties-changed-signal.h"
|
#include "mm-properties-changed-signal.h"
|
||||||
#include "mm-utils.h"
|
#include "mm-utils.h"
|
||||||
#if LOCATION_API
|
|
||||||
#include "mm-modem-location.h"
|
#include "mm-modem-location.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
static void modem_init (MMModem *modem_class);
|
static void modem_init (MMModem *modem_class);
|
||||||
static void modem_gsm_card_init (MMModemGsmCard *gsm_card_class);
|
static void modem_gsm_card_init (MMModemGsmCard *gsm_card_class);
|
||||||
static void modem_gsm_network_init (MMModemGsmNetwork *gsm_network_class);
|
static void modem_gsm_network_init (MMModemGsmNetwork *gsm_network_class);
|
||||||
static void modem_gsm_sms_init (MMModemGsmSms *gsm_sms_class);
|
static void modem_gsm_sms_init (MMModemGsmSms *gsm_sms_class);
|
||||||
static void modem_simple_init (MMModemSimple *class);
|
static void modem_simple_init (MMModemSimple *class);
|
||||||
#if LOCATION_API
|
|
||||||
static void modem_location_init (MMModemLocation *class);
|
static void modem_location_init (MMModemLocation *class);
|
||||||
#endif
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_EXTENDED (MMGenericGsm, mm_generic_gsm, MM_TYPE_MODEM_BASE, 0,
|
G_DEFINE_TYPE_EXTENDED (MMGenericGsm, mm_generic_gsm, MM_TYPE_MODEM_BASE, 0,
|
||||||
G_IMPLEMENT_INTERFACE (MM_TYPE_MODEM, modem_init)
|
G_IMPLEMENT_INTERFACE (MM_TYPE_MODEM, modem_init)
|
||||||
G_IMPLEMENT_INTERFACE (MM_TYPE_MODEM_GSM_CARD, modem_gsm_card_init)
|
G_IMPLEMENT_INTERFACE (MM_TYPE_MODEM_GSM_CARD, modem_gsm_card_init)
|
||||||
G_IMPLEMENT_INTERFACE (MM_TYPE_MODEM_GSM_NETWORK, modem_gsm_network_init)
|
G_IMPLEMENT_INTERFACE (MM_TYPE_MODEM_GSM_NETWORK, modem_gsm_network_init)
|
||||||
G_IMPLEMENT_INTERFACE (MM_TYPE_MODEM_GSM_SMS, modem_gsm_sms_init)
|
G_IMPLEMENT_INTERFACE (MM_TYPE_MODEM_GSM_SMS, modem_gsm_sms_init)
|
||||||
#if LOCATION_API
|
|
||||||
G_IMPLEMENT_INTERFACE (MM_TYPE_MODEM_LOCATION, modem_location_init)
|
G_IMPLEMENT_INTERFACE (MM_TYPE_MODEM_LOCATION, modem_location_init)
|
||||||
#endif
|
|
||||||
G_IMPLEMENT_INTERFACE (MM_TYPE_MODEM_SIMPLE, modem_simple_init))
|
G_IMPLEMENT_INTERFACE (MM_TYPE_MODEM_SIMPLE, modem_simple_init))
|
||||||
|
|
||||||
#define MM_GENERIC_GSM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MM_TYPE_GENERIC_GSM, MMGenericGsmPrivate))
|
#define MM_GENERIC_GSM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MM_TYPE_GENERIC_GSM, MMGenericGsmPrivate))
|
||||||
@@ -905,7 +899,6 @@ release_port (MMModem *modem, const char *subsys, const char *name)
|
|||||||
check_valid (MM_GENERIC_GSM (modem));
|
check_valid (MM_GENERIC_GSM (modem));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LOCATION_API
|
|
||||||
static void
|
static void
|
||||||
add_loc_capability (MMGenericGsm *self, guint32 cap)
|
add_loc_capability (MMGenericGsm *self, guint32 cap)
|
||||||
{
|
{
|
||||||
@@ -917,7 +910,6 @@ add_loc_capability (MMGenericGsm *self, guint32 cap)
|
|||||||
g_object_notify (G_OBJECT (self), MM_MODEM_LOCATION_CAPABILITIES);
|
g_object_notify (G_OBJECT (self), MM_MODEM_LOCATION_CAPABILITIES);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
reg_poll_response (MMAtSerialPort *port,
|
reg_poll_response (MMAtSerialPort *port,
|
||||||
@@ -1016,9 +1008,7 @@ cgreg2_done (MMAtSerialPort *port,
|
|||||||
/* Try CGREG=1 instead */
|
/* Try CGREG=1 instead */
|
||||||
mm_at_serial_port_queue_command (port, "+CGREG=1", 3, cgreg1_done, info);
|
mm_at_serial_port_queue_command (port, "+CGREG=1", 3, cgreg1_done, info);
|
||||||
} else {
|
} else {
|
||||||
#if LOCATION_API
|
|
||||||
add_loc_capability (MM_GENERIC_GSM (info->modem), MM_MODEM_LOCATION_CAPABILITY_GSM_LAC_CI);
|
add_loc_capability (MM_GENERIC_GSM (info->modem), MM_MODEM_LOCATION_CAPABILITY_GSM_LAC_CI);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Success; get initial state */
|
/* Success; get initial state */
|
||||||
mm_at_serial_port_queue_command (port, "+CGREG?", 10, reg_poll_response, info->modem);
|
mm_at_serial_port_queue_command (port, "+CGREG?", 10, reg_poll_response, info->modem);
|
||||||
@@ -1076,9 +1066,7 @@ creg2_done (MMAtSerialPort *port,
|
|||||||
g_clear_error (&info->error);
|
g_clear_error (&info->error);
|
||||||
mm_at_serial_port_queue_command (port, "+CREG=1", 3, creg1_done, info);
|
mm_at_serial_port_queue_command (port, "+CREG=1", 3, creg1_done, info);
|
||||||
} else {
|
} else {
|
||||||
#if LOCATION_API
|
|
||||||
add_loc_capability (MM_GENERIC_GSM (info->modem), MM_MODEM_LOCATION_CAPABILITY_GSM_LAC_CI);
|
add_loc_capability (MM_GENERIC_GSM (info->modem), MM_MODEM_LOCATION_CAPABILITY_GSM_LAC_CI);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Success; get initial state */
|
/* Success; get initial state */
|
||||||
mm_at_serial_port_queue_command (port, "+CREG?", 10, reg_poll_response, info->modem);
|
mm_at_serial_port_queue_command (port, "+CREG?", 10, reg_poll_response, info->modem);
|
||||||
@@ -4094,7 +4082,6 @@ simple_get_status (MMModemSimple *simple,
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#if LOCATION_API
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gsm_lac_ci_available (MMGenericGsm *self, guint32 *out_idx)
|
gsm_lac_ci_available (MMGenericGsm *self, guint32 *out_idx)
|
||||||
{
|
{
|
||||||
@@ -4119,7 +4106,6 @@ gsm_lac_ci_available (MMGenericGsm *self, guint32 *out_idx)
|
|||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_lac_ci (MMGenericGsm *self, gulong lac, gulong ci, guint idx)
|
update_lac_ci (MMGenericGsm *self, gulong lac, gulong ci, guint idx)
|
||||||
@@ -4137,15 +4123,10 @@ update_lac_ci (MMGenericGsm *self, gulong lac, gulong ci, guint idx)
|
|||||||
changed = TRUE;
|
changed = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LOCATION_API
|
|
||||||
if (changed && gsm_lac_ci_available (self, NULL) && priv->loc_enabled && priv->loc_signal)
|
if (changed && gsm_lac_ci_available (self, NULL) && priv->loc_enabled && priv->loc_signal)
|
||||||
g_object_notify (G_OBJECT (self), MM_MODEM_LOCATION_LOCATION);
|
g_object_notify (G_OBJECT (self), MM_MODEM_LOCATION_LOCATION);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if LOCATION_API
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
destroy_gvalue (gpointer data)
|
destroy_gvalue (gpointer data)
|
||||||
{
|
{
|
||||||
@@ -4252,8 +4233,6 @@ location_get (MMModemLocation *modem,
|
|||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* LOCATION_API */
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -4292,14 +4271,12 @@ modem_init (MMModem *modem_class)
|
|||||||
modem_class->set_charset = set_charset;
|
modem_class->set_charset = set_charset;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LOCATION_API
|
|
||||||
static void
|
static void
|
||||||
modem_location_init (MMModemLocation *class)
|
modem_location_init (MMModemLocation *class)
|
||||||
{
|
{
|
||||||
class->enable = location_enable;
|
class->enable = location_enable;
|
||||||
class->get_location = location_get;
|
class->get_location = location_get;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
modem_gsm_card_init (MMModemGsmCard *class)
|
modem_gsm_card_init (MMModemGsmCard *class)
|
||||||
@@ -4357,7 +4334,6 @@ mm_generic_gsm_init (MMGenericGsm *self)
|
|||||||
NULL,
|
NULL,
|
||||||
MM_MODEM_GSM_NETWORK_DBUS_INTERFACE);
|
MM_MODEM_GSM_NETWORK_DBUS_INTERFACE);
|
||||||
|
|
||||||
#if LOCATION_API
|
|
||||||
mm_properties_changed_signal_register_property (G_OBJECT (self),
|
mm_properties_changed_signal_register_property (G_OBJECT (self),
|
||||||
MM_MODEM_LOCATION_CAPABILITIES,
|
MM_MODEM_LOCATION_CAPABILITIES,
|
||||||
"Capabilities",
|
"Capabilities",
|
||||||
@@ -4377,7 +4353,6 @@ mm_generic_gsm_init (MMGenericGsm *self)
|
|||||||
MM_MODEM_LOCATION_LOCATION,
|
MM_MODEM_LOCATION_LOCATION,
|
||||||
NULL,
|
NULL,
|
||||||
MM_MODEM_LOCATION_DBUS_INTERFACE);
|
MM_MODEM_LOCATION_DBUS_INTERFACE);
|
||||||
#endif
|
|
||||||
|
|
||||||
g_signal_connect (self, "notify::" MM_MODEM_STATE,
|
g_signal_connect (self, "notify::" MM_MODEM_STATE,
|
||||||
G_CALLBACK (modem_state_changed), NULL);
|
G_CALLBACK (modem_state_changed), NULL);
|
||||||
@@ -4398,12 +4373,10 @@ set_property (GObject *object, guint prop_id,
|
|||||||
case MM_GENERIC_GSM_PROP_ALLOWED_MODE:
|
case MM_GENERIC_GSM_PROP_ALLOWED_MODE:
|
||||||
case MM_GENERIC_GSM_PROP_ACCESS_TECHNOLOGY:
|
case MM_GENERIC_GSM_PROP_ACCESS_TECHNOLOGY:
|
||||||
case MM_GENERIC_GSM_PROP_SIM_IDENTIFIER:
|
case MM_GENERIC_GSM_PROP_SIM_IDENTIFIER:
|
||||||
#if LOCATION_API
|
|
||||||
case MM_GENERIC_GSM_PROP_LOC_CAPABILITIES:
|
case MM_GENERIC_GSM_PROP_LOC_CAPABILITIES:
|
||||||
case MM_GENERIC_GSM_PROP_LOC_ENABLED:
|
case MM_GENERIC_GSM_PROP_LOC_ENABLED:
|
||||||
case MM_GENERIC_GSM_PROP_LOC_SIGNAL:
|
case MM_GENERIC_GSM_PROP_LOC_SIGNAL:
|
||||||
case MM_GENERIC_GSM_PROP_LOC_LOCATION:
|
case MM_GENERIC_GSM_PROP_LOC_LOCATION:
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
@@ -4416,9 +4389,7 @@ get_property (GObject *object, guint prop_id,
|
|||||||
GValue *value, GParamSpec *pspec)
|
GValue *value, GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
MMGenericGsmPrivate *priv = MM_GENERIC_GSM_GET_PRIVATE (object);
|
MMGenericGsmPrivate *priv = MM_GENERIC_GSM_GET_PRIVATE (object);
|
||||||
#if LOCATION_API
|
|
||||||
GHashTable *locations = NULL;
|
GHashTable *locations = NULL;
|
||||||
#endif
|
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case MM_MODEM_PROP_DATA_DEVICE:
|
case MM_MODEM_PROP_DATA_DEVICE:
|
||||||
@@ -4467,7 +4438,6 @@ get_property (GObject *object, guint prop_id,
|
|||||||
case MM_GENERIC_GSM_PROP_SIM_IDENTIFIER:
|
case MM_GENERIC_GSM_PROP_SIM_IDENTIFIER:
|
||||||
g_value_set_string (value, priv->simid);
|
g_value_set_string (value, priv->simid);
|
||||||
break;
|
break;
|
||||||
#if LOCATION_API
|
|
||||||
case MM_GENERIC_GSM_PROP_LOC_CAPABILITIES:
|
case MM_GENERIC_GSM_PROP_LOC_CAPABILITIES:
|
||||||
g_value_set_uint (value, priv->loc_caps);
|
g_value_set_uint (value, priv->loc_caps);
|
||||||
break;
|
break;
|
||||||
@@ -4487,7 +4457,6 @@ get_property (GObject *object, guint prop_id,
|
|||||||
locations = g_hash_table_new (g_direct_hash, g_direct_equal);
|
locations = g_hash_table_new (g_direct_hash, g_direct_equal);
|
||||||
g_value_take_boxed (value, locations);
|
g_value_take_boxed (value, locations);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
@@ -4572,7 +4541,6 @@ mm_generic_gsm_class_init (MMGenericGsmClass *klass)
|
|||||||
MM_GENERIC_GSM_PROP_SIM_IDENTIFIER,
|
MM_GENERIC_GSM_PROP_SIM_IDENTIFIER,
|
||||||
MM_MODEM_GSM_CARD_SIM_IDENTIFIER);
|
MM_MODEM_GSM_CARD_SIM_IDENTIFIER);
|
||||||
|
|
||||||
#if LOCATION_API
|
|
||||||
g_object_class_override_property (object_class,
|
g_object_class_override_property (object_class,
|
||||||
MM_GENERIC_GSM_PROP_LOC_CAPABILITIES,
|
MM_GENERIC_GSM_PROP_LOC_CAPABILITIES,
|
||||||
MM_MODEM_LOCATION_CAPABILITIES);
|
MM_MODEM_LOCATION_CAPABILITIES);
|
||||||
@@ -4588,7 +4556,6 @@ mm_generic_gsm_class_init (MMGenericGsmClass *klass)
|
|||||||
g_object_class_override_property (object_class,
|
g_object_class_override_property (object_class,
|
||||||
MM_GENERIC_GSM_PROP_LOC_LOCATION,
|
MM_GENERIC_GSM_PROP_LOC_LOCATION,
|
||||||
MM_MODEM_LOCATION_LOCATION);
|
MM_MODEM_LOCATION_LOCATION);
|
||||||
#endif
|
|
||||||
|
|
||||||
g_object_class_install_property
|
g_object_class_install_property
|
||||||
(object_class, MM_GENERIC_GSM_PROP_POWER_UP_CMD,
|
(object_class, MM_GENERIC_GSM_PROP_POWER_UP_CMD,
|
||||||
|
@@ -49,12 +49,10 @@ typedef enum {
|
|||||||
MM_GENERIC_GSM_PROP_INIT_CMD_OPTIONAL,
|
MM_GENERIC_GSM_PROP_INIT_CMD_OPTIONAL,
|
||||||
MM_GENERIC_GSM_PROP_ALLOWED_MODE,
|
MM_GENERIC_GSM_PROP_ALLOWED_MODE,
|
||||||
MM_GENERIC_GSM_PROP_ACCESS_TECHNOLOGY,
|
MM_GENERIC_GSM_PROP_ACCESS_TECHNOLOGY,
|
||||||
#if LOCATION_API
|
|
||||||
MM_GENERIC_GSM_PROP_LOC_CAPABILITIES,
|
MM_GENERIC_GSM_PROP_LOC_CAPABILITIES,
|
||||||
MM_GENERIC_GSM_PROP_LOC_ENABLED,
|
MM_GENERIC_GSM_PROP_LOC_ENABLED,
|
||||||
MM_GENERIC_GSM_PROP_LOC_SIGNAL,
|
MM_GENERIC_GSM_PROP_LOC_SIGNAL,
|
||||||
MM_GENERIC_GSM_PROP_LOC_LOCATION,
|
MM_GENERIC_GSM_PROP_LOC_LOCATION,
|
||||||
#endif
|
|
||||||
MM_GENERIC_GSM_PROP_SIM_IDENTIFIER,
|
MM_GENERIC_GSM_PROP_SIM_IDENTIFIER,
|
||||||
} MMGenericGsmProp;
|
} MMGenericGsmProp;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user