diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-01-16 20:02:47 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-15 14:14:52 +0100 |
commit | 74f29981c8db7f27b061d9740b1472efcec952d5 (patch) | |
tree | 7040b74c6801fc63e0d098747b94fef7312d306d | |
parent | 03c5f4e6fbb5d5f2750f23deb5832b5eaa5c5197 (diff) |
broadband-modem: load default location reporting capabilities
Currently, only LAC/CI if the modem has 3GPP capabilities.
-rw-r--r-- | src/mm-broadband-modem.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index 2a778bc1..21598571 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -3973,6 +3973,49 @@ modem_cdma_register_in_network (MMIfaceModemCdma *self, } /*****************************************************************************/ +/* Load location capabilities (Location interface) */ + +static MMModemLocationSource +modem_location_load_capabilities_finish (MMIfaceModemLocation *self, + GAsyncResult *res, + GError **error) +{ + if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) + return MM_MODEM_LOCATION_SOURCE_NONE; + + return (MMModemLocationSource) GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer ( + G_SIMPLE_ASYNC_RESULT (res))); +} + +static void +modem_location_load_capabilities (MMIfaceModemLocation *self, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GSimpleAsyncResult *result; + + result = g_simple_async_result_new (G_OBJECT (self), + callback, + user_data, + modem_location_load_capabilities); + + /* Default location capabilities supported by the generic broadband + * implementation are only LAC-CI in 3GPP-enabled modems. And even this, + * will only be true if the modem supports CREG/CGREG=2 */ + if (!mm_iface_modem_is_3gpp (MM_IFACE_MODEM (self))) + g_simple_async_result_set_op_res_gpointer (result, + GUINT_TO_POINTER (MM_MODEM_LOCATION_SOURCE_NONE), + NULL); + else + g_simple_async_result_set_op_res_gpointer (result, + GUINT_TO_POINTER (MM_MODEM_LOCATION_SOURCE_GSM_LAC_CI), + NULL); + + g_simple_async_result_complete_in_idle (result); + g_object_unref (result); +} + +/*****************************************************************************/ typedef enum { DISABLING_STEP_FIRST, @@ -4951,6 +4994,8 @@ iface_modem_simple_init (MMIfaceModemSimple *iface) static void iface_modem_location_init (MMIfaceModemLocation *iface) { + iface->load_capabilities = modem_location_load_capabilities; + iface->load_capabilities_finish = modem_location_load_capabilities_finish; } static void |