aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-04-02 20:25:18 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-05-06 17:12:36 +0200
commitcaeeae27219a91384fa41ac5a1e0f21e1edbaa76 (patch)
tree1f270be57c11705d796c50a7fa82837c11d10372 /src
parent1984c155ad7dc488001a01d3c65fefc8002ac836 (diff)
bearer: simplify handling of the bearer configuration
The base MMBearer object will receive the MMBearerProperties configuration, which contains every generic and plugin-specific set up. Not every configuration parameter will be used by every implementation (e.g. not every bearer needs user/password). The Bearer object will expose every configuration parameter received in its `Properties' property in the interface, even if it's not really used.
Diffstat (limited to 'src')
-rw-r--r--src/mm-bearer-list.c2
-rw-r--r--src/mm-bearer.c71
-rw-r--r--src/mm-bearer.h20
-rw-r--r--src/mm-broadband-bearer.c286
-rw-r--r--src/mm-broadband-bearer.h5
5 files changed, 90 insertions, 294 deletions
diff --git a/src/mm-bearer-list.c b/src/mm-bearer-list.c
index 551279fe..3c672f89 100644
--- a/src/mm-bearer-list.c
+++ b/src/mm-bearer-list.c
@@ -170,7 +170,7 @@ mm_bearer_list_find (MMBearerList *self,
GList *l;
for (l = self->priv->bearers; l; l = g_list_next (l)) {
- if (mm_bearer_cmp_properties (MM_BEARER (l->data), properties))
+ if (mm_bearer_properties_cmp (mm_bearer_peek_config (MM_BEARER (l->data)), properties))
return g_object_ref (l->data);
}
diff --git a/src/mm-bearer.c b/src/mm-bearer.c
index c0b8c332..3cce9483 100644
--- a/src/mm-bearer.c
+++ b/src/mm-bearer.c
@@ -45,6 +45,7 @@ enum {
PROP_CONNECTION,
PROP_MODEM,
PROP_STATUS,
+ PROP_CONFIG,
PROP_LAST
};
@@ -59,6 +60,8 @@ struct _MMBearerPrivate {
gchar *path;
/* Status of this bearer */
MMBearerStatus status;
+ /* Configuration of the bearer */
+ MMBearerProperties *config;
/* Cancellable for connect() */
GCancellable *connect_cancellable;
@@ -68,28 +71,12 @@ struct _MMBearerPrivate {
/*****************************************************************************/
-static void
-bearer_expose_properties (MMBearer *self)
-{
- MMBearerProperties *properties;
- GVariant *dictionary;
-
- properties = MM_BEARER_GET_CLASS (self)->expose_properties (self);
- dictionary = mm_bearer_properties_get_dictionary (properties);
- mm_gdbus_bearer_set_properties (MM_GDBUS_BEARER (self), dictionary);
- g_variant_unref (dictionary);
- g_object_unref (properties);
-}
-
void
mm_bearer_export (MMBearer *self)
{
static guint id = 0;
gchar *path;
- /* Expose properties before exporting */
- bearer_expose_properties (self);
-
path = g_strdup_printf (MM_DBUS_BEARER_PREFIX "/%d", id++);
g_object_set (self,
MM_BEARER_PATH, path,
@@ -625,6 +612,20 @@ mm_bearer_get_path (MMBearer *self)
return self->priv->path;
}
+MMBearerProperties *
+mm_bearer_peek_config (MMBearer *self)
+{
+ return self->priv->config;
+}
+
+MMBearerProperties *
+mm_bearer_get_config (MMBearer *self)
+{
+ return (self->priv->config ?
+ g_object_ref (self->priv->config) :
+ NULL);
+}
+
/*****************************************************************************/
static void
@@ -685,17 +686,6 @@ mm_bearer_report_disconnection (MMBearer *self)
return MM_BEARER_GET_CLASS (self)->report_disconnection (self);
}
-/*****************************************************************************/
-
-gboolean
-mm_bearer_cmp_properties (MMBearer *self,
- MMBearerProperties *properties)
-{
- return MM_BEARER_GET_CLASS (self)->cmp_properties (self, properties);
-}
-
-/*****************************************************************************/
-
static void
set_property (GObject *object,
guint prop_id,
@@ -738,6 +728,18 @@ set_property (GObject *object,
/* We don't allow g_object_set()-ing the status property */
g_assert_not_reached ();
break;
+ case PROP_CONFIG: {
+ GVariant *dictionary;
+
+ g_clear_object (&self->priv->config);
+ self->priv->config = g_value_dup_object (value);
+ /* Also expose the properties */
+ dictionary = mm_bearer_properties_get_dictionary (self->priv->config);
+ mm_gdbus_bearer_set_properties (MM_GDBUS_BEARER (self), dictionary);
+ if (dictionary)
+ g_variant_unref (dictionary);
+ break;
+ }
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -765,6 +767,9 @@ get_property (GObject *object,
case PROP_STATUS:
g_value_set_enum (value, self->priv->status);
break;
+ case PROP_CONFIG:
+ g_value_set_object (value, self->priv->config);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -812,8 +817,8 @@ dispose (GObject *object)
g_clear_object (&self->priv->connection);
}
- if (self->priv->modem)
- g_clear_object (&self->priv->modem);
+ g_clear_object (&self->priv->modem);
+ g_clear_object (&self->priv->config);
G_OBJECT_CLASS (mm_bearer_parent_class)->dispose (object);
}
@@ -865,4 +870,12 @@ mm_bearer_class_init (MMBearerClass *klass)
MM_BEARER_STATUS_DISCONNECTED,
G_PARAM_READABLE);
g_object_class_install_property (object_class, PROP_STATUS, properties[PROP_STATUS]);
+
+ properties[PROP_CONFIG] =
+ g_param_spec_object (MM_BEARER_CONFIG,
+ "Bearer configuration",
+ "List of user provided properties",
+ MM_TYPE_BEARER_PROPERTIES,
+ G_PARAM_READWRITE);
+ g_object_class_install_property (object_class, PROP_CONFIG, properties[PROP_CONFIG]);
}
diff --git a/src/mm-bearer.h b/src/mm-bearer.h
index 6f35e2d7..1791b356 100644
--- a/src/mm-bearer.h
+++ b/src/mm-bearer.h
@@ -40,6 +40,7 @@ typedef struct _MMBearerPrivate MMBearerPrivate;
#define MM_BEARER_CONNECTION "bearer-connection"
#define MM_BEARER_MODEM "bearer-modem"
#define MM_BEARER_STATUS "bearer-status"
+#define MM_BEARER_CONFIG "bearer-config"
typedef enum { /*< underscore_name=mm_bearer_status >*/
MM_BEARER_STATUS_DISCONNECTED,
@@ -78,25 +79,17 @@ struct _MMBearerClass {
/* Report disconnection */
void (* report_disconnection) (MMBearer *bearer);
-
- /* Check if the bearer has the exact same properties */
- gboolean (* cmp_properties) (MMBearer *self,
- MMBearerProperties *properties);
-
- /* Builder of the properties to be exposed in DBus. Bearers should expose only
- * the input properties they actually ended up using */
- MMBearerProperties * (* expose_properties) (MMBearer *self);
};
GType mm_bearer_get_type (void);
void mm_bearer_export (MMBearer *self);
-const gchar *mm_bearer_get_path (MMBearer *bearer);
-void mm_bearer_expose_properties (MMBearer *bearer,
- MMBearerProperties *properties);
+const gchar *mm_bearer_get_path (MMBearer *bearer);
+MMBearerStatus mm_bearer_get_status (MMBearer *bearer);
+MMBearerProperties *mm_bearer_peek_config (MMBearer *self);
+MMBearerProperties *mm_bearer_get_config (MMBearer *self);
-MMBearerStatus mm_bearer_get_status (MMBearer *bearer);
void mm_bearer_connect (MMBearer *self,
GAsyncReadyCallback callback,
@@ -116,7 +109,4 @@ void mm_bearer_disconnect_force (MMBearer *self);
void mm_bearer_report_disconnection (MMBearer *self);
-gboolean mm_bearer_cmp_properties (MMBearer *self,
- MMBearerProperties *properties);
-
#endif /* MM_BEARER_H */
diff --git a/src/mm-broadband-bearer.c b/src/mm-broadband-bearer.c
index a90360b9..e7af2772 100644
--- a/src/mm-broadband-bearer.c
+++ b/src/mm-broadband-bearer.c
@@ -53,24 +53,8 @@ typedef enum {
CONNECTION_TYPE_CDMA,
} ConnectionType;
-enum {
- PROP_0,
- PROP_3GPP_APN,
- PROP_CDMA_NUMBER,
- PROP_CDMA_RM_PROTOCOL,
- PROP_IP_TYPE,
- PROP_ALLOW_ROAMING,
- PROP_LAST
-};
-
-static GParamSpec *properties[PROP_LAST];
-
struct _MMBroadbandBearerPrivate {
/*-- Common stuff --*/
- /* IP type */
- gchar *ip_type;
- /* Flag to allow/forbid connections while roaming */
- gboolean allow_roaming;
/* Data port used when modem is connected */
MMPort *port;
/* Current connection type */
@@ -81,8 +65,6 @@ struct _MMBroadbandBearerPrivate {
ConnectionForbiddenReason reason_3gpp;
/* Handler ID for the registration state change signals */
guint id_3gpp_registration_change;
- /* APN of the PDP context */
- gchar *apn;
/* CID of the PDP context */
guint cid;
@@ -92,10 +74,6 @@ struct _MMBroadbandBearerPrivate {
/* Handler IDs for the registration state change signals */
guint id_cdma1x_registration_change;
guint id_evdo_registration_change;
- /* (Optional) Number to dial */
- gchar *number;
- /* Protocol of the Rm interface */
- MMModemCdmaRmProtocol rm_protocol;
};
/*****************************************************************************/
@@ -107,38 +85,6 @@ static const gchar *connection_forbidden_reason_str [CONNECTION_FORBIDDEN_REASON
};
/*****************************************************************************/
-
-const gchar *
-mm_broadband_bearer_get_3gpp_apn (MMBroadbandBearer *self)
-{
- return self->priv->apn;
-}
-
-MMModemCdmaRmProtocol
-mm_broadband_bearer_get_cdma_rm_protocol (MMBroadbandBearer *self)
-{
- return self->priv->rm_protocol;
-}
-
-const gchar *
-mm_broadband_bearer_get_ip_type (MMBroadbandBearer *self)
-{
- return self->priv->ip_type;
-}
-
-gboolean
-mm_broadband_bearer_get_allow_roaming (MMBroadbandBearer *self)
-{
- return self->priv->allow_roaming;
-}
-
-guint
-mm_broadband_bearer_get_3gpp_cid (MMBroadbandBearer *self)
-{
- return self->priv->cid;
-}
-
-/*****************************************************************************/
/* Detailed connect result, used in both CDMA and 3GPP sequences */
typedef struct {
MMBearerIpConfig *ipv4_config;
@@ -328,12 +274,15 @@ static void
cdma_connect_context_dial (DetailedConnectContext *ctx)
{
gchar *command;
+ const gchar *number;
+
+ number = mm_bearer_properties_get_number (mm_bearer_peek_config (MM_BEARER (ctx->self)));
/* If a number was given when creating the bearer, use that one.
* Otherwise, use the default one, #777
*/
- if (ctx->self->priv->number)
- command = g_strconcat ("DT", ctx->self->priv->number, NULL);
+ if (number)
+ command = g_strconcat ("DT", number, NULL);
else
command = g_strdup ("DT#777");
@@ -405,14 +354,14 @@ current_rm_protocol_ready (MMBaseModem *self,
return;
}
- if (current_rm != ctx->self->priv->rm_protocol) {
+ if (current_rm != mm_bearer_properties_get_rm_protocol (mm_bearer_peek_config (MM_BEARER (self)))) {
guint new_index;
gchar *command;
mm_dbg ("Setting requested RM protocol...");
new_index = (mm_cdma_get_index_from_rm_protocol (
- ctx->self->priv->rm_protocol,
+ mm_bearer_properties_get_rm_protocol (mm_bearer_peek_config (MM_BEARER (self))),
&error));
if (error) {
mm_warn ("Cannot set RM protocol: '%s'",
@@ -462,7 +411,9 @@ connect_cdma (MMBroadbandBearer *self,
callback,
user_data);
- if (self->priv->rm_protocol != MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN) {
+ if (mm_bearer_properties_get_rm_protocol (
+ mm_bearer_peek_config (MM_BEARER (self))) !=
+ MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN) {
/* Need to query current RM protocol */
mm_dbg ("Querying current RM protocol set...");
mm_base_modem_at_command_full (ctx->modem,
@@ -754,7 +705,7 @@ dial_3gpp_ready (MMBroadbandModem *modem,
}
static void
-initialize_pdp_context_ready (MMBaseModem *self,
+initialize_pdp_context_ready (MMBaseModem *modem,
GAsyncResult *res,
DetailedConnectContext *ctx)
{
@@ -764,7 +715,7 @@ initialize_pdp_context_ready (MMBaseModem *self,
if (detailed_connect_context_complete_and_free_if_cancelled (ctx))
return;
- mm_base_modem_at_command_full_finish (self, res, &error);
+ mm_base_modem_at_command_full_finish (modem, res, &error);
if (error) {
mm_warn ("Couldn't initialize PDP context with our APN: '%s'",
error->message);
@@ -783,7 +734,7 @@ initialize_pdp_context_ready (MMBaseModem *self,
}
static void
-find_cid_ready (MMBaseModem *self,
+find_cid_ready (MMBaseModem *modem,
GAsyncResult *res,
DetailedConnectContext *ctx)
{
@@ -791,7 +742,7 @@ find_cid_ready (MMBaseModem *self,
gchar *command;
GError *error = NULL;
- result = mm_base_modem_at_sequence_full_finish (self, res, NULL, &error);
+ result = mm_base_modem_at_sequence_full_finish (modem, res, NULL, &error);
if (!result) {
mm_warn ("Couldn't find best CID to use: '%s'", error->message);
g_simple_async_result_take_error (ctx->result, error);
@@ -809,7 +760,7 @@ find_cid_ready (MMBaseModem *self,
ctx->cid = g_variant_get_uint32 (result);
command = g_strdup_printf ("+CGDCONT=%u,\"IP\",\"%s\"",
ctx->cid,
- ctx->self->priv->apn);
+ mm_bearer_properties_get_apn (mm_bearer_peek_config (MM_BEARER (ctx->self))));
mm_base_modem_at_command_full (ctx->modem,
ctx->primary,
command,
@@ -822,7 +773,7 @@ find_cid_ready (MMBaseModem *self,
}
static gboolean
-parse_cid_range (MMBaseModem *self,
+parse_cid_range (MMBaseModem *modem,
DetailedConnectContext *ctx,
const gchar *command,
const gchar *response,
@@ -907,7 +858,7 @@ parse_cid_range (MMBaseModem *self,
}
static gboolean
-parse_pdp_list (MMBaseModem *self,
+parse_pdp_list (MMBaseModem *modem,
DetailedConnectContext *ctx,
const gchar *command,
const gchar *response,
@@ -960,14 +911,19 @@ parse_pdp_list (MMBaseModem *self,
mm_dbg ("Found PDP context with CID %u and no APN",
pdp->cid);
cid = pdp->cid;
- } else if (ctx->self->priv->apn &&
- g_str_equal (pdp->apn, ctx->self->priv->apn)) {
- /* Found a PDP context with the same CID, we'll use it. */
- mm_dbg ("Found PDP context with CID %u for APN '%s'",
- pdp->cid, pdp->apn);
- cid = pdp->cid;
- /* In this case, stop searching */
- break;
+ } else {
+ const gchar *apn;
+
+ apn = mm_bearer_properties_get_apn (mm_bearer_peek_config (MM_BEARER (ctx->self)));
+ if (apn &&
+ g_str_equal (pdp->apn, apn)) {
+ /* Found a PDP context with the same CID, we'll use it. */
+ mm_dbg ("Found PDP context with CID %u for APN '%s'",
+ pdp->cid, pdp->apn);
+ cid = pdp->cid;
+ /* In this case, stop searching */
+ break;
+ }
}
}
@@ -1767,41 +1723,6 @@ report_disconnection (MMBearer *self)
/*****************************************************************************/
-static gboolean
-cmp_properties (MMBearer *self,
- MMBearerProperties *properties)
-{
- MMBroadbandBearer *broadband = MM_BROADBAND_BEARER (self);
-
- return ((!g_strcmp0 (broadband->priv->apn,
- mm_bearer_properties_get_apn (properties))) &&
- (!g_strcmp0 (broadband->priv->ip_type,
- mm_bearer_properties_get_ip_type (properties))) &&
- (broadband->priv->allow_roaming ==
- mm_bearer_properties_get_allow_roaming (properties)) &&
- (!g_strcmp0 (broadband->priv->number,
- mm_bearer_properties_get_number (properties))) &&
- (broadband->priv->rm_protocol ==
- mm_bearer_properties_get_rm_protocol (properties)));
-}
-
-static MMBearerProperties *
-expose_properties (MMBearer *self)
-{
- MMBroadbandBearer *broadband = MM_BROADBAND_BEARER (self);
- MMBearerProperties *properties;
-
- properties = mm_bearer_properties_new ();
- mm_bearer_properties_set_apn (properties, broadband->priv->apn);
- mm_bearer_properties_set_number (properties, broadband->priv->number);
- mm_bearer_properties_set_rm_protocol (properties, broadband->priv->rm_protocol);
- mm_bearer_properties_set_ip_type (properties, broadband->priv->ip_type);
- mm_bearer_properties_set_allow_roaming (properties, broadband->priv->allow_roaming);
- return properties;
-}
-
-/*****************************************************************************/
-
typedef struct _InitAsyncContext InitAsyncContext;
static void interface_initialization_step (InitAsyncContext *ctx);
@@ -1885,9 +1806,12 @@ crm_range_ready (MMBaseModem *modem,
if (mm_cdma_parse_crm_test_response (response,
&min, &max,
&error)) {
+ MMModemCdmaRmProtocol current;
+
+ current = mm_bearer_properties_get_rm_protocol (mm_bearer_peek_config (MM_BEARER (ctx->self)));
/* Check if value within the range */
- if (ctx->self->priv->rm_protocol >= min &&
- ctx->self->priv->rm_protocol <= max) {
+ if (current >= min &&
+ current <= max) {
/* Fine, go on with next step */
ctx->step++;
interface_initialization_step (ctx);
@@ -1897,8 +1821,7 @@ crm_range_ready (MMBaseModem *modem,
error = g_error_new (MM_CORE_ERROR,
MM_CORE_ERROR_FAILED,
"Requested RM protocol '%s' is not supported",
- mm_modem_cdma_rm_protocol_get_string (
- ctx->self->priv->rm_protocol));
+ mm_modem_cdma_rm_protocol_get_string (current));
}
/* Failed, set as fatal as well */
@@ -1933,7 +1856,7 @@ modem_3gpp_registration_state_changed (MMBroadbandModem *modem,
self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_NONE;
break;
case MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING:
- if (self->priv->allow_roaming) {
+ if (mm_bearer_properties_get_allow_roaming (mm_bearer_peek_config (MM_BEARER (self)))) {
mm_dbg ("Bearer allowed to connect, registered in roaming network");
self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_NONE;
} else {
@@ -1964,7 +1887,7 @@ modem_cdma_registration_state_changed (MMBroadbandModem *modem,
if (cdma1x_state == MM_MODEM_CDMA_REGISTRATION_STATE_ROAMING ||
evdo_state == MM_MODEM_CDMA_REGISTRATION_STATE_ROAMING) {
- if (self->priv->allow_roaming) {
+ if (mm_bearer_properties_get_allow_roaming (mm_bearer_peek_config (MM_BEARER (self)))) {
mm_dbg ("Bearer allowed to connect, registered in roaming network");
self->priv->reason_cdma = CONNECTION_FORBIDDEN_REASON_NONE;
} else {
@@ -1998,7 +1921,8 @@ interface_initialization_step (InitAsyncContext *ctx)
/* If a specific RM protocol is given, we need to check whether it is
* supported. */
if (mm_iface_modem_is_cdma (MM_IFACE_MODEM (ctx->modem)) &&
- ctx->self->priv->rm_protocol != MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN) {
+ mm_bearer_properties_get_rm_protocol (
+ mm_bearer_peek_config (MM_BEARER (ctx->self))) != MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN) {
mm_base_modem_at_command_full (ctx->modem,
ctx->port,
"+CRM=?",
@@ -2106,79 +2030,12 @@ mm_broadband_bearer_new (MMBroadbandModem *modem,
cancellable,
callback,
user_data,
- MM_BEARER_MODEM, modem,
- 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),
+ MM_BEARER_MODEM, modem,
+ MM_BEARER_CONFIG, properties,
NULL);
}
static void
-set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- MMBroadbandBearer *self = MM_BROADBAND_BEARER (object);
-
- switch (prop_id) {
- case PROP_3GPP_APN:
- g_free (self->priv->apn);
- self->priv->apn = g_value_dup_string (value);
- break;
- case PROP_CDMA_NUMBER:
- g_free (self->priv->number);
- self->priv->number = g_value_dup_string (value);
- break;
- case PROP_CDMA_RM_PROTOCOL:
- self->priv->rm_protocol = g_value_get_enum (value);
- break;
- case PROP_IP_TYPE:
- g_free (self->priv->ip_type);
- self->priv->ip_type = g_value_dup_string (value);
- break;
- case PROP_ALLOW_ROAMING:
- self->priv->allow_roaming = g_value_get_boolean (value);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- MMBroadbandBearer *self = MM_BROADBAND_BEARER (object);
-
- switch (prop_id) {
- case PROP_3GPP_APN:
- g_value_set_string (value, self->priv->apn);
- break;
- case PROP_CDMA_NUMBER:
- g_value_set_string (value, self->priv->number);
- break;
- case PROP_CDMA_RM_PROTOCOL:
- g_value_set_enum (value, self->priv->rm_protocol);
- break;
- case PROP_IP_TYPE:
- g_value_set_string (value, self->priv->ip_type);
- break;
- case PROP_ALLOW_ROAMING:
- g_value_set_boolean (value, self->priv->allow_roaming);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
mm_broadband_bearer_init (MMBroadbandBearer *self)
{
/* Initialize private data */
@@ -2188,8 +2045,6 @@ mm_broadband_bearer_init (MMBroadbandBearer *self)
/* Set defaults */
self->priv->connection_type = CONNECTION_TYPE_NONE;
- self->priv->allow_roaming = TRUE;
- self->priv->rm_protocol = MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN;
self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_NONE;
self->priv->reason_cdma = CONNECTION_FORBIDDEN_REASON_NONE;
}
@@ -2225,17 +2080,6 @@ dispose (GObject *object)
}
static void
-finalize (GObject *object)
-{
- MMBroadbandBearer *self = MM_BROADBAND_BEARER (object);
-
- g_free (self->priv->apn);
- g_free (self->priv->ip_type);
-
- G_OBJECT_CLASS (mm_broadband_bearer_parent_class)->finalize (object);
-}
-
-static void
async_initable_iface_init (GAsyncInitableIface *iface)
{
iface->init_async = initable_init_async;
@@ -2251,13 +2095,8 @@ mm_broadband_bearer_class_init (MMBroadbandBearerClass *klass)
g_type_class_add_private (object_class, sizeof (MMBroadbandBearerPrivate));
/* Virtual methods */
- object_class->get_property = get_property;
- object_class->set_property = set_property;
- object_class->finalize = finalize;
object_class->dispose = dispose;
- bearer_class->cmp_properties = cmp_properties;
- bearer_class->expose_properties = expose_properties;
bearer_class->connect = connect;
bearer_class->connect_finish = connect_finish;
bearer_class->disconnect = disconnect;
@@ -2276,45 +2115,4 @@ mm_broadband_bearer_class_init (MMBroadbandBearerClass *klass)
klass->disconnect_3gpp_finish = detailed_disconnect_finish;
klass->disconnect_cdma = disconnect_cdma;
klass->disconnect_cdma_finish = detailed_disconnect_finish;
-
- properties[PROP_3GPP_APN] =
- g_param_spec_string (MM_BROADBAND_BEARER_3GPP_APN,
- "3GPP APN",
- "Access Point Name to use in the connection",
- NULL,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
- g_object_class_install_property (object_class, PROP_3GPP_APN, properties[PROP_3GPP_APN]);
-
- properties[PROP_CDMA_NUMBER] =
- g_param_spec_string (MM_BROADBAND_BEARER_CDMA_NUMBER,
- "Number to dial",
- "Number to dial when launching the CDMA connection",
- NULL,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
- g_object_class_install_property (object_class, PROP_CDMA_NUMBER, properties[PROP_CDMA_NUMBER]);
-
- properties[PROP_CDMA_RM_PROTOCOL] =
- g_param_spec_enum (MM_BROADBAND_BEARER_CDMA_RM_PROTOCOL,
- "Rm Protocol",
- "Protocol to use in the CDMA Rm interface",
- MM_TYPE_MODEM_CDMA_RM_PROTOCOL,
- MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
- g_object_class_install_property (object_class, PROP_CDMA_RM_PROTOCOL, properties[PROP_CDMA_RM_PROTOCOL]);
-
- properties[PROP_IP_TYPE] =
- g_param_spec_string (MM_BROADBAND_BEARER_IP_TYPE,
- "IP type",
- "IP setup to use in the connection",
- NULL,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
- g_object_class_install_property (object_class, PROP_IP_TYPE, properties[PROP_IP_TYPE]);
-
- properties[PROP_ALLOW_ROAMING] =
- g_param_spec_boolean (MM_BROADBAND_BEARER_ALLOW_ROAMING,
- "Allow roaming",
- "Whether connections are allowed when roaming",
- TRUE,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
- g_object_class_install_property (object_class, PROP_ALLOW_ROAMING, properties[PROP_ALLOW_ROAMING]);
}
diff --git a/src/mm-broadband-bearer.h b/src/mm-broadband-bearer.h
index 5911a610..00478f29 100644
--- a/src/mm-broadband-bearer.h
+++ b/src/mm-broadband-bearer.h
@@ -146,11 +146,6 @@ void mm_broadband_bearer_new (MMBroadbandModem *modem,
MMBearer *mm_broadband_bearer_new_finish (GAsyncResult *res,
GError **error);
-const gchar *mm_broadband_bearer_get_3gpp_apn (MMBroadbandBearer *self);
-guint mm_broadband_bearer_get_cdma_rm_protocol (MMBroadbandBearer *self);
-const gchar *mm_broadband_bearer_get_ip_type (MMBroadbandBearer *self);
-gboolean mm_broadband_bearer_get_allow_roaming (MMBroadbandBearer *self);
-
guint mm_broadband_bearer_get_3gpp_cid (MMBroadbandBearer *self);
#endif /* MM_BROADBAND_BEARER_H */