diff options
-rw-r--r-- | libmm-glib/mm-compat.c | 15 | ||||
-rw-r--r-- | libmm-glib/mm-compat.h | 22 | ||||
-rw-r--r-- | libmm-glib/mm-location-3gpp.c | 33 | ||||
-rw-r--r-- | libmm-glib/mm-location-3gpp.h | 5 |
4 files changed, 37 insertions, 38 deletions
diff --git a/libmm-glib/mm-compat.c b/libmm-glib/mm-compat.c index b878a6f8..f2531a08 100644 --- a/libmm-glib/mm-compat.c +++ b/libmm-glib/mm-compat.c @@ -117,6 +117,21 @@ mm_location_gps_nmea_build_full (MMLocationGpsNmea *self) /*****************************************************************************/ +guint +mm_location_3gpp_get_mobile_network_code (MMLocation3gpp *self) +{ + const gchar *operator_code; + + g_return_val_if_fail (MM_IS_LOCATION_3GPP (self), 0); + + operator_code = mm_location_3gpp_get_operator_code (self); + if (!operator_code) + return 0; + return strtol (operator_code + 3, NULL, 10); +} + +/*****************************************************************************/ + void mm_pco_list_free (GList *pco_list) { diff --git a/libmm-glib/mm-compat.h b/libmm-glib/mm-compat.h index 99f31555..156883a7 100644 --- a/libmm-glib/mm-compat.h +++ b/libmm-glib/mm-compat.h @@ -33,6 +33,7 @@ #include "mm-bearer-properties.h" #include "mm-call-properties.h" #include "mm-location-gps-nmea.h" +#include "mm-location-3gpp.h" #include "mm-pco.h" #include "mm-simple-status.h" #include "mm-modem-3gpp.h" @@ -212,6 +213,27 @@ G_DEPRECATED MMCallState mm_call_properties_get_state (MMCallProperties *self); /*****************************************************************************/ +/** + * mm_location_3gpp_get_mobile_network_code: + * @self: a #MMLocation3gpp. + * + * Gets the Mobile Network Code of the 3GPP network. + * + * Note that 0 may actually be a valid MNC. In general, the MNC should be + * considered valid just if the reported MCC is valid, as MCC should never + * be 0. + * + * Returns: the MNC, or 0 if unknown. + * + * Since: 1.0 + * Deprecated: 1.18.0. This function can not separate between two-digit MNCs + * and three-digit MNCs with a leading zero. Use mm_location_3gpp_get_operator_code() + * instead. + */ +G_DEPRECATED +guint mm_location_3gpp_get_mobile_network_code (MMLocation3gpp *self); + +/*****************************************************************************/ /** * mm_location_gps_nmea_build_full: diff --git a/libmm-glib/mm-location-3gpp.c b/libmm-glib/mm-location-3gpp.c index 30429e56..1bca53f1 100644 --- a/libmm-glib/mm-location-3gpp.c +++ b/libmm-glib/mm-location-3gpp.c @@ -142,39 +142,6 @@ mm_location_3gpp_get_mobile_country_code (MMLocation3gpp *self) /*****************************************************************************/ -#ifndef MM_DISABLE_DEPRECATED - -/** - * mm_location_3gpp_get_mobile_network_code: - * @self: a #MMLocation3gpp. - * - * Gets the Mobile Network Code of the 3GPP network. - * - * Note that 0 may actually be a valid MNC. In general, the MNC should be - * considered valid just if the reported MCC is valid, as MCC should never - * be 0. - * - * Returns: the MNC, or 0 if unknown. - * - * Since: 1.0 - * Deprecated: 1.18.0. This function can not separate between two-digit MNCs - * and three-digit MNCs with a leading zero. Use mm_location_3gpp_get_operator_code() - * instead. - */ -guint -mm_location_3gpp_get_mobile_network_code (MMLocation3gpp *self) -{ - g_return_val_if_fail (MM_IS_LOCATION_3GPP (self), 0); - - if (!self->priv->operator_code) - return 0; - return strtol (self->priv->operator_code + 3, NULL, 10); -} - -#endif /* MM_DISABLE_DEPRECATED */ - -/*****************************************************************************/ - /** * mm_location_3gpp_get_location_area_code: * @self: a #MMLocation3gpp. diff --git a/libmm-glib/mm-location-3gpp.h b/libmm-glib/mm-location-3gpp.h index 5f078234..c8c68082 100644 --- a/libmm-glib/mm-location-3gpp.h +++ b/libmm-glib/mm-location-3gpp.h @@ -62,11 +62,6 @@ gulong mm_location_3gpp_get_cell_id (MMLocation3gpp *self); gulong mm_location_3gpp_get_tracking_area_code (MMLocation3gpp *self); const gchar *mm_location_3gpp_get_operator_code (MMLocation3gpp *self); -#ifndef MM_DISABLE_DEPRECATED -G_DEPRECATED -guint mm_location_3gpp_get_mobile_network_code (MMLocation3gpp *self); -#endif - /*****************************************************************************/ /* ModemManager/libmm-glib/mmcli specific methods */ |