diff options
29 files changed, 301 insertions, 554 deletions
diff --git a/libmm-common/Makefile.am b/libmm-common/Makefile.am index c712079c..b6f10b73 100644 --- a/libmm-common/Makefile.am +++ b/libmm-common/Makefile.am @@ -151,7 +151,7 @@ $(mm_gdbus_bearer_generated): $(top_srcdir)/introspection/org.freedesktop.ModemM mm-common-helpers.c: mm-errors-types.h mm-enums-types.h mm-common-simple-properties.c: mm-errors-types.h mm-enums-types.h mm-common-connect-properties.c: mm-errors-types.h -mm-common-bearer-properties.c: mm-errors-types.h +mm-bearer-properties.c: mm-errors-types.h mm-sms-properties.c: mm-errors-types.h mm-bearer-ip-config.c: mm-errors-types.h mm-common-location-3gpp.c: mm-errors-types.h @@ -165,7 +165,7 @@ include_HEADERS = \ mm-common-helpers.h \ mm-common-simple-properties.h \ mm-common-connect-properties.h \ - mm-common-bearer-properties.h \ + mm-bearer-properties.h \ mm-sms-properties.h \ mm-bearer-ip-config.h \ mm-common-location-3gpp.h \ @@ -188,8 +188,8 @@ libmm_common_la_SOURCES = \ mm-common-simple-properties.c \ mm-common-connect-properties.h \ mm-common-connect-properties.c \ - mm-common-bearer-properties.h \ - mm-common-bearer-properties.c \ + mm-bearer-properties.h \ + mm-bearer-properties.c \ mm-sms-properties.h \ mm-sms-properties.c \ mm-bearer-ip-config.h \ diff --git a/libmm-common/libmm-common.h b/libmm-common/libmm-common.h index f53d2bcf..3d3a372a 100644 --- a/libmm-common/libmm-common.h +++ b/libmm-common/libmm-common.h @@ -29,7 +29,7 @@ #include "mm-common-simple-properties.h" #include "mm-common-connect-properties.h" #include "mm-sms-properties.h" -#include "mm-common-bearer-properties.h" +#include "mm-bearer-properties.h" #include "mm-bearer-ip-config.h" #include "mm-common-location-3gpp.h" #include "mm-unlock-retries.h" diff --git a/libmm-common/mm-common-bearer-properties.c b/libmm-common/mm-bearer-properties.c index b771d5b4..6475ba7b 100644 --- a/libmm-common/mm-common-bearer-properties.c +++ b/libmm-common/mm-bearer-properties.c @@ -17,9 +17,9 @@ #include "mm-errors-types.h" #include "mm-common-helpers.h" -#include "mm-common-bearer-properties.h" +#include "mm-bearer-properties.h" -G_DEFINE_TYPE (MMCommonBearerProperties, mm_common_bearer_properties, G_TYPE_OBJECT); +G_DEFINE_TYPE (MMBearerProperties, mm_bearer_properties, G_TYPE_OBJECT); #define PROPERTY_APN "apn" #define PROPERTY_USER "user" @@ -29,7 +29,7 @@ G_DEFINE_TYPE (MMCommonBearerProperties, mm_common_bearer_properties, G_TYPE_OBJ #define PROPERTY_ALLOW_ROAMING "allow-roaming" #define PROPERTY_RM_PROTOCOL "rm-protocol" -struct _MMCommonBearerPropertiesPrivate { +struct _MMBearerPropertiesPrivate { /* APN */ gchar *apn; /* IP type */ @@ -50,108 +50,136 @@ struct _MMCommonBearerPropertiesPrivate { /*****************************************************************************/ void -mm_common_bearer_properties_set_apn (MMCommonBearerProperties *self, - const gchar *apn) +mm_bearer_properties_set_apn (MMBearerProperties *self, + const gchar *apn) { + g_return_if_fail (MM_IS_BEARER_PROPERTIES (self)); + g_free (self->priv->apn); self->priv->apn = g_strdup (apn); } void -mm_common_bearer_properties_set_user (MMCommonBearerProperties *self, - const gchar *user) +mm_bearer_properties_set_user (MMBearerProperties *self, + const gchar *user) { + g_return_if_fail (MM_IS_BEARER_PROPERTIES (self)); + g_free (self->priv->user); self->priv->user = g_strdup (user); } void -mm_common_bearer_properties_set_password (MMCommonBearerProperties *self, - const gchar *password) +mm_bearer_properties_set_password (MMBearerProperties *self, + const gchar *password) { + g_return_if_fail (MM_IS_BEARER_PROPERTIES (self)); + g_free (self->priv->password); self->priv->password = g_strdup (password); } void -mm_common_bearer_properties_set_ip_type (MMCommonBearerProperties *self, - const gchar *ip_type) +mm_bearer_properties_set_ip_type (MMBearerProperties *self, + const gchar *ip_type) { + g_return_if_fail (MM_IS_BEARER_PROPERTIES (self)); + g_free (self->priv->ip_type); self->priv->ip_type = g_strdup (ip_type); } void -mm_common_bearer_properties_set_allow_roaming (MMCommonBearerProperties *self, - gboolean allow_roaming) +mm_bearer_properties_set_allow_roaming (MMBearerProperties *self, + gboolean allow_roaming) { + g_return_if_fail (MM_IS_BEARER_PROPERTIES (self)); + self->priv->allow_roaming = allow_roaming; self->priv->allow_roaming_set = TRUE; } void -mm_common_bearer_properties_set_number (MMCommonBearerProperties *self, - const gchar *number) +mm_bearer_properties_set_number (MMBearerProperties *self, + const gchar *number) { + g_return_if_fail (MM_IS_BEARER_PROPERTIES (self)); + g_free (self->priv->number); self->priv->number = g_strdup (number); } void -mm_common_bearer_properties_set_rm_protocol (MMCommonBearerProperties *self, - MMModemCdmaRmProtocol protocol) +mm_bearer_properties_set_rm_protocol (MMBearerProperties *self, + MMModemCdmaRmProtocol protocol) { + g_return_if_fail (MM_IS_BEARER_PROPERTIES (self)); + self->priv->rm_protocol = protocol; } /*****************************************************************************/ const gchar * -mm_common_bearer_properties_get_apn (MMCommonBearerProperties *self) +mm_bearer_properties_get_apn (MMBearerProperties *self) { + g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); + return self->priv->apn; } const gchar * -mm_common_bearer_properties_get_user (MMCommonBearerProperties *self) +mm_bearer_properties_get_user (MMBearerProperties *self) { + g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); + return self->priv->user; } const gchar * -mm_common_bearer_properties_get_password (MMCommonBearerProperties *self) +mm_bearer_properties_get_password (MMBearerProperties *self) { + g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); + return self->priv->password; } const gchar * -mm_common_bearer_properties_get_ip_type (MMCommonBearerProperties *self) +mm_bearer_properties_get_ip_type (MMBearerProperties *self) { + g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); + return self->priv->ip_type; } gboolean -mm_common_bearer_properties_get_allow_roaming (MMCommonBearerProperties *self) +mm_bearer_properties_get_allow_roaming (MMBearerProperties *self) { + g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), FALSE); + return self->priv->allow_roaming; } const gchar * -mm_common_bearer_properties_get_number (MMCommonBearerProperties *self) +mm_bearer_properties_get_number (MMBearerProperties *self) { + g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); + return self->priv->number; } MMModemCdmaRmProtocol -mm_common_bearer_properties_get_rm_protocol (MMCommonBearerProperties *self) +mm_bearer_properties_get_rm_protocol (MMBearerProperties *self) { + g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN); + return self->priv->rm_protocol; } /*****************************************************************************/ GVariant * -mm_common_bearer_properties_get_dictionary (MMCommonBearerProperties *self) +mm_bearer_properties_get_dictionary (MMBearerProperties *self) { GVariantBuilder builder; @@ -159,6 +187,8 @@ mm_common_bearer_properties_get_dictionary (MMCommonBearerProperties *self) if (!self) return NULL; + g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); if (self->priv->apn) @@ -209,19 +239,21 @@ mm_common_bearer_properties_get_dictionary (MMCommonBearerProperties *self) /*****************************************************************************/ gboolean -mm_common_bearer_properties_consume_string (MMCommonBearerProperties *self, - const gchar *key, - const gchar *value, - GError **error) +mm_bearer_properties_consume_string (MMBearerProperties *self, + const gchar *key, + const gchar *value, + GError **error) { + g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), FALSE); + if (g_str_equal (key, PROPERTY_APN)) - mm_common_bearer_properties_set_apn (self, value); + mm_bearer_properties_set_apn (self, value); else if (g_str_equal (key, PROPERTY_USER)) - mm_common_bearer_properties_set_user (self, value); + mm_bearer_properties_set_user (self, value); else if (g_str_equal (key, PROPERTY_PASSWORD)) - mm_common_bearer_properties_set_password (self, value); + mm_bearer_properties_set_password (self, value); else if (g_str_equal (key, PROPERTY_IP_TYPE)) - mm_common_bearer_properties_set_ip_type (self, value); + mm_bearer_properties_set_ip_type (self, value); else if (g_str_equal (key, PROPERTY_ALLOW_ROAMING)) { GError *inner_error = NULL; gboolean allow_roaming; @@ -231,9 +263,9 @@ mm_common_bearer_properties_consume_string (MMCommonBearerProperties *self, g_propagate_error (error, inner_error); return FALSE; } - mm_common_bearer_properties_set_allow_roaming (self, allow_roaming); + mm_bearer_properties_set_allow_roaming (self, allow_roaming); } else if (g_str_equal (key, PROPERTY_NUMBER)) - mm_common_bearer_properties_set_number (self, value); + mm_bearer_properties_set_number (self, value); else if (g_str_equal (key, PROPERTY_RM_PROTOCOL)) { GError *inner_error = NULL; MMModemCdmaRmProtocol protocol; @@ -243,7 +275,7 @@ mm_common_bearer_properties_consume_string (MMCommonBearerProperties *self, g_propagate_error (error, inner_error); return FALSE; } - mm_common_bearer_properties_set_rm_protocol (self, protocol); + mm_bearer_properties_set_rm_protocol (self, protocol); } else { g_set_error (error, MM_CORE_ERROR, @@ -257,7 +289,7 @@ mm_common_bearer_properties_consume_string (MMCommonBearerProperties *self, } typedef struct { - MMCommonBearerProperties *properties; + MMBearerProperties *properties; GError *error; } ParseKeyValueContext; @@ -266,20 +298,20 @@ key_value_foreach (const gchar *key, const gchar *value, ParseKeyValueContext *ctx) { - return mm_common_bearer_properties_consume_string (ctx->properties, - key, - value, - &ctx->error); + return mm_bearer_properties_consume_string (ctx->properties, + key, + value, + &ctx->error); } -MMCommonBearerProperties * -mm_common_bearer_properties_new_from_string (const gchar *str, - GError **error) +MMBearerProperties * +mm_bearer_properties_new_from_string (const gchar *str, + GError **error) { ParseKeyValueContext ctx; ctx.error = NULL; - ctx.properties = mm_common_bearer_properties_new (); + ctx.properties = mm_bearer_properties_new (); mm_common_parse_key_value_string (str, &ctx.error, @@ -298,33 +330,35 @@ mm_common_bearer_properties_new_from_string (const gchar *str, /*****************************************************************************/ gboolean -mm_common_bearer_properties_consume_variant (MMCommonBearerProperties *properties, - const gchar *key, - GVariant *value, - GError **error) +mm_bearer_properties_consume_variant (MMBearerProperties *properties, + const gchar *key, + GVariant *value, + GError **error) { + g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (properties), FALSE); + if (g_str_equal (key, PROPERTY_APN)) - mm_common_bearer_properties_set_apn ( + mm_bearer_properties_set_apn ( properties, g_variant_get_string (value, NULL)); else if (g_str_equal (key, PROPERTY_USER)) - mm_common_bearer_properties_set_user ( + mm_bearer_properties_set_user ( properties, g_variant_get_string (value, NULL)); else if (g_str_equal (key, PROPERTY_PASSWORD)) - mm_common_bearer_properties_set_password ( + mm_bearer_properties_set_password ( properties, g_variant_get_string (value, NULL)); else if (g_str_equal (key, PROPERTY_IP_TYPE)) - mm_common_bearer_properties_set_ip_type ( + mm_bearer_properties_set_ip_type ( properties, g_variant_get_string (value, NULL)); else if (g_str_equal (key, PROPERTY_NUMBER)) - mm_common_bearer_properties_set_number ( + mm_bearer_properties_set_number ( properties, g_variant_get_string (value, NULL)); else if (g_str_equal (key, PROPERTY_ALLOW_ROAMING)) - mm_common_bearer_properties_set_allow_roaming ( + mm_bearer_properties_set_allow_roaming ( properties, g_variant_get_boolean (value)); else { @@ -340,24 +374,34 @@ mm_common_bearer_properties_consume_variant (MMCommonBearerProperties *propertie return TRUE; } -MMCommonBearerProperties * -mm_common_bearer_properties_new_from_dictionary (GVariant *dictionary, - GError **error) +MMBearerProperties * +mm_bearer_properties_new_from_dictionary (GVariant *dictionary, + GError **error) { GError *inner_error = NULL; GVariantIter iter; gchar *key; GVariant *value; - MMCommonBearerProperties *properties; + MMBearerProperties *properties; - properties = mm_common_bearer_properties_new (); + properties = mm_bearer_properties_new (); if (!dictionary) return properties; + if (!g_variant_is_of_type (dictionary, G_VARIANT_TYPE ("a{sv}"))) { + g_set_error (error, + MM_CORE_ERROR, + MM_CORE_ERROR_INVALID_ARGS, + "Cannot create Bearer properties from dictionary: " + "invalid variant type received"); + g_object_unref (properties); + return NULL; + } + g_variant_iter_init (&iter, dictionary); while (!inner_error && g_variant_iter_next (&iter, "{sv}", &key, &value)) { - mm_common_bearer_properties_consume_variant (properties, + mm_bearer_properties_consume_variant (properties, key, value, &inner_error); @@ -377,15 +421,17 @@ mm_common_bearer_properties_new_from_dictionary (GVariant *dictionary, /*****************************************************************************/ -MMCommonBearerProperties * -mm_common_bearer_properties_dup (MMCommonBearerProperties *orig) +MMBearerProperties * +mm_bearer_properties_dup (MMBearerProperties *orig) { GVariant *dict; - MMCommonBearerProperties *copy; + MMBearerProperties *copy; GError *error = NULL; - dict = mm_common_bearer_properties_get_dictionary (orig); - copy = mm_common_bearer_properties_new_from_dictionary (dict, &error); + g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (orig), NULL); + + dict = mm_bearer_properties_get_dictionary (orig); + copy = mm_bearer_properties_new_from_dictionary (dict, &error); g_assert_no_error (error); g_variant_unref (dict); @@ -394,19 +440,19 @@ mm_common_bearer_properties_dup (MMCommonBearerProperties *orig) /*****************************************************************************/ -MMCommonBearerProperties * -mm_common_bearer_properties_new (void) +MMBearerProperties * +mm_bearer_properties_new (void) { - return (MM_COMMON_BEARER_PROPERTIES ( - g_object_new (MM_TYPE_COMMON_BEARER_PROPERTIES, NULL))); + return (MM_BEARER_PROPERTIES ( + g_object_new (MM_TYPE_BEARER_PROPERTIES, NULL))); } static void -mm_common_bearer_properties_init (MMCommonBearerProperties *self) +mm_bearer_properties_init (MMBearerProperties *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), - MM_TYPE_COMMON_BEARER_PROPERTIES, - MMCommonBearerPropertiesPrivate); + MM_TYPE_BEARER_PROPERTIES, + MMBearerPropertiesPrivate); /* Some defaults */ self->priv->allow_roaming = TRUE; @@ -416,7 +462,7 @@ mm_common_bearer_properties_init (MMCommonBearerProperties *self) static void finalize (GObject *object) { - MMCommonBearerProperties *self = MM_COMMON_BEARER_PROPERTIES (object); + MMBearerProperties *self = MM_BEARER_PROPERTIES (object); g_free (self->priv->apn); g_free (self->priv->user); @@ -424,15 +470,15 @@ finalize (GObject *object) g_free (self->priv->ip_type); g_free (self->priv->number); - G_OBJECT_CLASS (mm_common_bearer_properties_parent_class)->finalize (object); + G_OBJECT_CLASS (mm_bearer_properties_parent_class)->finalize (object); } static void -mm_common_bearer_properties_class_init (MMCommonBearerPropertiesClass *klass) +mm_bearer_properties_class_init (MMBearerPropertiesClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - g_type_class_add_private (object_class, sizeof (MMCommonBearerPropertiesPrivate)); + g_type_class_add_private (object_class, sizeof (MMBearerPropertiesPrivate)); object_class->finalize = finalize; } diff --git a/libmm-common/mm-bearer-properties.h b/libmm-common/mm-bearer-properties.h new file mode 100644 index 00000000..407eb0ed --- /dev/null +++ b/libmm-common/mm-bearer-properties.h @@ -0,0 +1,91 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2011 Aleksander Morgado <aleksander@gnu.org> + */ + +#ifndef MM_BEARER_PROPERTIES_H +#define MM_BEARER_PROPERTIES_H + +#include <ModemManager.h> +#include <glib-object.h> + +G_BEGIN_DECLS + +#define MM_TYPE_BEARER_PROPERTIES (mm_bearer_properties_get_type ()) +#define MM_BEARER_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BEARER_PROPERTIES, MMBearerProperties)) +#define MM_BEARER_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BEARER_PROPERTIES, MMBearerPropertiesClass)) +#define MM_IS_BEARER_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_BEARER_PROPERTIES)) +#define MM_IS_BEARER_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_BEARER_PROPERTIES)) +#define MM_BEARER_PROPERTIES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_BEARER_PROPERTIES, MMBearerPropertiesClass)) + +typedef struct _MMBearerProperties MMBearerProperties; +typedef struct _MMBearerPropertiesClass MMBearerPropertiesClass; +typedef struct _MMBearerPropertiesPrivate MMBearerPropertiesPrivate; + +struct _MMBearerProperties { + GObject parent; + MMBearerPropertiesPrivate *priv; +}; + +struct _MMBearerPropertiesClass { + GObjectClass parent; +}; + +GType mm_bearer_properties_get_type (void); + +MMBearerProperties *mm_bearer_properties_new (void); +MMBearerProperties *mm_bearer_properties_new_from_string (const gchar *str, + GError **error); +MMBearerProperties *mm_bearer_properties_new_from_dictionary (GVariant *dictionary, + GError **error); + +MMBearerProperties *mm_bearer_properties_dup (MMBearerProperties *orig); + +void mm_bearer_properties_set_apn (MMBearerProperties *properties, + const gchar *apn); +void mm_bearer_properties_set_user (MMBearerProperties *properties, + const gchar *user); +void mm_bearer_properties_set_password (MMBearerProperties *properties, + const gchar *password); +void mm_bearer_properties_set_ip_type (MMBearerProperties *properties, + const gchar *ip_type); +void mm_bearer_properties_set_allow_roaming (MMBearerProperties *properties, + gboolean allow_roaming); +void mm_bearer_properties_set_number (MMBearerProperties *properties, + const gchar *number); +void mm_bearer_properties_set_rm_protocol (MMBearerProperties *properties, + MMModemCdmaRmProtocol protocol); + +const gchar *mm_bearer_properties_get_apn (MMBearerProperties *properties); +const gchar *mm_bearer_properties_get_user (MMBearerProperties *properties); +const gchar *mm_bearer_properties_get_password (MMBearerProperties *properties); +const gchar *mm_bearer_properties_get_ip_type (MMBearerProperties *properties); +gboolean mm_bearer_properties_get_allow_roaming (MMBearerProperties *properties); +const gchar *mm_bearer_properties_get_number (MMBearerProperties *properties); +MMModemCdmaRmProtocol mm_bearer_properties_get_rm_protocol (MMBearerProperties *properties); + +gboolean mm_bearer_properties_consume_string (MMBearerProperties *self, + const gchar *key, + const gchar *value, + GError **error); + +gboolean mm_bearer_properties_consume_variant (MMBearerProperties *self, + const gchar *key, + GVariant *value, + GError **error); + +GVariant *mm_bearer_properties_get_dictionary (MMBearerProperties *self); + +G_END_DECLS + +#endif /* MM_BEARER_PROPERTIES_H */ diff --git a/libmm-common/mm-common-bearer-properties.h b/libmm-common/mm-common-bearer-properties.h deleted file mode 100644 index 715fc61a..00000000 --- a/libmm-common/mm-common-bearer-properties.h +++ /dev/null @@ -1,107 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details: - * - * Copyright (C) 2011 Aleksander Morgado <aleksander@gnu.org> - */ - -#ifndef MM_COMMON_BEARER_PROPERTIES_H -#define MM_COMMON_BEARER_PROPERTIES_H - -#include <ModemManager.h> -#include <glib-object.h> - -G_BEGIN_DECLS - -#define MM_TYPE_COMMON_BEARER_PROPERTIES (mm_common_bearer_properties_get_type ()) -#define MM_COMMON_BEARER_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_COMMON_BEARER_PROPERTIES, MMCommonBearerProperties)) -#define MM_COMMON_BEARER_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_COMMON_BEARER_PROPERTIES, MMCommonBearerPropertiesClass)) -#define MM_IS_COMMON_BEARER_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_COMMON_BEARER_PROPERTIES)) -#define MM_IS_COMMON_BEARER_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_COMMON_BEARER_PROPERTIES)) -#define MM_COMMON_BEARER_PROPERTIES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_COMMON_BEARER_PROPERTIES, MMCommonBearerPropertiesClass)) - -typedef struct _MMCommonBearerProperties MMCommonBearerProperties; -typedef struct _MMCommonBearerPropertiesClass MMCommonBearerPropertiesClass; -typedef struct _MMCommonBearerPropertiesPrivate MMCommonBearerPropertiesPrivate; - -struct _MMCommonBearerProperties { - GObject parent; - MMCommonBearerPropertiesPrivate *priv; -}; - -struct _MMCommonBearerPropertiesClass { - GObjectClass parent; -}; - -GType mm_common_bearer_properties_get_type (void); - -MMCommonBearerProperties *mm_common_bearer_properties_new (void); -MMCommonBearerProperties *mm_common_bearer_properties_new_from_string ( - const gchar *str, - GError **error); -MMCommonBearerProperties *mm_common_bearer_properties_new_from_dictionary ( - GVariant *dictionary, - GError **error); - -MMCommonBearerProperties *mm_common_bearer_properties_dup (MMCommonBearerProperties *orig); - -void mm_common_bearer_properties_set_apn ( - MMCommonBearerProperties *properties, - const gchar *apn); -void mm_common_bearer_properties_set_user ( - MMCommonBearerProperties *properties, - const gchar *user); -void mm_common_bearer_properties_set_password ( - MMCommonBearerProperties *properties, - const gchar *password); -void mm_common_bearer_properties_set_ip_type ( - MMCommonBearerProperties *properties, - const gchar *ip_type); -void mm_common_bearer_properties_set_allow_roaming ( - MMCommonBearerProperties *properties, - gboolean allow_roaming); -void mm_common_bearer_properties_set_number ( - MMCommonBearerProperties *properties, - const gchar *number); -void mm_common_bearer_properties_set_rm_protocol ( - MMCommonBearerProperties *properties, - MMModemCdmaRmProtocol protocol); - -const gchar *mm_common_bearer_properties_get_apn ( - MMCommonBearerProperties *properties); -const gchar *mm_common_bearer_properties_get_user ( - MMCommonBearerProperties *properties); -const gchar *mm_common_bearer_properties_get_password ( - MMCommonBearerProperties *properties); -const gchar *mm_common_bearer_properties_get_ip_type ( - MMCommonBearerProperties *properties); -gboolean mm_common_bearer_properties_get_allow_roaming ( - MMCommonBearerProperties *properties); -const gchar *mm_common_bearer_properties_get_number ( - MMCommonBearerProperties *properties); -MMModemCdmaRmProtocol mm_common_bearer_properties_get_rm_protocol ( - MMCommonBearerProperties *properties); - -gboolean mm_common_bearer_properties_consume_string (MMCommonBearerProperties *self, - const gchar *key, - const gchar *value, - GError **error); - -gboolean mm_common_bearer_properties_consume_variant (MMCommonBearerProperties *self, - const gchar *key, - GVariant *value, - GError **error); - -GVariant *mm_common_bearer_properties_get_dictionary (MMCommonBearerProperties *self); - -G_END_DECLS - -#endif /* MM_COMMON_BEARER_PROPERTIES_H */ diff --git a/libmm-common/mm-common-connect-properties.c b/libmm-common/mm-common-connect-properties.c index fac08fda..773acdc6 100644 --- a/libmm-common/mm-common-connect-properties.c +++ b/libmm-common/mm-common-connect-properties.c @@ -40,7 +40,7 @@ struct _MMCommonConnectPropertiesPrivate { MMModemMode allowed_modes; MMModemMode preferred_mode; /* Bearer properties */ - MMCommonBearerProperties *bearer_properties; + MMBearerProperties *bearer_properties; }; /*****************************************************************************/ @@ -88,53 +88,53 @@ void mm_common_connect_properties_set_apn (MMCommonConnectProperties *self, const gchar *apn) { - mm_common_bearer_properties_set_apn (self->priv->bearer_properties, - apn); + mm_bearer_properties_set_apn (self->priv->bearer_properties, + apn); } void mm_common_connect_properties_set_user (MMCommonConnectProperties *self, const gchar *user) { - mm_common_bearer_properties_set_user (self->priv->bearer_properties, - user); + mm_bearer_properties_set_user (self->priv->bearer_properties, + user); } void mm_common_connect_properties_set_password (MMCommonConnectProperties *self, const gchar *password) { - mm_common_bearer_properties_set_password (self->priv->bearer_properties, - password); + mm_bearer_properties_set_password (self->priv->bearer_properties, + password); } void mm_common_connect_properties_set_ip_type (MMCommonConnectProperties *self, const gchar *ip_type) { - mm_common_bearer_properties_set_ip_type (self->priv->bearer_properties, - ip_type); + mm_bearer_properties_set_ip_type (self->priv->bearer_properties, + ip_type); } void mm_common_connect_properties_set_allow_roaming (MMCommonConnectProperties *self, gboolean allow_roaming) { - mm_common_bearer_properties_set_allow_roaming (self->priv->bearer_properties, - allow_roaming); + mm_bearer_properties_set_allow_roaming (self->priv->bearer_properties, + allow_roaming); } void mm_common_connect_properties_set_number (MMCommonConnectProperties *self, const gchar *number) { - mm_common_bearer_properties_set_number (self->priv->bearer_properties, - number); + mm_bearer_properties_set_number (self->priv->bearer_properties, + number); } /*****************************************************************************/ -MMCommonBearerProperties * +MMBearerProperties * mm_common_connect_properties_get_bearer_properties (MMCommonConnectProperties *self) { return g_object_ref (self->priv->bearer_properties); @@ -173,37 +173,37 @@ mm_common_connect_properties_get_allowed_modes (MMCommonConnectProperties *self, const gchar * mm_common_connect_properties_get_apn (MMCommonConnectProperties *self) { - return mm_common_bearer_properties_get_apn (self->priv->bearer_properties); + return mm_bearer_properties_get_apn (self->priv->bearer_properties); } const gchar * mm_common_connect_properties_get_user (MMCommonConnectProperties *self) { - return mm_common_bearer_properties_get_user (self->priv->bearer_properties); + return mm_bearer_properties_get_user (self->priv->bearer_properties); } const gchar * mm_common_connect_properties_get_password (MMCommonConnectProperties *self) { - return mm_common_bearer_properties_get_password (self->priv->bearer_properties); + return mm_bearer_properties_get_password (self->priv->bearer_properties); } const gchar * mm_common_connect_properties_get_ip_type (MMCommonConnectProperties *self) { - return mm_common_bearer_properties_get_ip_type (self->priv->bearer_properties); + return mm_bearer_properties_get_ip_type (self->priv->bearer_properties); } gboolean mm_common_connect_properties_get_allow_roaming (MMCommonConnectProperties *self) { - return mm_common_bearer_properties_get_allow_roaming (self->priv->bearer_properties); + return mm_bearer_properties_get_allow_roaming (self->priv->bearer_properties); } const gchar * mm_common_connect_properties_get_number (MMCommonConnectProperties *self) { - return mm_common_bearer_properties_get_number (self->priv->bearer_properties); + return mm_bearer_properties_get_number (self->priv->bearer_properties); } /*****************************************************************************/ @@ -254,7 +254,7 @@ mm_common_connect_properties_get_dictionary (MMCommonConnectProperties *self) } /* Merge dictionaries */ - bearer_properties_dictionary = mm_common_bearer_properties_get_dictionary (self->priv->bearer_properties); + bearer_properties_dictionary = mm_bearer_properties_get_dictionary (self->priv->bearer_properties); g_variant_iter_init (&iter, bearer_properties_dictionary); while (g_variant_iter_next (&iter, "{sv}", &key, &value)) { g_variant_builder_add (&builder, @@ -284,9 +284,9 @@ key_value_foreach (const gchar *key, ParseKeyValueContext *ctx) { /* First, check if we can consume this as bearer properties */ - if (mm_common_bearer_properties_consume_string (ctx->properties->priv->bearer_properties, - key, value, - NULL)) + if (mm_bearer_properties_consume_string (ctx->properties->priv->bearer_properties, + key, value, + NULL)) return TRUE; if (g_str_equal (key, PROPERTY_PIN)) @@ -394,9 +394,9 @@ mm_common_connect_properties_new_from_dictionary (GVariant *dictionary, g_variant_iter_next (&iter, "{sv}", &key, &value)) { /* First, check if we can consume this as bearer properties */ - if (!mm_common_bearer_properties_consume_variant (properties->priv->bearer_properties, - key, value, - NULL)) { + if (!mm_bearer_properties_consume_variant (properties->priv->bearer_properties, + key, value, + NULL)) { if (g_str_equal (key, PROPERTY_PIN)) mm_common_connect_properties_set_pin ( properties, @@ -480,7 +480,7 @@ mm_common_connect_properties_init (MMCommonConnectProperties *self) MMCommonConnectPropertiesPrivate); /* Some defaults */ - self->priv->bearer_properties = mm_common_bearer_properties_new (); + self->priv->bearer_properties = mm_bearer_properties_new (); self->priv->allowed_modes = MM_MODEM_MODE_ANY; self->priv->preferred_mode = MM_MODEM_MODE_NONE; self->priv->bands = g_new (MMModemBand, 1); diff --git a/libmm-common/mm-common-connect-properties.h b/libmm-common/mm-common-connect-properties.h index 2b577ce2..8a49950f 100644 --- a/libmm-common/mm-common-connect-properties.h +++ b/libmm-common/mm-common-connect-properties.h @@ -19,7 +19,7 @@ #include <ModemManager.h> #include <glib-object.h> -#include "mm-common-bearer-properties.h" +#include "mm-bearer-properties.h" G_BEGIN_DECLS @@ -111,7 +111,7 @@ gboolean mm_common_connect_properties_get_allow_roaming ( const gchar *mm_common_connect_properties_get_number ( MMCommonConnectProperties *properties); -MMCommonBearerProperties *mm_common_connect_properties_get_bearer_properties ( +MMBearerProperties *mm_common_connect_properties_get_bearer_properties ( MMCommonConnectProperties *properties); GVariant *mm_common_connect_properties_get_dictionary (MMCommonConnectProperties *self); diff --git a/libmm-glib/Makefile.am b/libmm-glib/Makefile.am index a0ebc353..adebf032 100644 --- a/libmm-glib/Makefile.am +++ b/libmm-glib/Makefile.am @@ -40,8 +40,6 @@ libmm_glib_la_SOURCES = \ mm-sms.c \ mm-modem-messaging.h \ mm-modem-messaging.c \ - mm-bearer-properties.h \ - mm-bearer-properties.c \ mm-bearer.h \ mm-bearer.c @@ -61,5 +59,4 @@ include_HEADERS = \ mm-modem-simple.h \ mm-sim.h \ mm-sms.h \ - mm-bearer-properties.h \ mm-bearer.h diff --git a/libmm-glib/mm-bearer-properties.c b/libmm-glib/mm-bearer-properties.c deleted file mode 100644 index 5f14eb56..00000000 --- a/libmm-glib/mm-bearer-properties.c +++ /dev/null @@ -1,190 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details: - * - * Copyright (C) 2011 Aleksander Morgado <aleksander@gnu.org> - */ - -#include "mm-bearer-properties.h" - -void -mm_bearer_properties_set_apn (MMBearerProperties *self, - const gchar *apn) -{ - g_return_if_fail (MM_IS_BEARER_PROPERTIES (self)); - - mm_common_bearer_properties_set_apn (self, apn); -} - -void -mm_bearer_properties_set_user (MMBearerProperties *self, - const gchar *user) -{ - g_return_if_fail (MM_IS_BEARER_PROPERTIES (self)); - - mm_common_bearer_properties_set_user (self, user); -} - -void -mm_bearer_properties_set_password (MMBearerProperties *self, - const gchar *password) -{ - g_return_if_fail (MM_IS_BEARER_PROPERTIES (self)); - - mm_common_bearer_properties_set_password (self, password); -} - -void -mm_bearer_properties_set_ip_type (MMBearerProperties *self, - const gchar *ip_type) -{ - g_return_if_fail (MM_IS_BEARER_PROPERTIES (self)); - - mm_common_bearer_properties_set_ip_type (self, ip_type); -} - -void -mm_bearer_properties_set_allow_roaming (MMBearerProperties *self, - gboolean allow_roaming) -{ - g_return_if_fail (MM_IS_BEARER_PROPERTIES (self)); - - mm_common_bearer_properties_set_allow_roaming (self, allow_roaming); -} - -void -mm_bearer_properties_set_number (MMBearerProperties *self, - const gchar *number) -{ - g_return_if_fail (MM_IS_BEARER_PROPERTIES (self)); - - mm_common_bearer_properties_set_number (self, number); -} - -void -mm_bearer_properties_set_rm_protocol (MMBearerProperties *self, - MMModemCdmaRmProtocol protocol) -{ - g_return_if_fail (MM_IS_BEARER_PROPERTIES (self)); - - mm_common_bearer_properties_set_rm_protocol (self, protocol); -} - -const gchar * -mm_bearer_properties_get_apn (MMBearerProperties *self) -{ - g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); - - return mm_common_bearer_properties_get_apn (self); -} - -gchar * -mm_bearer_properties_dup_apn (MMBearerProperties *self) -{ - g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); - - return g_strdup (mm_common_bearer_properties_get_apn (self)); -} - -const gchar * -mm_bearer_properties_get_user (MMBearerProperties *self) -{ - g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); - - return mm_common_bearer_properties_get_user (self); -} - -gchar * -mm_bearer_properties_dup_user (MMBearerProperties *self) -{ - g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); - - return g_strdup (mm_common_bearer_properties_get_user (self)); -} - -const gchar * -mm_bearer_properties_get_password (MMBearerProperties *self) -{ - g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); - - return mm_common_bearer_properties_get_password (self); -} - -gchar * -mm_bearer_properties_dup_password (MMBearerProperties *self) -{ - g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); - - return g_strdup (mm_common_bearer_properties_get_password (self)); -} - -const gchar * -mm_bearer_properties_get_ip_type (MMBearerProperties *self) -{ - g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); - - return mm_common_bearer_properties_get_ip_type (self); -} - -gchar * -mm_bearer_properties_dup_ip_type (MMBearerProperties *self) -{ - g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); - - return g_strdup (mm_common_bearer_properties_get_ip_type (self)); -} - -gboolean -mm_bearer_properties_get_allow_roaming (MMBearerProperties *self) -{ - g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), FALSE); - - return mm_common_bearer_properties_get_allow_roaming (self); -} - -const gchar * -mm_bearer_properties_get_number (MMBearerProperties *self) -{ - g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); - - return mm_common_bearer_properties_get_number (self); -} - -gchar * -mm_bearer_properties_dup_number (MMBearerProperties *self) -{ - g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), NULL); - - return g_strdup (mm_common_bearer_properties_get_number (self)); -} - -MMModemCdmaRmProtocol -mm_bearer_properties_get_rm_protocol (MMBearerProperties *self) -{ - g_return_val_if_fail (MM_IS_BEARER_PROPERTIES (self), MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN); - - return mm_common_bearer_properties_get_rm_protocol (self); -} - -/*****************************************************************************/ - -MMBearerProperties * -mm_bearer_properties_new_from_string (const gchar *str, - GError **error) -{ - return mm_common_bearer_properties_new_from_string (str, error); -} - -MMBearerProperties * -mm_bearer_properties_new (void) -{ - return mm_common_bearer_properties_new (); -} diff --git a/libmm-glib/mm-bearer-properties.h b/libmm-glib/mm-bearer-properties.h deleted file mode 100644 index 6d7442d5..00000000 --- a/libmm-glib/mm-bearer-properties.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details: - * - * Copyright (C) 2011 Aleksander Morgado <aleksander@gnu.org> - */ - -#ifndef MM_BEARER_PROPERTIES_H -#define MM_BEARER_PROPERTIES_H - -#include <ModemManager.h> -#include <glib-object.h> - -#include <libmm-common.h> - -G_BEGIN_DECLS - -typedef MMCommonBearerProperties MMBearerProperties; -#define MM_TYPE_BEARER_PROPERTIES(o) MM_TYPE_COMMON_BEARER_PROPERTIES (o) -#define MM_BEARER_PROPERTIES(o) MM_COMMON_BEARER_PROPERTIES(o) -#define MM_IS_BEARER_PROPERTIES(o) MM_IS_COMMON_BEARER_PROPERTIES(o) - -MMBearerProperties *mm_bearer_properties_new (void); -MMBearerProperties *mm_bearer_properties_new_from_string ( - const gchar *str, - GError **error); - -void mm_bearer_properties_set_apn ( - MMBearerProperties *properties, - const gchar *apn); -void mm_bearer_properties_set_user ( - MMBearerProperties *properties, - const gchar *user); -void mm_bearer_properties_set_password ( - MMBearerProperties *properties, - const gchar *password); -void mm_bearer_properties_set_ip_type ( - MMBearerProperties *properties, - const gchar *ip_type); -void mm_bearer_properties_set_allow_roaming ( - MMBearerProperties *properties, - gboolean allow_roaming); -void mm_bearer_properties_set_number ( - MMBearerProperties *properties, - const gchar *number); -void mm_bearer_properties_set_rm_protocol ( - MMBearerProperties *properties, - MMModemCdmaRmProtocol protocol); - -const gchar *mm_bearer_properties_get_apn ( - MMBearerProperties *properties); -gchar *mm_bearer_properties_dup_apn ( - MMBearerProperties *properties); -const gchar *mm_bearer_properties_get_user ( - MMBearerProperties *properties); -gchar *mm_bearer_properties_dup_user ( - MMBearerProperties *properties); -const gchar *mm_bearer_properties_get_password ( - MMBearerProperties *properties); -gchar *mm_bearer_properties_dup_password ( - MMBearerProperties *properties); -const gchar *mm_bearer_properties_get_ip_type ( - MMBearerProperties *properties); -gchar *mm_bearer_properties_dup_ip_type ( - MMBearerProperties *properties); -gboolean mm_bearer_properties_get_allow_roaming ( - MMBearerProperties *properties); -const gchar *mm_bearer_properties_get_number ( - MMBearerProperties *properties); -gchar *mm_bearer_properties_dup_number ( - MMBearerProperties *properties); -MMModemCdmaRmProtocol mm_bearer_properties_get_rm_protocol ( - MMBearerProperties *properties); - -G_END_DECLS - -#endif /* MM_BEARER_PROPERTIES_H */ diff --git a/libmm-glib/mm-bearer.c b/libmm-glib/mm-bearer.c index e815aa50..ccd3e77f 100644 --- a/libmm-glib/mm-bearer.c +++ b/libmm-glib/mm-bearer.c @@ -193,7 +193,7 @@ mm_bearer_get_properties (MMBearer *self) g_return_val_if_fail (MM_IS_BEARER (self), NULL); - properties = (mm_common_bearer_properties_new_from_dictionary ( + properties = (mm_bearer_properties_new_from_dictionary ( mm_gdbus_bearer_get_properties (MM_GDBUS_BEARER (self)), &error)); if (!properties) { diff --git a/libmm-glib/mm-bearer.h b/libmm-glib/mm-bearer.h index cf54695d..e03f8288 100644 --- a/libmm-glib/mm-bearer.h +++ b/libmm-glib/mm-bearer.h @@ -26,8 +26,6 @@ #include <ModemManager.h> #include <libmm-common.h> -#include "mm-bearer-properties.h" - G_BEGIN_DECLS typedef MmGdbusBearer MMBearer; diff --git a/libmm-glib/mm-modem.c b/libmm-glib/mm-modem.c index 5edf6abd..c5e81035 100644 --- a/libmm-glib/mm-modem.c +++ b/libmm-glib/mm-modem.c @@ -1225,8 +1225,7 @@ mm_modem_create_bearer (MMModem *self, if (cancellable) ctx->cancellable = g_object_ref (cancellable); - dictionary = (mm_common_bearer_properties_get_dictionary ( - MM_COMMON_BEARER_PROPERTIES (properties))); + dictionary = mm_bearer_properties_get_dictionary (properties); mm_gdbus_modem_call_create_bearer ( self, dictionary, @@ -1268,8 +1267,7 @@ mm_modem_create_bearer_sync (MMModem *self, g_return_val_if_fail (MM_GDBUS_IS_MODEM (self), NULL); - dictionary = (mm_common_bearer_properties_get_dictionary ( - MM_COMMON_BEARER_PROPERTIES (properties))); + dictionary = mm_bearer_properties_get_dictionary (properties); mm_gdbus_modem_call_create_bearer_sync (self, dictionary, &bearer_path, diff --git a/libmm-glib/mm-modem.h b/libmm-glib/mm-modem.h index a55df65f..0fec622c 100644 --- a/libmm-glib/mm-modem.h +++ b/libmm-glib/mm-modem.h @@ -28,7 +28,6 @@ #include "mm-sim.h" #include "mm-bearer.h" -#include "mm-bearer-properties.h" G_BEGIN_DECLS diff --git a/plugins/iridium/mm-bearer-iridium.c b/plugins/iridium/mm-bearer-iridium.c index 43b19a23..7811fe90 100644 --- a/plugins/iridium/mm-bearer-iridium.c +++ b/plugins/iridium/mm-bearer-iridium.c @@ -378,13 +378,13 @@ disconnect (MMBearer *self, static gboolean cmp_properties (MMBearer *self, - MMCommonBearerProperties *properties) + MMBearerProperties *properties) { - return (mm_common_bearer_properties_get_apn (properties) == NULL && - mm_common_bearer_properties_get_ip_type (properties) == NULL && - mm_common_bearer_properties_get_number (properties) == NULL && - mm_common_bearer_properties_get_rm_protocol (properties) == MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN && - mm_common_bearer_properties_get_allow_roaming (properties)); + return (mm_bearer_properties_get_apn (properties) == NULL && + mm_bearer_properties_get_ip_type (properties) == NULL && + mm_bearer_properties_get_number (properties) == NULL && + mm_bearer_properties_get_rm_protocol (properties) == MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN && + mm_bearer_properties_get_allow_roaming (properties)); } /*****************************************************************************/ diff --git a/plugins/iridium/mm-broadband-modem-iridium.c b/plugins/iridium/mm-broadband-modem-iridium.c index bb5cdc47..8ae7a8fc 100644 --- a/plugins/iridium/mm-broadband-modem-iridium.c +++ b/plugins/iridium/mm-broadband-modem-iridium.c @@ -354,7 +354,7 @@ create_bearer_finish (MMIfaceModem *self, static void create_bearer (MMIfaceModem *self, - MMCommonBearerProperties *properties, + MMBearerProperties *properties, GAsyncReadyCallback callback, gpointer user_data) { diff --git a/plugins/novatel/mm-broadband-bearer-novatel.c b/plugins/novatel/mm-broadband-bearer-novatel.c index 7abac790..e480114a 100644 --- a/plugins/novatel/mm-broadband-bearer-novatel.c +++ b/plugins/novatel/mm-broadband-bearer-novatel.c @@ -406,7 +406,7 @@ mm_broadband_bearer_novatel_new_finish (GAsyncResult *res, } void mm_broadband_bearer_novatel_new (MMBroadbandModemNovatel *modem, - MMCommonBearerProperties *properties, + MMBearerProperties *properties, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) diff --git a/plugins/novatel/mm-broadband-bearer-novatel.h b/plugins/novatel/mm-broadband-bearer-novatel.h index 228362e0..bae9497a 100644 --- a/plugins/novatel/mm-broadband-bearer-novatel.h +++ b/plugins/novatel/mm-broadband-bearer-novatel.h @@ -49,12 +49,12 @@ GType mm_broadband_bearer_novatel_get_type (void); /* Default 3GPP bearer creation implementation */ void mm_broadband_bearer_novatel_new (MMBroadbandModemNovatel *modem, - MMCommonBearerProperties *properties, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); + MMBearerProperties *properties, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); MMBearer *mm_broadband_bearer_novatel_new_finish (GAsyncResult *res, - GError **error); + GError **error); #endif /* MM_BROADBAND_BEARER_NOVATEL_H */ diff --git a/plugins/novatel/mm-broadband-modem-novatel.c b/plugins/novatel/mm-broadband-modem-novatel.c index 8135c306..7fbc8346 100644 --- a/plugins/novatel/mm-broadband-modem-novatel.c +++ b/plugins/novatel/mm-broadband-modem-novatel.c @@ -72,7 +72,7 @@ broadband_bearer_new_ready (GObject *source, static void modem_create_bearer (MMIfaceModem *self, - MMCommonBearerProperties *properties, + MMBearerProperties *properties, GAsyncReadyCallback callback, gpointer user_data) { diff --git a/src/mm-bearer-list.c b/src/mm-bearer-list.c index 7fee5bf8..551279fe 100644 --- a/src/mm-bearer-list.c +++ b/src/mm-bearer-list.c @@ -165,7 +165,7 @@ mm_bearer_list_foreach (MMBearerList *self, MMBearer * mm_bearer_list_find (MMBearerList *self, - MMCommonBearerProperties *properties) + MMBearerProperties *properties) { GList *l; diff --git a/src/mm-bearer-list.h b/src/mm-bearer-list.h index 6f2cf591..7cd03946 100644 --- a/src/mm-bearer-list.h +++ b/src/mm-bearer-list.h @@ -73,7 +73,7 @@ void mm_bearer_list_foreach (MMBearerList *self, gpointer user_data); MMBearer *mm_bearer_list_find (MMBearerList *self, - MMCommonBearerProperties *properties); + MMBearerProperties *properties); void mm_bearer_list_disconnect_all_bearers (MMBearerList *self, GAsyncReadyCallback callback, diff --git a/src/mm-bearer.c b/src/mm-bearer.c index 358b0265..7f92677b 100644 --- a/src/mm-bearer.c +++ b/src/mm-bearer.c @@ -630,7 +630,7 @@ mm_bearer_disconnect_force (MMBearer *self) gboolean mm_bearer_cmp_properties (MMBearer *self, - MMCommonBearerProperties *properties) + MMBearerProperties *properties) { return MM_BEARER_GET_CLASS (self)->cmp_properties (self, properties); } @@ -639,12 +639,12 @@ mm_bearer_cmp_properties (MMBearer *self, void mm_bearer_expose_properties (MMBearer *bearer, - MMCommonBearerProperties *properties) + MMBearerProperties *properties) { GVariant *dictionary; /* Keep the whole list of properties in the interface */ - dictionary = mm_common_bearer_properties_get_dictionary (properties); + dictionary = mm_bearer_properties_get_dictionary (properties); mm_gdbus_bearer_set_properties (MM_GDBUS_BEARER (bearer), dictionary); g_variant_unref (dictionary); diff --git a/src/mm-bearer.h b/src/mm-bearer.h index 161f3be4..809bf161 100644 --- a/src/mm-bearer.h +++ b/src/mm-bearer.h @@ -78,7 +78,7 @@ struct _MMBearerClass { /* Check if the bearer has the exact same properties */ gboolean (* cmp_properties) (MMBearer *self, - MMCommonBearerProperties *properties); + MMBearerProperties *properties); }; GType mm_bearer_get_type (void); @@ -87,7 +87,7 @@ void mm_bearer_export (MMBearer *self); const gchar *mm_bearer_get_path (MMBearer *bearer); void mm_bearer_expose_properties (MMBearer *bearer, - MMCommonBearerProperties *properties); + MMBearerProperties *properties); MMBearerStatus mm_bearer_get_status (MMBearer *bearer); @@ -108,6 +108,6 @@ gboolean mm_bearer_disconnect_finish (MMBearer *self, void mm_bearer_disconnect_force (MMBearer *self); gboolean mm_bearer_cmp_properties (MMBearer *self, - MMCommonBearerProperties *properties); + MMBearerProperties *properties); #endif /* MM_BEARER_H */ diff --git a/src/mm-broadband-bearer.c b/src/mm-broadband-bearer.c index de919226..f4fa1b76 100644 --- a/src/mm-broadband-bearer.c +++ b/src/mm-broadband-bearer.c @@ -1614,20 +1614,20 @@ disconnect (MMBearer *self, static gboolean cmp_properties (MMBearer *self, - MMCommonBearerProperties *properties) + MMBearerProperties *properties) { MMBroadbandBearer *broadband = MM_BROADBAND_BEARER (self); return ((!g_strcmp0 (broadband->priv->apn, - mm_common_bearer_properties_get_apn (properties))) && + mm_bearer_properties_get_apn (properties))) && (!g_strcmp0 (broadband->priv->ip_type, - mm_common_bearer_properties_get_ip_type (properties))) && + mm_bearer_properties_get_ip_type (properties))) && (broadband->priv->allow_roaming == - mm_common_bearer_properties_get_allow_roaming (properties)) && + mm_bearer_properties_get_allow_roaming (properties)) && (!g_strcmp0 (broadband->priv->number, - mm_common_bearer_properties_get_number (properties))) && + mm_bearer_properties_get_number (properties))) && (broadband->priv->rm_protocol == - mm_common_bearer_properties_get_rm_protocol (properties))); + mm_bearer_properties_get_rm_protocol (properties))); } /*****************************************************************************/ @@ -1843,15 +1843,15 @@ interface_initialization_step (InitAsyncContext *ctx) ctx->step++; case INITIALIZATION_STEP_EXPOSE_PROPERTIES: { - MMCommonBearerProperties *properties; + MMBearerProperties *properties; /* We create a new properties object just with the stuff we really used */ - properties = mm_common_bearer_properties_new (); - mm_common_bearer_properties_set_apn (properties, ctx->self->priv->apn); - mm_common_bearer_properties_set_number (properties, ctx->self->priv->number); - mm_common_bearer_properties_set_rm_protocol (properties, ctx->self->priv->rm_protocol); - mm_common_bearer_properties_set_ip_type (properties, ctx->self->priv->ip_type); - mm_common_bearer_properties_set_allow_roaming (properties, ctx->self->priv->allow_roaming); + properties = mm_bearer_properties_new (); + mm_bearer_properties_set_apn (properties, ctx->self->priv->apn); + mm_bearer_properties_set_number (properties, ctx->self->priv->number); + mm_bearer_properties_set_rm_protocol (properties, ctx->self->priv->rm_protocol); + mm_bearer_properties_set_ip_type (properties, ctx->self->priv->ip_type); + mm_bearer_properties_set_allow_roaming (properties, ctx->self->priv->allow_roaming); mm_bearer_expose_properties (MM_BEARER (ctx->self), properties); g_object_unref (properties); @@ -1931,7 +1931,7 @@ initable_init_async (GAsyncInitable *initable, void mm_broadband_bearer_new (MMBroadbandModem *modem, - MMCommonBearerProperties *properties, + MMBearerProperties *properties, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) @@ -1943,11 +1943,11 @@ mm_broadband_bearer_new (MMBroadbandModem *modem, callback, user_data, MM_BEARER_MODEM, modem, - MM_BROADBAND_BEARER_3GPP_APN, mm_common_bearer_properties_get_apn (properties), - MM_BROADBAND_BEARER_CDMA_NUMBER, mm_common_bearer_properties_get_number (properties), - MM_BROADBAND_BEARER_CDMA_RM_PROTOCOL, mm_common_bearer_properties_get_rm_protocol (properties), - MM_BROADBAND_BEARER_IP_TYPE, mm_common_bearer_properties_get_ip_type (properties), - MM_BROADBAND_BEARER_ALLOW_ROAMING, mm_common_bearer_properties_get_allow_roaming (properties), + MM_BROADBAND_BEARER_3GPP_APN, mm_bearer_properties_get_apn (properties), + MM_BROADBAND_BEARER_CDMA_NUMBER, mm_bearer_properties_get_number (properties), + MM_BROADBAND_BEARER_CDMA_RM_PROTOCOL, mm_bearer_properties_get_rm_protocol (properties), + MM_BROADBAND_BEARER_IP_TYPE, mm_bearer_properties_get_ip_type (properties), + MM_BROADBAND_BEARER_ALLOW_ROAMING, mm_bearer_properties_get_allow_roaming (properties), NULL); } diff --git a/src/mm-broadband-bearer.h b/src/mm-broadband-bearer.h index 0a2398b5..b78462f7 100644 --- a/src/mm-broadband-bearer.h +++ b/src/mm-broadband-bearer.h @@ -122,7 +122,7 @@ GType mm_broadband_bearer_get_type (void); /* Default 3GPP bearer creation implementation */ void mm_broadband_bearer_new (MMBroadbandModem *modem, - MMCommonBearerProperties *properties, + MMBearerProperties *properties, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index 1e8e9780..6a55096b 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -231,7 +231,7 @@ broadband_bearer_new_ready (GObject *source, static void modem_create_bearer (MMIfaceModem *self, - MMCommonBearerProperties *properties, + MMBearerProperties *properties, GAsyncReadyCallback callback, gpointer user_data) { diff --git a/src/mm-iface-modem-simple.c b/src/mm-iface-modem-simple.c index 0a6a5351..abb97d18 100644 --- a/src/mm-iface-modem-simple.c +++ b/src/mm-iface-modem-simple.c @@ -498,7 +498,7 @@ connection_step (ConnectionContext *ctx) case CONNECTION_STEP_BEARER: { MMBearerList *list = NULL; - MMCommonBearerProperties *bearer_properties; + MMBearerProperties *bearer_properties; mm_info ("Simple connect state (%d/%d): Bearer", ctx->step, CONNECTION_STEP_LAST); diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index 36f8568c..4eac0416 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -196,7 +196,7 @@ create_bearer_ready (MMIfaceModem *self, void mm_iface_modem_create_bearer (MMIfaceModem *self, - MMCommonBearerProperties *properties, + MMBearerProperties *properties, GAsyncReadyCallback callback, gpointer user_data) { @@ -270,7 +270,7 @@ handle_create_bearer_auth_ready (MMBaseModem *self, GAsyncResult *res, HandleCreateBearerContext *ctx) { - MMCommonBearerProperties *properties; + MMBearerProperties *properties; GError *error = NULL; if (!mm_base_modem_authorize_finish (self, res, &error)) { @@ -279,7 +279,7 @@ handle_create_bearer_auth_ready (MMBaseModem *self, return; } - properties = mm_common_bearer_properties_new_from_dictionary (ctx->dictionary, &error); + properties = mm_bearer_properties_new_from_dictionary (ctx->dictionary, &error); if (!properties) { g_dbus_method_invocation_take_error (ctx->invocation, error); handle_create_bearer_context_free (ctx); diff --git a/src/mm-iface-modem.h b/src/mm-iface-modem.h index e6e9d7db..0800bb31 100644 --- a/src/mm-iface-modem.h +++ b/src/mm-iface-modem.h @@ -280,7 +280,7 @@ struct _MMIfaceModem { /* Create bearer */ void (*create_bearer) (MMIfaceModem *self, - MMCommonBearerProperties *properties, + MMBearerProperties *properties, GAsyncReadyCallback callback, gpointer user_data); MMBearer * (*create_bearer_finish) (MMIfaceModem *self, @@ -395,7 +395,7 @@ gboolean mm_iface_modem_set_bands_finish (MMIfaceModem *self, /* Allow creating bearers */ void mm_iface_modem_create_bearer (MMIfaceModem *self, - MMCommonBearerProperties *properties, + MMBearerProperties *properties, GAsyncReadyCallback callback, gpointer user_data); MMBearer *mm_iface_modem_create_bearer_finish (MMIfaceModem *self, |