bearer: rename 'MMBearer' to 'MMBaseBearer'
Just so that we don't have same header names in src/ and /libmm-glib.
This commit is contained in:
@@ -229,7 +229,7 @@ connect_3gpp (MMBroadbandBearer *self,
|
||||
callback,
|
||||
user_data);
|
||||
|
||||
config = mm_bearer_peek_config (MM_BEARER (self));
|
||||
config = mm_base_bearer_peek_config (MM_BASE_BEARER (self));
|
||||
apn = mm_port_serial_at_quote_string (mm_bearer_properties_get_apn (config));
|
||||
command = g_strdup_printf ("%%APNN=%s",apn);
|
||||
g_free (apn);
|
||||
@@ -362,7 +362,7 @@ disconnect_3gpp (MMBroadbandBearer *self,
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMBearer *
|
||||
MMBaseBearer *
|
||||
mm_broadband_bearer_altair_lte_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -377,9 +377,9 @@ mm_broadband_bearer_altair_lte_new_finish (GAsyncResult *res,
|
||||
return NULL;
|
||||
|
||||
/* Only export valid bearers */
|
||||
mm_bearer_export (MM_BEARER (bearer));
|
||||
mm_base_bearer_export (MM_BASE_BEARER (bearer));
|
||||
|
||||
return MM_BEARER (bearer);
|
||||
return MM_BASE_BEARER (bearer);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -395,8 +395,8 @@ mm_broadband_bearer_altair_lte_new (MMBroadbandModemAltairLte *modem,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data,
|
||||
MM_BEARER_MODEM, modem,
|
||||
MM_BEARER_CONFIG, config,
|
||||
MM_BASE_BEARER_MODEM, modem,
|
||||
MM_BASE_BEARER_CONFIG, config,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
@@ -48,14 +48,12 @@ struct _MMBroadbandBearerAltairLteClass {
|
||||
GType mm_broadband_bearer_altair_lte_get_type (void);
|
||||
|
||||
/* Default 3GPP bearer creation implementation */
|
||||
void mm_broadband_bearer_altair_lte_new (MMBroadbandModemAltairLte *modem,
|
||||
MMBearerProperties *properties,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
MMBearer *mm_broadband_bearer_altair_lte_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
void mm_broadband_bearer_altair_lte_new (MMBroadbandModemAltairLte *modem,
|
||||
MMBearerProperties *properties,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseBearer *mm_broadband_bearer_altair_lte_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
#endif /* MM_BROADBAND_BEARER_ALTAIR_LTE_H */
|
||||
|
@@ -99,12 +99,12 @@ modem_power_down (MMIfaceModem *self,
|
||||
/*****************************************************************************/
|
||||
/* Create Bearer (Modem interface) */
|
||||
|
||||
static MMBearer *
|
||||
static MMBaseBearer *
|
||||
modem_create_bearer_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
|
||||
if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error))
|
||||
return NULL;
|
||||
@@ -119,7 +119,7 @@ broadband_bearer_new_ready (GObject *source,
|
||||
GAsyncResult *res,
|
||||
GSimpleAsyncResult *simple)
|
||||
{
|
||||
MMBearer *bearer = NULL;
|
||||
MMBaseBearer *bearer = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
bearer = mm_broadband_bearer_altair_lte_new_finish (res, &error);
|
||||
@@ -710,11 +710,11 @@ typedef enum {
|
||||
} MMStatcmAltair;
|
||||
|
||||
static void
|
||||
bearer_list_report_disconnect_status_foreach (MMBearer *bearer,
|
||||
bearer_list_report_disconnect_status_foreach (MMBaseBearer *bearer,
|
||||
gpointer *user_data)
|
||||
{
|
||||
mm_bearer_report_connection_status (bearer,
|
||||
MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
|
||||
mm_base_bearer_report_connection_status (bearer,
|
||||
MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@@ -265,12 +265,12 @@ connect_3gpp_context_step (Connect3gppContext *ctx)
|
||||
case CONNECT_3GPP_CONTEXT_STEP_FIRST: {
|
||||
MMBearerIpFamily ip_family;
|
||||
|
||||
ip_family = mm_bearer_properties_get_ip_type (mm_bearer_peek_config (MM_BEARER (ctx->self)));
|
||||
ip_family = mm_bearer_properties_get_ip_type (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
if (ip_family == MM_BEARER_IP_FAMILY_NONE ||
|
||||
ip_family == MM_BEARER_IP_FAMILY_ANY) {
|
||||
gchar *ip_family_str;
|
||||
|
||||
ip_family = mm_bearer_get_default_ip_family (MM_BEARER (ctx->self));
|
||||
ip_family = mm_base_bearer_get_default_ip_family (MM_BASE_BEARER (ctx->self));
|
||||
ip_family_str = mm_bearer_ip_family_build_string_from_mask (ip_family);
|
||||
mm_dbg ("No specific IP family requested, defaulting to %s",
|
||||
ip_family_str);
|
||||
@@ -301,10 +301,10 @@ connect_3gpp_context_step (Connect3gppContext *ctx)
|
||||
gint encoded_auth = MM_BEARER_HUAWEI_AUTH_UNKNOWN;
|
||||
gchar *command;
|
||||
|
||||
apn = mm_bearer_properties_get_apn (mm_bearer_peek_config (MM_BEARER (ctx->self)));
|
||||
user = mm_bearer_properties_get_user (mm_bearer_peek_config (MM_BEARER (ctx->self)));
|
||||
passwd = mm_bearer_properties_get_password (mm_bearer_peek_config (MM_BEARER (ctx->self)));
|
||||
auth = mm_bearer_properties_get_allowed_auth (mm_bearer_peek_config (MM_BEARER (ctx->self)));
|
||||
apn = mm_bearer_properties_get_apn (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
passwd = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
auth = mm_bearer_properties_get_allowed_auth (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
encoded_auth = huawei_parse_auth_type (auth);
|
||||
|
||||
/* Default to no authentication if not specified */
|
||||
@@ -700,16 +700,16 @@ static gboolean
|
||||
network_disconnect_3gpp_delayed (MMBroadbandBearerHuawei *self)
|
||||
{
|
||||
mm_dbg ("Disconnect bearer '%s' on network request.",
|
||||
mm_bearer_get_path (MM_BEARER (self)));
|
||||
mm_base_bearer_get_path (MM_BASE_BEARER (self)));
|
||||
|
||||
self->priv->network_disconnect_pending_id = 0;
|
||||
mm_bearer_report_connection_status (MM_BEARER (self),
|
||||
MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
|
||||
mm_base_bearer_report_connection_status (MM_BASE_BEARER (self),
|
||||
MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
report_connection_status (MMBearer *bearer,
|
||||
report_connection_status (MMBaseBearer *bearer,
|
||||
MMBearerConnectionStatus status)
|
||||
{
|
||||
MMBroadbandBearerHuawei *self = MM_BROADBAND_BEARER_HUAWEI (bearer);
|
||||
@@ -737,10 +737,10 @@ report_connection_status (MMBearer *bearer,
|
||||
/* MM_BEARER_CONNECTION_STATUS_DISCONNECTING is used to indicate that the
|
||||
* reporting of disconnection should be delayed. See MMBroadbandModemHuawei's
|
||||
* bearer_report_connection_status for details. */
|
||||
if (mm_bearer_get_status (bearer) == MM_BEARER_STATUS_CONNECTED &&
|
||||
if (mm_base_bearer_get_status (bearer) == MM_BEARER_STATUS_CONNECTED &&
|
||||
self->priv->network_disconnect_pending_id == 0) {
|
||||
mm_dbg ("Delay network-initiated disconnection of bearer '%s'",
|
||||
mm_bearer_get_path (MM_BEARER (self)));
|
||||
mm_base_bearer_get_path (MM_BASE_BEARER (self)));
|
||||
self->priv->network_disconnect_pending_id = (g_timeout_add_seconds (
|
||||
4,
|
||||
(GSourceFunc) network_disconnect_3gpp_delayed,
|
||||
@@ -750,14 +750,14 @@ report_connection_status (MMBearer *bearer,
|
||||
}
|
||||
|
||||
/* Report disconnected right away */
|
||||
MM_BEARER_CLASS (mm_broadband_bearer_huawei_parent_class)->report_connection_status (
|
||||
MM_BASE_BEARER_CLASS (mm_broadband_bearer_huawei_parent_class)->report_connection_status (
|
||||
bearer,
|
||||
MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMBearer *
|
||||
MMBaseBearer *
|
||||
mm_broadband_bearer_huawei_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -772,9 +772,9 @@ mm_broadband_bearer_huawei_new_finish (GAsyncResult *res,
|
||||
return NULL;
|
||||
|
||||
/* Only export valid bearers */
|
||||
mm_bearer_export (MM_BEARER (bearer));
|
||||
mm_base_bearer_export (MM_BASE_BEARER (bearer));
|
||||
|
||||
return MM_BEARER (bearer);
|
||||
return MM_BASE_BEARER (bearer);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -803,8 +803,8 @@ mm_broadband_bearer_huawei_new (MMBroadbandModemHuawei *modem,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data,
|
||||
MM_BEARER_MODEM, modem,
|
||||
MM_BEARER_CONFIG, config,
|
||||
MM_BASE_BEARER_MODEM, modem,
|
||||
MM_BASE_BEARER_CONFIG, config,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -821,13 +821,13 @@ static void
|
||||
mm_broadband_bearer_huawei_class_init (MMBroadbandBearerHuaweiClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
MMBearerClass *bearer_class = MM_BEARER_CLASS (klass);
|
||||
MMBaseBearerClass *base_bearer_class = MM_BASE_BEARER_CLASS (klass);
|
||||
MMBroadbandBearerClass *broadband_bearer_class = MM_BROADBAND_BEARER_CLASS (klass);
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (MMBroadbandBearerHuaweiPrivate));
|
||||
|
||||
object_class->dispose = dispose;
|
||||
bearer_class->report_connection_status = report_connection_status;
|
||||
base_bearer_class->report_connection_status = report_connection_status;
|
||||
broadband_bearer_class->connect_3gpp = connect_3gpp;
|
||||
broadband_bearer_class->connect_3gpp_finish = connect_3gpp_finish;
|
||||
broadband_bearer_class->disconnect_3gpp = disconnect_3gpp;
|
||||
|
@@ -48,12 +48,12 @@ struct _MMBroadbandBearerHuaweiClass {
|
||||
|
||||
GType mm_broadband_bearer_huawei_get_type (void);
|
||||
|
||||
void mm_broadband_bearer_huawei_new (MMBroadbandModemHuawei *modem,
|
||||
MMBearerProperties *config,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBearer *mm_broadband_bearer_huawei_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_broadband_bearer_huawei_new (MMBroadbandModemHuawei *modem,
|
||||
MMBearerProperties *config,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseBearer *mm_broadband_bearer_huawei_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
#endif /* MM_BROADBAND_BEARER_HUAWEI_H */
|
||||
|
@@ -1656,7 +1656,7 @@ typedef struct {
|
||||
} NdisstatResult;
|
||||
|
||||
static void
|
||||
bearer_report_connection_status (MMBearer *bearer,
|
||||
bearer_report_connection_status (MMBaseBearer *bearer,
|
||||
NdisstatResult *ndisstat_result)
|
||||
{
|
||||
if (ndisstat_result->ipv4_available) {
|
||||
@@ -1665,10 +1665,10 @@ bearer_report_connection_status (MMBearer *bearer,
|
||||
*
|
||||
* Also, send DISCONNECTING so that we give some time before actually
|
||||
* disconnecting the connection */
|
||||
mm_bearer_report_connection_status (bearer,
|
||||
ndisstat_result->ipv4_connected ?
|
||||
MM_BEARER_CONNECTION_STATUS_CONNECTED :
|
||||
MM_BEARER_CONNECTION_STATUS_DISCONNECTING);
|
||||
mm_base_bearer_report_connection_status (bearer,
|
||||
ndisstat_result->ipv4_connected ?
|
||||
MM_BEARER_CONNECTION_STATUS_CONNECTED :
|
||||
MM_BEARER_CONNECTION_STATUS_DISCONNECTING);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2059,18 +2059,18 @@ create_bearer_context_complete_and_free (CreateBearerContext *ctx)
|
||||
g_slice_free (CreateBearerContext, ctx);
|
||||
}
|
||||
|
||||
static MMBearer *
|
||||
static MMBaseBearer *
|
||||
huawei_modem_create_bearer_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
|
||||
if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error))
|
||||
return NULL;
|
||||
|
||||
bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res));
|
||||
mm_dbg ("New huawei bearer created at DBus path '%s'", mm_bearer_get_path (bearer));
|
||||
mm_dbg ("New huawei bearer created at DBus path '%s'", mm_base_bearer_get_path (bearer));
|
||||
return g_object_ref (bearer);
|
||||
}
|
||||
|
||||
@@ -2079,7 +2079,7 @@ broadband_bearer_huawei_new_ready (GObject *source,
|
||||
GAsyncResult *res,
|
||||
CreateBearerContext *ctx)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
GError *error = NULL;
|
||||
|
||||
bearer = mm_broadband_bearer_huawei_new_finish (res, &error);
|
||||
@@ -2095,7 +2095,7 @@ broadband_bearer_new_ready (GObject *source,
|
||||
GAsyncResult *res,
|
||||
CreateBearerContext *ctx)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
GError *error = NULL;
|
||||
|
||||
bearer = mm_broadband_bearer_new_finish (res, &error);
|
||||
|
@@ -576,8 +576,8 @@ forced_close_cb (MMPortSerial *port,
|
||||
MMBroadbandBearerIcera *self)
|
||||
{
|
||||
/* Just treat the forced close event as any other unsolicited message */
|
||||
mm_bearer_report_connection_status (MM_BEARER (self),
|
||||
MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED);
|
||||
mm_base_bearer_report_connection_status (MM_BASE_BEARER (self),
|
||||
MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -855,9 +855,9 @@ authenticate (Dial3gppContext *ctx)
|
||||
const gchar *password;
|
||||
MMBearerAllowedAuth allowed_auth;
|
||||
|
||||
user = mm_bearer_properties_get_user (mm_bearer_peek_config (MM_BEARER (ctx->self)));
|
||||
password = mm_bearer_properties_get_password (mm_bearer_peek_config (MM_BEARER (ctx->self)));
|
||||
allowed_auth = mm_bearer_properties_get_allowed_auth (mm_bearer_peek_config (MM_BEARER (ctx->self)));
|
||||
user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
password = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
allowed_auth = mm_bearer_properties_get_allowed_auth (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
|
||||
/* Both user and password are required; otherwise firmware returns an error */
|
||||
if (!user || !password || allowed_auth == MM_BEARER_ALLOWED_AUTH_NONE) {
|
||||
@@ -954,7 +954,7 @@ dial_3gpp (MMBroadbandBearer *self,
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
report_connection_status (MMBearer *bearer,
|
||||
report_connection_status (MMBaseBearer *bearer,
|
||||
MMBearerConnectionStatus status)
|
||||
{
|
||||
MMBroadbandBearerIcera *self = MM_BROADBAND_BEARER_ICERA (bearer);
|
||||
@@ -979,7 +979,7 @@ report_connection_status (MMBearer *bearer,
|
||||
status == MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED) {
|
||||
/* If no connection/disconnection attempt on-going, make sure we mark ourselves as
|
||||
* disconnected. Make sure we only pass 'DISCONNECTED' to the parent */
|
||||
MM_BEARER_CLASS (mm_broadband_bearer_icera_parent_class)->report_connection_status (
|
||||
MM_BASE_BEARER_CLASS (mm_broadband_bearer_icera_parent_class)->report_connection_status (
|
||||
bearer,
|
||||
MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
|
||||
}
|
||||
@@ -987,7 +987,7 @@ report_connection_status (MMBearer *bearer,
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMBearer *
|
||||
MMBaseBearer *
|
||||
mm_broadband_bearer_icera_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -1002,9 +1002,9 @@ mm_broadband_bearer_icera_new_finish (GAsyncResult *res,
|
||||
return NULL;
|
||||
|
||||
/* Only export valid bearers */
|
||||
mm_bearer_export (MM_BEARER (bearer));
|
||||
mm_base_bearer_export (MM_BASE_BEARER (bearer));
|
||||
|
||||
return MM_BEARER (bearer);
|
||||
return MM_BASE_BEARER (bearer);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1021,8 +1021,8 @@ mm_broadband_bearer_icera_new (MMBroadbandModem *modem,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data,
|
||||
MM_BEARER_MODEM, modem,
|
||||
MM_BEARER_CONFIG, config,
|
||||
MM_BASE_BEARER_MODEM, modem,
|
||||
MM_BASE_BEARER_CONFIG, config,
|
||||
MM_BROADBAND_BEARER_ICERA_DEFAULT_IP_METHOD, ip_method,
|
||||
NULL);
|
||||
}
|
||||
@@ -1079,14 +1079,14 @@ static void
|
||||
mm_broadband_bearer_icera_class_init (MMBroadbandBearerIceraClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
MMBearerClass *bearer_class = MM_BEARER_CLASS (klass);
|
||||
MMBaseBearerClass *base_bearer_class = MM_BASE_BEARER_CLASS (klass);
|
||||
MMBroadbandBearerClass *broadband_bearer_class = MM_BROADBAND_BEARER_CLASS (klass);
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (MMBroadbandBearerIceraPrivate));
|
||||
|
||||
object_class->get_property = get_property;
|
||||
object_class->set_property = set_property;
|
||||
bearer_class->report_connection_status = report_connection_status;
|
||||
base_bearer_class->report_connection_status = report_connection_status;
|
||||
broadband_bearer_class->dial_3gpp = dial_3gpp;
|
||||
broadband_bearer_class->dial_3gpp_finish = dial_3gpp_finish;
|
||||
broadband_bearer_class->get_ip_config_3gpp = get_ip_config_3gpp;
|
||||
|
@@ -52,13 +52,13 @@ struct _MMBroadbandBearerIceraClass {
|
||||
GType mm_broadband_bearer_icera_get_type (void);
|
||||
|
||||
/* Default bearer creation implementation */
|
||||
void mm_broadband_bearer_icera_new (MMBroadbandModem *modem,
|
||||
MMBearerIpMethod ip_method,
|
||||
MMBearerProperties *config,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBearer *mm_broadband_bearer_icera_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_broadband_bearer_icera_new (MMBroadbandModem *modem,
|
||||
MMBearerIpMethod ip_method,
|
||||
MMBearerProperties *config,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseBearer *mm_broadband_bearer_icera_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
#endif /* MM_BROADBAND_BEARER_ICERA_H */
|
||||
|
@@ -401,7 +401,7 @@ typedef struct {
|
||||
} BearerListReportStatusForeachContext;
|
||||
|
||||
static void
|
||||
bearer_list_report_status_foreach (MMBearer *bearer,
|
||||
bearer_list_report_status_foreach (MMBaseBearer *bearer,
|
||||
BearerListReportStatusForeachContext *ctx)
|
||||
{
|
||||
if (mm_broadband_bearer_get_3gpp_cid (MM_BROADBAND_BEARER (bearer)) != ctx->cid)
|
||||
@@ -410,7 +410,7 @@ bearer_list_report_status_foreach (MMBearer *bearer,
|
||||
if (!MM_IS_BROADBAND_BEARER_ICERA (bearer))
|
||||
return;
|
||||
|
||||
mm_bearer_report_connection_status (bearer, ctx->status);
|
||||
mm_base_bearer_report_connection_status (bearer, ctx->status);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -856,7 +856,7 @@ modem_3gpp_disable_unsolicited_events (MMIfaceModem3gpp *self,
|
||||
/*****************************************************************************/
|
||||
/* Create bearer (Modem interface) */
|
||||
|
||||
static MMBearer *
|
||||
static MMBaseBearer *
|
||||
modem_create_bearer_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
@@ -864,9 +864,9 @@ modem_create_bearer_finish (MMIfaceModem *self,
|
||||
if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error))
|
||||
return NULL;
|
||||
|
||||
return MM_BEARER (g_object_ref (
|
||||
g_simple_async_result_get_op_res_gpointer (
|
||||
G_SIMPLE_ASYNC_RESULT (res))));
|
||||
return MM_BASE_BEARER (g_object_ref (
|
||||
g_simple_async_result_get_op_res_gpointer (
|
||||
G_SIMPLE_ASYNC_RESULT (res))));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -874,7 +874,7 @@ broadband_bearer_icera_new_ready (GObject *source,
|
||||
GAsyncResult *res,
|
||||
GSimpleAsyncResult *simple)
|
||||
{
|
||||
MMBearer *bearer = NULL;
|
||||
MMBaseBearer *bearer = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
bearer = mm_broadband_bearer_icera_new_finish (res, &error);
|
||||
@@ -893,7 +893,7 @@ broadband_bearer_new_ready (GObject *source,
|
||||
GAsyncResult *res,
|
||||
GSimpleAsyncResult *simple)
|
||||
{
|
||||
MMBearer *bearer = NULL;
|
||||
MMBaseBearer *bearer = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
bearer = mm_broadband_bearer_new_finish (res, &error);
|
||||
|
@@ -29,9 +29,9 @@
|
||||
#include "mm-log.h"
|
||||
|
||||
/* Allow up to 200s to get a proper IP connection */
|
||||
#define MM_BEARER_IRIDIUM_IP_TIMEOUT_DEFAULT 200
|
||||
#define BEARER_IRIDIUM_IP_TIMEOUT_DEFAULT 200
|
||||
|
||||
G_DEFINE_TYPE (MMBearerIridium, mm_bearer_iridium, MM_TYPE_BEARER);
|
||||
G_DEFINE_TYPE (MMBearerIridium, mm_bearer_iridium, MM_TYPE_BASE_BEARER);
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Connect */
|
||||
@@ -59,7 +59,7 @@ connect_context_complete_and_free (ConnectContext *ctx)
|
||||
}
|
||||
|
||||
static MMBearerConnectResult *
|
||||
connect_finish (MMBearer *self,
|
||||
connect_finish (MMBaseBearer *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -192,7 +192,7 @@ service_type_ready (MMBaseModem *modem,
|
||||
}
|
||||
|
||||
static void
|
||||
connect (MMBearer *self,
|
||||
connect (MMBaseBearer *self,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
@@ -201,7 +201,7 @@ connect (MMBearer *self,
|
||||
MMBaseModem *modem = NULL;
|
||||
|
||||
g_object_get (self,
|
||||
MM_BEARER_MODEM, &modem,
|
||||
MM_BASE_BEARER_MODEM, &modem,
|
||||
NULL);
|
||||
g_assert (modem);
|
||||
|
||||
@@ -236,23 +236,23 @@ connect (MMBearer *self,
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMBearer *
|
||||
MMBaseBearer *
|
||||
mm_bearer_iridium_new (MMBroadbandModemIridium *modem,
|
||||
MMBearerProperties *config)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
|
||||
/* The Iridium bearer inherits from MMBearer (so it's not a MMBroadbandBearer)
|
||||
/* The Iridium bearer inherits from MMBaseBearer (so it's not a MMBroadbandBearer)
|
||||
* and that means that the object is not async-initable, so we just use
|
||||
* g_object_get() here */
|
||||
bearer = g_object_new (MM_TYPE_BEARER_IRIDIUM,
|
||||
MM_BEARER_MODEM, modem,
|
||||
MM_BEARER_CONFIG, config,
|
||||
"ip-timeout", MM_BEARER_IRIDIUM_IP_TIMEOUT_DEFAULT,
|
||||
MM_BASE_BEARER_MODEM, modem,
|
||||
MM_BASE_BEARER_CONFIG, config,
|
||||
"ip-timeout", BEARER_IRIDIUM_IP_TIMEOUT_DEFAULT,
|
||||
NULL);
|
||||
|
||||
/* Only export valid bearers */
|
||||
mm_bearer_export (bearer);
|
||||
mm_base_bearer_export (bearer);
|
||||
|
||||
return bearer;
|
||||
}
|
||||
@@ -265,9 +265,9 @@ mm_bearer_iridium_init (MMBearerIridium *self)
|
||||
static void
|
||||
mm_bearer_iridium_class_init (MMBearerIridiumClass *klass)
|
||||
{
|
||||
MMBearerClass *bearer_class = MM_BEARER_CLASS (klass);
|
||||
MMBaseBearerClass *base_bearer_class = MM_BASE_BEARER_CLASS (klass);
|
||||
|
||||
/* Virtual methods */
|
||||
bearer_class->connect = connect;
|
||||
bearer_class->connect_finish = connect_finish;
|
||||
base_bearer_class->connect = connect;
|
||||
base_bearer_class->connect_finish = connect_finish;
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@
|
||||
#define _LIBMM_INSIDE_MM
|
||||
#include <libmm-glib.h>
|
||||
|
||||
#include "mm-broadband-bearer.h"
|
||||
#include "mm-base-bearer.h"
|
||||
#include "mm-broadband-modem-iridium.h"
|
||||
|
||||
#define MM_TYPE_BEARER_IRIDIUM (mm_bearer_iridium_get_type ())
|
||||
@@ -38,18 +38,18 @@ typedef struct _MMBearerIridium MMBearerIridium;
|
||||
typedef struct _MMBearerIridiumClass MMBearerIridiumClass;
|
||||
|
||||
struct _MMBearerIridium {
|
||||
MMBearer parent;
|
||||
MMBaseBearer parent;
|
||||
};
|
||||
|
||||
struct _MMBearerIridiumClass {
|
||||
MMBearerClass parent;
|
||||
MMBaseBearerClass parent;
|
||||
};
|
||||
|
||||
GType mm_bearer_iridium_get_type (void);
|
||||
|
||||
/* Iridium bearer creation implementation.
|
||||
* NOTE it is *not* a broadband bearer, so not async-initable */
|
||||
MMBearer *mm_bearer_iridium_new (MMBroadbandModemIridium *modem,
|
||||
MMBearerProperties *config);
|
||||
MMBaseBearer *mm_bearer_iridium_new (MMBroadbandModemIridium *modem,
|
||||
MMBearerProperties *config);
|
||||
|
||||
#endif /* MM_BEARER_IRIDIUM_H */
|
||||
|
@@ -280,15 +280,15 @@ create_sim (MMIfaceModem *self,
|
||||
/*****************************************************************************/
|
||||
/* Create Bearer (Modem interface) */
|
||||
|
||||
static MMBearer *
|
||||
static MMBaseBearer *
|
||||
create_bearer_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
|
||||
bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res));
|
||||
mm_dbg ("New Iridium bearer created at DBus path '%s'", mm_bearer_get_path (bearer));
|
||||
mm_dbg ("New Iridium bearer created at DBus path '%s'", mm_base_bearer_get_path (bearer));
|
||||
|
||||
return g_object_ref (bearer);
|
||||
}
|
||||
@@ -299,7 +299,7 @@ create_bearer (MMIfaceModem *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
GSimpleAsyncResult *result;
|
||||
|
||||
result = g_simple_async_result_new (G_OBJECT (self),
|
||||
|
@@ -117,7 +117,7 @@ dial_3gpp_finish (MMBroadbandBearer *self,
|
||||
}
|
||||
|
||||
static void
|
||||
report_connection_status (MMBearer *bearer,
|
||||
report_connection_status (MMBaseBearer *bearer,
|
||||
MMBearerConnectionStatus status)
|
||||
{
|
||||
MMBroadbandBearerMbm *self = MM_BROADBAND_BEARER_MBM (bearer);
|
||||
@@ -140,7 +140,7 @@ report_connection_status (MMBearer *bearer,
|
||||
if (status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED) {
|
||||
/* If no connection attempt on-going, make sure we mark ourselves as
|
||||
* disconnected */
|
||||
MM_BEARER_CLASS (mm_broadband_bearer_mbm_parent_class)->report_connection_status (
|
||||
MM_BASE_BEARER_CLASS (mm_broadband_bearer_mbm_parent_class)->report_connection_status (
|
||||
bearer,
|
||||
status);
|
||||
}
|
||||
@@ -388,8 +388,8 @@ authenticate (Dial3gppContext *ctx)
|
||||
const gchar *user;
|
||||
const gchar *password;
|
||||
|
||||
user = mm_bearer_properties_get_user (mm_bearer_peek_config (MM_BEARER (ctx->self)));
|
||||
password = mm_bearer_properties_get_password (mm_bearer_peek_config (MM_BEARER (ctx->self)));
|
||||
user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
password = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
|
||||
/* Both user and password are required; otherwise firmware returns an error */
|
||||
if (user || password) {
|
||||
@@ -707,7 +707,7 @@ disconnect_3gpp (MMBroadbandBearer *self,
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMBearer *
|
||||
MMBaseBearer *
|
||||
mm_broadband_bearer_mbm_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -722,9 +722,9 @@ mm_broadband_bearer_mbm_new_finish (GAsyncResult *res,
|
||||
return NULL;
|
||||
|
||||
/* Only export valid bearers */
|
||||
mm_bearer_export (MM_BEARER (bearer));
|
||||
mm_base_bearer_export (MM_BASE_BEARER (bearer));
|
||||
|
||||
return MM_BEARER (bearer);
|
||||
return MM_BASE_BEARER (bearer);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -740,8 +740,8 @@ mm_broadband_bearer_mbm_new (MMBroadbandModemMbm *modem,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data,
|
||||
MM_BEARER_MODEM, modem,
|
||||
MM_BEARER_CONFIG, config,
|
||||
MM_BASE_BEARER_MODEM, modem,
|
||||
MM_BASE_BEARER_CONFIG, config,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -759,12 +759,12 @@ mm_broadband_bearer_mbm_class_init (MMBroadbandBearerMbmClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
MMBearerClass *bearer_class = MM_BEARER_CLASS (klass);
|
||||
MMBaseBearerClass *base_bearer_class = MM_BASE_BEARER_CLASS (klass);
|
||||
MMBroadbandBearerClass *broadband_bearer_class = MM_BROADBAND_BEARER_CLASS (klass);
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (MMBroadbandBearerMbmPrivate));
|
||||
|
||||
bearer_class->report_connection_status = report_connection_status;
|
||||
base_bearer_class->report_connection_status = report_connection_status;
|
||||
broadband_bearer_class->dial_3gpp = dial_3gpp;
|
||||
broadband_bearer_class->dial_3gpp_finish = dial_3gpp_finish;
|
||||
broadband_bearer_class->get_ip_config_3gpp = get_ip_config_3gpp;
|
||||
|
@@ -57,12 +57,12 @@ struct _MMBroadbandBearerMbmClass {
|
||||
GType mm_broadband_bearer_mbm_get_type (void);
|
||||
|
||||
/* Default 3GPP bearer creation implementation */
|
||||
void mm_broadband_bearer_mbm_new (MMBroadbandModemMbm *modem,
|
||||
MMBearerProperties *config,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBearer *mm_broadband_bearer_mbm_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_broadband_bearer_mbm_new (MMBroadbandModemMbm *modem,
|
||||
MMBearerProperties *config,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseBearer *mm_broadband_bearer_mbm_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
#endif /* MM_BROADBAND_BEARER_MBM_H */
|
||||
|
@@ -80,15 +80,15 @@ struct _MMBroadbandModemMbmPrivate {
|
||||
/*****************************************************************************/
|
||||
/* Create Bearer (Modem interface) */
|
||||
|
||||
static MMBearer *
|
||||
static MMBaseBearer *
|
||||
modem_create_bearer_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
|
||||
bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res));
|
||||
mm_dbg ("New MBM bearer created at DBus path '%s'", mm_bearer_get_path (bearer));
|
||||
mm_dbg ("New MBM bearer created at DBus path '%s'", mm_base_bearer_get_path (bearer));
|
||||
|
||||
return g_object_ref (bearer);
|
||||
}
|
||||
@@ -98,7 +98,7 @@ broadband_bearer_mbm_new_ready (GObject *source,
|
||||
GAsyncResult *res,
|
||||
GSimpleAsyncResult *simple)
|
||||
{
|
||||
MMBearer *bearer = NULL;
|
||||
MMBaseBearer *bearer = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
bearer = mm_broadband_bearer_mbm_new_finish (res, &error);
|
||||
@@ -801,10 +801,10 @@ typedef struct {
|
||||
} BearerListReportStatusForeachContext;
|
||||
|
||||
static void
|
||||
bearer_list_report_status_foreach (MMBearer *bearer,
|
||||
bearer_list_report_status_foreach (MMBaseBearer *bearer,
|
||||
BearerListReportStatusForeachContext *ctx)
|
||||
{
|
||||
mm_bearer_report_connection_status (bearer, ctx->status);
|
||||
mm_base_bearer_report_connection_status (bearer, ctx->status);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -138,7 +138,7 @@ poll_connection_ready (MMBaseModem *modem,
|
||||
}
|
||||
|
||||
if (is_qmistatus_disconnected (result)) {
|
||||
mm_bearer_report_connection_status (MM_BEARER (bearer), MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
|
||||
mm_base_bearer_report_connection_status (MM_BASE_BEARER (bearer), MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
|
||||
g_source_remove (bearer->priv->connection_poller);
|
||||
bearer->priv->connection_poller = 0;
|
||||
}
|
||||
@@ -149,8 +149,8 @@ poll_connection (MMBroadbandBearerNovatelLte *bearer)
|
||||
{
|
||||
MMBaseModem *modem = NULL;
|
||||
|
||||
g_object_get (MM_BEARER (bearer),
|
||||
MM_BEARER_MODEM, &modem,
|
||||
g_object_get (MM_BASE_BEARER (bearer),
|
||||
MM_BASE_BEARER_MODEM, &modem,
|
||||
NULL);
|
||||
mm_base_modem_at_command (
|
||||
modem,
|
||||
@@ -282,7 +282,7 @@ connect_3gpp_authenticate (DetailedConnectContext *ctx)
|
||||
MMBearerProperties *config;
|
||||
gchar *command, *apn, *user, *password;
|
||||
|
||||
config = mm_bearer_peek_config (MM_BEARER (ctx->self));
|
||||
config = mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self));
|
||||
apn = mm_port_serial_at_quote_string (mm_bearer_properties_get_apn (config));
|
||||
user = mm_port_serial_at_quote_string (mm_bearer_properties_get_user (config));
|
||||
password = mm_port_serial_at_quote_string (mm_bearer_properties_get_password (config));
|
||||
@@ -517,7 +517,7 @@ disconnect_3gpp (MMBroadbandBearer *self,
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMBearer *
|
||||
MMBaseBearer *
|
||||
mm_broadband_bearer_novatel_lte_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -532,9 +532,9 @@ mm_broadband_bearer_novatel_lte_new_finish (GAsyncResult *res,
|
||||
return NULL;
|
||||
|
||||
/* Only export valid bearers */
|
||||
mm_bearer_export (MM_BEARER (bearer));
|
||||
mm_base_bearer_export (MM_BASE_BEARER (bearer));
|
||||
|
||||
return MM_BEARER (bearer);
|
||||
return MM_BASE_BEARER (bearer);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -550,15 +550,15 @@ mm_broadband_bearer_novatel_lte_new (MMBroadbandModemNovatelLte *modem,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data,
|
||||
MM_BEARER_MODEM, modem,
|
||||
MM_BEARER_CONFIG, config,
|
||||
MM_BASE_BEARER_MODEM, modem,
|
||||
MM_BASE_BEARER_CONFIG, config,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
mm_broadband_bearer_novatel_lte_init (MMBroadbandBearerNovatelLte *self)
|
||||
{
|
||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self),
|
||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
||||
MM_TYPE_BROADBAND_BEARER_NOVATEL_LTE,
|
||||
MMBroadbandBearerNovatelLtePrivate);
|
||||
|
||||
|
@@ -50,13 +50,13 @@ struct _MMBroadbandBearerNovatelLteClass {
|
||||
GType mm_broadband_bearer_novatel_lte_get_type (void);
|
||||
|
||||
/* Default 3GPP bearer creation implementation */
|
||||
void mm_broadband_bearer_novatel_lte_new (MMBroadbandModemNovatelLte *modem,
|
||||
MMBearerProperties *properties,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBearer *mm_broadband_bearer_novatel_lte_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_broadband_bearer_novatel_lte_new (MMBroadbandModemNovatelLte *modem,
|
||||
MMBearerProperties *properties,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseBearer *mm_broadband_bearer_novatel_lte_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
|
||||
#endif /* MM_BROADBAND_BEARER_NOVATEL_LTE_H */
|
||||
|
@@ -69,12 +69,12 @@ modem_power_down (MMIfaceModem *self,
|
||||
/*****************************************************************************/
|
||||
/* Create Bearer (Modem interface) */
|
||||
|
||||
static MMBearer *
|
||||
static MMBaseBearer *
|
||||
modem_create_bearer_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
|
||||
if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error))
|
||||
return NULL;
|
||||
@@ -89,7 +89,7 @@ broadband_bearer_new_ready (GObject *source,
|
||||
GAsyncResult *res,
|
||||
GSimpleAsyncResult *simple)
|
||||
{
|
||||
MMBearer *bearer = NULL;
|
||||
MMBaseBearer *bearer = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
bearer = mm_broadband_bearer_novatel_lte_new_finish (res, &error);
|
||||
|
@@ -317,7 +317,7 @@ connect_reset (Dial3gppContext *ctx)
|
||||
}
|
||||
|
||||
static void
|
||||
report_connection_status (MMBearer *bearer,
|
||||
report_connection_status (MMBaseBearer *bearer,
|
||||
MMBearerConnectionStatus status)
|
||||
{
|
||||
MMBroadbandBearerHso *self = MM_BROADBAND_BEARER_HSO (bearer);
|
||||
@@ -341,7 +341,7 @@ report_connection_status (MMBearer *bearer,
|
||||
if (status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED) {
|
||||
/* If no connection attempt on-going, make sure we mark ourselves as
|
||||
* disconnected */
|
||||
MM_BEARER_CLASS (mm_broadband_bearer_hso_parent_class)->report_connection_status (
|
||||
MM_BASE_BEARER_CLASS (mm_broadband_bearer_hso_parent_class)->report_connection_status (
|
||||
bearer,
|
||||
status);
|
||||
}
|
||||
@@ -467,8 +467,8 @@ forced_close_cb (MMPortSerial *port,
|
||||
MMBroadbandBearerHso *self)
|
||||
{
|
||||
/* Just treat the forced close event as any other unsolicited message */
|
||||
mm_bearer_report_connection_status (MM_BEARER (self),
|
||||
MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED);
|
||||
mm_base_bearer_report_connection_status (MM_BASE_BEARER (self),
|
||||
MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -594,9 +594,9 @@ authenticate (Dial3gppContext *ctx)
|
||||
return;
|
||||
}
|
||||
|
||||
user = mm_bearer_properties_get_user (mm_bearer_peek_config (MM_BEARER (ctx->self)));
|
||||
password = mm_bearer_properties_get_password (mm_bearer_peek_config (MM_BEARER (ctx->self)));
|
||||
allowed_auth = mm_bearer_properties_get_allowed_auth (mm_bearer_peek_config (MM_BEARER (ctx->self)));
|
||||
user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
password = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
allowed_auth = mm_bearer_properties_get_allowed_auth (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
|
||||
/* Both user and password are required; otherwise firmware returns an error */
|
||||
if (!user || !password || allowed_auth == MM_BEARER_ALLOWED_AUTH_NONE) {
|
||||
@@ -787,7 +787,7 @@ disconnect_3gpp (MMBroadbandBearer *self,
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMBearer *
|
||||
MMBaseBearer *
|
||||
mm_broadband_bearer_hso_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -802,9 +802,9 @@ mm_broadband_bearer_hso_new_finish (GAsyncResult *res,
|
||||
return NULL;
|
||||
|
||||
/* Only export valid bearers */
|
||||
mm_bearer_export (MM_BEARER (bearer));
|
||||
mm_base_bearer_export (MM_BASE_BEARER (bearer));
|
||||
|
||||
return MM_BEARER (bearer);
|
||||
return MM_BASE_BEARER (bearer);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -820,8 +820,8 @@ mm_broadband_bearer_hso_new (MMBroadbandModemHso *modem,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data,
|
||||
MM_BEARER_MODEM, modem,
|
||||
MM_BEARER_CONFIG, config,
|
||||
MM_BASE_BEARER_MODEM, modem,
|
||||
MM_BASE_BEARER_CONFIG, config,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -838,12 +838,12 @@ static void
|
||||
mm_broadband_bearer_hso_class_init (MMBroadbandBearerHsoClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
MMBearerClass *bearer_class = MM_BEARER_CLASS (klass);
|
||||
MMBaseBearerClass *base_bearer_class = MM_BASE_BEARER_CLASS (klass);
|
||||
MMBroadbandBearerClass *broadband_bearer_class = MM_BROADBAND_BEARER_CLASS (klass);
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (MMBroadbandBearerHsoPrivate));
|
||||
|
||||
bearer_class->report_connection_status = report_connection_status;
|
||||
base_bearer_class->report_connection_status = report_connection_status;
|
||||
broadband_bearer_class->dial_3gpp = dial_3gpp;
|
||||
broadband_bearer_class->dial_3gpp_finish = dial_3gpp_finish;
|
||||
broadband_bearer_class->get_ip_config_3gpp = get_ip_config_3gpp;
|
||||
|
@@ -48,12 +48,12 @@ struct _MMBroadbandBearerHsoClass {
|
||||
GType mm_broadband_bearer_hso_get_type (void);
|
||||
|
||||
/* Default 3GPP bearer creation implementation */
|
||||
void mm_broadband_bearer_hso_new (MMBroadbandModemHso *modem,
|
||||
MMBearerProperties *config,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBearer *mm_broadband_bearer_hso_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_broadband_bearer_hso_new (MMBroadbandModemHso *modem,
|
||||
MMBearerProperties *config,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseBearer *mm_broadband_bearer_hso_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
#endif /* MM_BROADBAND_BEARER_HSO_H */
|
||||
|
@@ -57,17 +57,17 @@ struct _MMBroadbandModemHsoPrivate {
|
||||
/*****************************************************************************/
|
||||
/* Create Bearer (Modem interface) */
|
||||
|
||||
static MMBearer *
|
||||
static MMBaseBearer *
|
||||
modem_create_bearer_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
|
||||
bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res));
|
||||
mm_dbg ("New %s bearer created at DBus path '%s'",
|
||||
MM_IS_BROADBAND_BEARER_HSO (bearer) ? "HSO" : "Generic",
|
||||
mm_bearer_get_path (bearer));
|
||||
mm_base_bearer_get_path (bearer));
|
||||
|
||||
return g_object_ref (bearer);
|
||||
}
|
||||
@@ -77,7 +77,7 @@ broadband_bearer_new_ready (GObject *source,
|
||||
GAsyncResult *res,
|
||||
GSimpleAsyncResult *simple)
|
||||
{
|
||||
MMBearer *bearer = NULL;
|
||||
MMBaseBearer *bearer = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
bearer = mm_broadband_bearer_new_finish (res, &error);
|
||||
@@ -96,7 +96,7 @@ broadband_bearer_hso_new_ready (GObject *source,
|
||||
GAsyncResult *res,
|
||||
GSimpleAsyncResult *simple)
|
||||
{
|
||||
MMBearer *bearer = NULL;
|
||||
MMBaseBearer *bearer = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
bearer = mm_broadband_bearer_hso_new_finish (res, &error);
|
||||
@@ -220,13 +220,13 @@ typedef struct {
|
||||
} BearerListReportStatusForeachContext;
|
||||
|
||||
static void
|
||||
bearer_list_report_status_foreach (MMBearer *bearer,
|
||||
bearer_list_report_status_foreach (MMBaseBearer *bearer,
|
||||
BearerListReportStatusForeachContext *ctx)
|
||||
{
|
||||
if (mm_broadband_bearer_get_3gpp_cid (MM_BROADBAND_BEARER (bearer)) != ctx->cid)
|
||||
return;
|
||||
|
||||
mm_bearer_report_connection_status (MM_BEARER (bearer), ctx->status);
|
||||
mm_base_bearer_report_connection_status (MM_BASE_BEARER (bearer), ctx->status);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -202,9 +202,9 @@ dial_3gpp_context_step (Dial3gppContext *ctx)
|
||||
const gchar *password;
|
||||
MMBearerAllowedAuth allowed_auth;
|
||||
|
||||
user = mm_bearer_properties_get_user (mm_bearer_peek_config (MM_BEARER (ctx->self)));
|
||||
password = mm_bearer_properties_get_password (mm_bearer_peek_config (MM_BEARER (ctx->self)));
|
||||
allowed_auth = mm_bearer_properties_get_allowed_auth (mm_bearer_peek_config (MM_BEARER (ctx->self)));
|
||||
user = mm_bearer_properties_get_user (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
password = mm_bearer_properties_get_password (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
allowed_auth = mm_bearer_properties_get_allowed_auth (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
|
||||
if (!user || !password || allowed_auth == MM_BEARER_ALLOWED_AUTH_NONE) {
|
||||
mm_dbg ("Not using authentication");
|
||||
@@ -445,7 +445,7 @@ disconnect_3gpp (MMBroadbandBearer *self,
|
||||
|
||||
#define MM_BROADBAND_BEARER_SIERRA_IS_ICERA "is-icera"
|
||||
|
||||
MMBearer *
|
||||
MMBaseBearer *
|
||||
mm_broadband_bearer_sierra_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -460,9 +460,9 @@ mm_broadband_bearer_sierra_new_finish (GAsyncResult *res,
|
||||
return NULL;
|
||||
|
||||
/* Only export valid bearers */
|
||||
mm_bearer_export (MM_BEARER (bearer));
|
||||
mm_base_bearer_export (MM_BASE_BEARER (bearer));
|
||||
|
||||
return MM_BEARER (bearer);
|
||||
return MM_BASE_BEARER (bearer);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -479,8 +479,8 @@ mm_broadband_bearer_sierra_new (MMBroadbandModem *modem,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data,
|
||||
MM_BEARER_MODEM, modem,
|
||||
MM_BEARER_CONFIG, config,
|
||||
MM_BASE_BEARER_MODEM, modem,
|
||||
MM_BASE_BEARER_CONFIG, config,
|
||||
MM_BROADBAND_BEARER_SIERRA_IS_ICERA, is_icera,
|
||||
NULL);
|
||||
}
|
||||
|
@@ -50,13 +50,13 @@ struct _MMBroadbandBearerSierraClass {
|
||||
GType mm_broadband_bearer_sierra_get_type (void);
|
||||
|
||||
/* Default 3GPP bearer creation implementation */
|
||||
void mm_broadband_bearer_sierra_new (MMBroadbandModem *modem,
|
||||
MMBearerProperties *config,
|
||||
gboolean is_icera,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBearer *mm_broadband_bearer_sierra_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_broadband_bearer_sierra_new (MMBroadbandModem *modem,
|
||||
MMBearerProperties *config,
|
||||
gboolean is_icera,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseBearer *mm_broadband_bearer_sierra_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
#endif /* MM_BROADBAND_BEARER_SIERRA_H */
|
||||
|
@@ -39,15 +39,15 @@ G_DEFINE_TYPE_EXTENDED (MMBroadbandModemSierraIcera, mm_broadband_modem_sierra_i
|
||||
/*****************************************************************************/
|
||||
/* Create Bearer (Modem interface) */
|
||||
|
||||
static MMBearer *
|
||||
static MMBaseBearer *
|
||||
modem_create_bearer_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
|
||||
bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res));
|
||||
mm_dbg ("New Sierra bearer created at DBus path '%s'", mm_bearer_get_path (bearer));
|
||||
mm_dbg ("New Sierra bearer created at DBus path '%s'", mm_base_bearer_get_path (bearer));
|
||||
|
||||
return g_object_ref (bearer);
|
||||
}
|
||||
@@ -57,7 +57,7 @@ broadband_bearer_sierra_new_ready (GObject *source,
|
||||
GAsyncResult *res,
|
||||
GSimpleAsyncResult *simple)
|
||||
{
|
||||
MMBearer *bearer = NULL;
|
||||
MMBaseBearer *bearer = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
bearer = mm_broadband_bearer_sierra_new_finish (res, &error);
|
||||
|
@@ -1088,15 +1088,15 @@ modem_load_own_numbers (MMIfaceModem *self,
|
||||
/*****************************************************************************/
|
||||
/* Create Bearer (Modem interface) */
|
||||
|
||||
static MMBearer *
|
||||
static MMBaseBearer *
|
||||
modem_create_bearer_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
|
||||
bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res));
|
||||
mm_dbg ("New Sierra bearer created at DBus path '%s'", mm_bearer_get_path (bearer));
|
||||
mm_dbg ("New Sierra bearer created at DBus path '%s'", mm_base_bearer_get_path (bearer));
|
||||
|
||||
return g_object_ref (bearer);
|
||||
}
|
||||
@@ -1106,7 +1106,7 @@ broadband_bearer_sierra_new_ready (GObject *source,
|
||||
GAsyncResult *res,
|
||||
GSimpleAsyncResult *simple)
|
||||
{
|
||||
MMBearer *bearer = NULL;
|
||||
MMBaseBearer *bearer = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
bearer = mm_broadband_bearer_sierra_new_finish (res, &error);
|
||||
|
@@ -113,12 +113,12 @@ endif
|
||||
|
||||
# Daemon specific enum types
|
||||
DAEMON_ENUMS = \
|
||||
$(srcdir)/mm-bearer.h \
|
||||
$(srcdir)/mm-base-bearer.h \
|
||||
$(srcdir)/mm-port-probe.h
|
||||
|
||||
mm-daemon-enums-types.h: Makefile.am $(DAEMON_ENUMS) $(top_srcdir)/build-aux/mm-enums-template.h
|
||||
$(AM_V_GEN) $(GLIB_MKENUMS) \
|
||||
--fhead "#include \"mm-bearer.h\"\n#include \"mm-port-probe.h\"\n#ifndef __MM_DAEMON_ENUMS_TYPES_H__\n#define __MM_DAEMON_ENUMS_TYPES_H__\n" \
|
||||
--fhead "#include \"mm-base-bearer.h\"\n#include \"mm-port-probe.h\"\n#ifndef __MM_DAEMON_ENUMS_TYPES_H__\n#define __MM_DAEMON_ENUMS_TYPES_H__\n" \
|
||||
--template $(top_srcdir)/build-aux/mm-enums-template.h \
|
||||
--ftail "#endif /* __MM_DAEMON_ENUMS_TYPES_H__ */\n" \
|
||||
$(DAEMON_ENUMS) > $@
|
||||
@@ -177,8 +177,8 @@ ModemManager_SOURCES = \
|
||||
mm-plugin-manager.h \
|
||||
mm-sim.h \
|
||||
mm-sim.c \
|
||||
mm-bearer.h \
|
||||
mm-bearer.c \
|
||||
mm-base-bearer.h \
|
||||
mm-base-bearer.c \
|
||||
mm-broadband-bearer.h \
|
||||
mm-broadband-bearer.c \
|
||||
mm-bearer-list.h \
|
||||
@@ -225,7 +225,7 @@ ModemManager_SOURCES = \
|
||||
mm-plugin.h
|
||||
|
||||
# Additional dependency rules
|
||||
mm-bearer.c: mm-daemon-enums-types.h
|
||||
mm-base-bearer.c: mm-daemon-enums-types.h
|
||||
|
||||
# Additional Polkit support
|
||||
if WITH_POLKIT
|
||||
|
@@ -13,7 +13,7 @@
|
||||
* Copyright (C) 2008 - 2009 Novell, Inc.
|
||||
* Copyright (C) 2009 - 2011 Red Hat, Inc.
|
||||
* Copyright (C) 2011 Google, Inc.
|
||||
* Copyright (C) 2011 - 2013 Aleksander Morgado <aleksander@gnu.org>
|
||||
* Copyright (C) 2011 - 2014 Aleksander Morgado <aleksander@aleksander.es>
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -31,19 +31,18 @@
|
||||
#include "mm-iface-modem.h"
|
||||
#include "mm-iface-modem-3gpp.h"
|
||||
#include "mm-iface-modem-cdma.h"
|
||||
#include "mm-bearer.h"
|
||||
#include "mm-base-bearer.h"
|
||||
#include "mm-base-modem-at.h"
|
||||
#include "mm-base-modem.h"
|
||||
#include "mm-log.h"
|
||||
#include "mm-modem-helpers.h"
|
||||
|
||||
/* We require up to 20s to get a proper IP when using PPP */
|
||||
#define MM_BEARER_IP_TIMEOUT_DEFAULT 20
|
||||
#define BEARER_IP_TIMEOUT_DEFAULT 20
|
||||
|
||||
#define MM_BEARER_DEFERRED_UNREGISTRATION_TIMEOUT 15
|
||||
|
||||
G_DEFINE_TYPE (MMBearer, mm_bearer, MM_GDBUS_TYPE_BEARER_SKELETON);
|
||||
#define BEARER_DEFERRED_UNREGISTRATION_TIMEOUT 15
|
||||
|
||||
G_DEFINE_TYPE (MMBaseBearer, mm_base_bearer, MM_GDBUS_TYPE_BEARER_SKELETON);
|
||||
|
||||
typedef enum {
|
||||
CONNECTION_FORBIDDEN_REASON_NONE,
|
||||
@@ -65,7 +64,7 @@ enum {
|
||||
|
||||
static GParamSpec *properties[PROP_LAST];
|
||||
|
||||
struct _MMBearerPrivate {
|
||||
struct _MMBaseBearerPrivate {
|
||||
/* The connection to the system bus */
|
||||
GDBusConnection *connection;
|
||||
/* The modem which owns this BEARER */
|
||||
@@ -111,14 +110,14 @@ static const gchar *connection_forbidden_reason_str [CONNECTION_FORBIDDEN_REASON
|
||||
/*****************************************************************************/
|
||||
|
||||
void
|
||||
mm_bearer_export (MMBearer *self)
|
||||
mm_base_bearer_export (MMBaseBearer *self)
|
||||
{
|
||||
static guint id = 0;
|
||||
gchar *path;
|
||||
|
||||
path = g_strdup_printf (MM_DBUS_BEARER_PREFIX "/%d", id++);
|
||||
g_object_set (self,
|
||||
MM_BEARER_PATH, path,
|
||||
MM_BASE_BEARER_PATH, path,
|
||||
NULL);
|
||||
g_free (path);
|
||||
}
|
||||
@@ -126,7 +125,7 @@ mm_bearer_export (MMBearer *self)
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
bearer_reset_interface_status (MMBearer *self)
|
||||
bearer_reset_interface_status (MMBaseBearer *self)
|
||||
{
|
||||
mm_gdbus_bearer_set_connected (MM_GDBUS_BEARER (self), FALSE);
|
||||
mm_gdbus_bearer_set_suspended (MM_GDBUS_BEARER (self), FALSE);
|
||||
@@ -140,7 +139,7 @@ bearer_reset_interface_status (MMBearer *self)
|
||||
}
|
||||
|
||||
static void
|
||||
bearer_update_status (MMBearer *self,
|
||||
bearer_update_status (MMBaseBearer *self,
|
||||
MMBearerStatus status)
|
||||
{
|
||||
/* NOTE: we do allow status 'CONNECTED' here; it may happen if we go into
|
||||
@@ -157,7 +156,7 @@ bearer_update_status (MMBearer *self,
|
||||
}
|
||||
|
||||
static void
|
||||
bearer_update_status_connected (MMBearer *self,
|
||||
bearer_update_status_connected (MMBaseBearer *self,
|
||||
const gchar *interface,
|
||||
MMBearerIpConfig *ipv4_config,
|
||||
MMBearerIpConfig *ipv6_config)
|
||||
@@ -180,7 +179,7 @@ bearer_update_status_connected (MMBearer *self,
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
reset_deferred_unregistration (MMBearer *self)
|
||||
reset_deferred_unregistration (MMBaseBearer *self)
|
||||
{
|
||||
if (self->priv->deferred_cdma_unregistration_id) {
|
||||
g_source_remove (self->priv->deferred_cdma_unregistration_id);
|
||||
@@ -194,20 +193,20 @@ reset_deferred_unregistration (MMBearer *self)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
deferred_3gpp_unregistration_cb (MMBearer *self)
|
||||
deferred_3gpp_unregistration_cb (MMBaseBearer *self)
|
||||
{
|
||||
g_warn_if_fail (self->priv->reason_3gpp == CONNECTION_FORBIDDEN_REASON_UNREGISTERED);
|
||||
self->priv->deferred_3gpp_unregistration_id = 0;
|
||||
|
||||
mm_dbg ("Forcing bearer disconnection, not registered in 3GPP network");
|
||||
mm_bearer_disconnect_force (self);
|
||||
mm_base_bearer_disconnect_force (self);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
modem_3gpp_registration_state_changed (MMIfaceModem3gpp *modem,
|
||||
GParamSpec *pspec,
|
||||
MMBearer *self)
|
||||
MMBaseBearer *self)
|
||||
{
|
||||
MMModem3gppRegistrationState state = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN;
|
||||
|
||||
@@ -226,7 +225,7 @@ modem_3gpp_registration_state_changed (MMIfaceModem3gpp *modem,
|
||||
self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_NONE;
|
||||
break;
|
||||
case MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING:
|
||||
if (mm_bearer_properties_get_allow_roaming (mm_bearer_peek_config (self)))
|
||||
if (mm_bearer_properties_get_allow_roaming (mm_base_bearer_peek_config (self)))
|
||||
self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_NONE;
|
||||
else
|
||||
self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_ROAMING;
|
||||
@@ -246,7 +245,7 @@ modem_3gpp_registration_state_changed (MMIfaceModem3gpp *modem,
|
||||
if (self->priv->reason_3gpp == CONNECTION_FORBIDDEN_REASON_ROAMING) {
|
||||
mm_dbg ("Bearer not allowed to connect, registered in roaming 3GPP network");
|
||||
reset_deferred_unregistration (self);
|
||||
mm_bearer_disconnect_force (self);
|
||||
mm_base_bearer_disconnect_force (self);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -259,14 +258,14 @@ modem_3gpp_registration_state_changed (MMIfaceModem3gpp *modem,
|
||||
/* If the bearer is not connected, report right away */
|
||||
if (self->priv->status != MM_BEARER_STATUS_CONNECTED) {
|
||||
mm_dbg ("Bearer not allowed to connect, not registered in 3GPP network");
|
||||
mm_bearer_disconnect_force (self);
|
||||
mm_base_bearer_disconnect_force (self);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Otherwise, setup the new timeout */
|
||||
mm_dbg ("Connected bearer not registered in 3GPP network");
|
||||
self->priv->deferred_3gpp_unregistration_id =
|
||||
g_timeout_add_seconds (MM_BEARER_DEFERRED_UNREGISTRATION_TIMEOUT,
|
||||
g_timeout_add_seconds (BEARER_DEFERRED_UNREGISTRATION_TIMEOUT,
|
||||
(GSourceFunc) deferred_3gpp_unregistration_cb,
|
||||
self);
|
||||
return;
|
||||
@@ -276,20 +275,20 @@ modem_3gpp_registration_state_changed (MMIfaceModem3gpp *modem,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
deferred_cdma_unregistration_cb (MMBearer *self)
|
||||
deferred_cdma_unregistration_cb (MMBaseBearer *self)
|
||||
{
|
||||
g_warn_if_fail (self->priv->reason_cdma == CONNECTION_FORBIDDEN_REASON_UNREGISTERED);
|
||||
self->priv->deferred_cdma_unregistration_id = 0;
|
||||
|
||||
mm_dbg ("Forcing bearer disconnection, not registered in CDMA network");
|
||||
mm_bearer_disconnect_force (self);
|
||||
mm_base_bearer_disconnect_force (self);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
modem_cdma_registration_state_changed (MMIfaceModemCdma *modem,
|
||||
GParamSpec *pspec,
|
||||
MMBearer *self)
|
||||
MMBaseBearer *self)
|
||||
{
|
||||
MMModemCdmaRegistrationState cdma1x_state = MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN;
|
||||
MMModemCdmaRegistrationState evdo_state = MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN;
|
||||
@@ -301,7 +300,7 @@ modem_cdma_registration_state_changed (MMIfaceModemCdma *modem,
|
||||
|
||||
if (cdma1x_state == MM_MODEM_CDMA_REGISTRATION_STATE_ROAMING ||
|
||||
evdo_state == MM_MODEM_CDMA_REGISTRATION_STATE_ROAMING) {
|
||||
if (mm_bearer_properties_get_allow_roaming (mm_bearer_peek_config (self)))
|
||||
if (mm_bearer_properties_get_allow_roaming (mm_base_bearer_peek_config (self)))
|
||||
self->priv->reason_cdma = CONNECTION_FORBIDDEN_REASON_NONE;
|
||||
else
|
||||
self->priv->reason_cdma = CONNECTION_FORBIDDEN_REASON_ROAMING;
|
||||
@@ -325,7 +324,7 @@ modem_cdma_registration_state_changed (MMIfaceModemCdma *modem,
|
||||
if (self->priv->reason_cdma == CONNECTION_FORBIDDEN_REASON_ROAMING) {
|
||||
mm_dbg ("Bearer not allowed to connect, registered in roaming CDMA network");
|
||||
reset_deferred_unregistration (self);
|
||||
mm_bearer_disconnect_force (self);
|
||||
mm_base_bearer_disconnect_force (self);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -338,14 +337,14 @@ modem_cdma_registration_state_changed (MMIfaceModemCdma *modem,
|
||||
/* If the bearer is not connected, report right away */
|
||||
if (self->priv->status != MM_BEARER_STATUS_CONNECTED) {
|
||||
mm_dbg ("Bearer not allowed to connect, not registered in CDMA network");
|
||||
mm_bearer_disconnect_force (self);
|
||||
mm_base_bearer_disconnect_force (self);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Otherwise, setup the new timeout */
|
||||
mm_dbg ("Connected bearer not registered in CDMA network");
|
||||
self->priv->deferred_cdma_unregistration_id =
|
||||
g_timeout_add_seconds (MM_BEARER_DEFERRED_UNREGISTRATION_TIMEOUT,
|
||||
g_timeout_add_seconds (BEARER_DEFERRED_UNREGISTRATION_TIMEOUT,
|
||||
(GSourceFunc) deferred_cdma_unregistration_cb,
|
||||
self);
|
||||
return;
|
||||
@@ -355,7 +354,7 @@ modem_cdma_registration_state_changed (MMIfaceModemCdma *modem,
|
||||
}
|
||||
|
||||
static void
|
||||
set_signal_handlers (MMBearer *self)
|
||||
set_signal_handlers (MMBaseBearer *self)
|
||||
{
|
||||
g_assert (self->priv->modem != NULL);
|
||||
g_assert (self->priv->config != NULL);
|
||||
@@ -392,7 +391,7 @@ set_signal_handlers (MMBearer *self)
|
||||
}
|
||||
|
||||
static void
|
||||
reset_signal_handlers (MMBearer *self)
|
||||
reset_signal_handlers (MMBaseBearer *self)
|
||||
{
|
||||
if (!self->priv->modem)
|
||||
return;
|
||||
@@ -418,20 +417,20 @@ reset_signal_handlers (MMBearer *self)
|
||||
/* CONNECT */
|
||||
|
||||
gboolean
|
||||
mm_bearer_connect_finish (MMBearer *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
mm_base_bearer_connect_finish (MMBaseBearer *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
||||
}
|
||||
|
||||
static void
|
||||
disconnect_after_cancel_ready (MMBearer *self,
|
||||
disconnect_after_cancel_ready (MMBaseBearer *self,
|
||||
GAsyncResult *res)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!MM_BEARER_GET_CLASS (self)->disconnect_finish (self, res, &error)) {
|
||||
if (!MM_BASE_BEARER_GET_CLASS (self)->disconnect_finish (self, res, &error)) {
|
||||
mm_warn ("Error disconnecting bearer '%s': '%s'. "
|
||||
"Will assume disconnected anyway.",
|
||||
self->priv->path,
|
||||
@@ -446,11 +445,11 @@ disconnect_after_cancel_ready (MMBearer *self,
|
||||
* chance to correctly update their own connection state, in case this base
|
||||
* class ignores a failed disconnection attempt.
|
||||
*/
|
||||
mm_bearer_report_connection_status (self, MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
|
||||
mm_base_bearer_report_connection_status (self, MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
|
||||
}
|
||||
|
||||
static void
|
||||
connect_ready (MMBearer *self,
|
||||
connect_ready (MMBaseBearer *self,
|
||||
GAsyncResult *res,
|
||||
GSimpleAsyncResult *simple)
|
||||
{
|
||||
@@ -459,7 +458,7 @@ connect_ready (MMBearer *self,
|
||||
MMBearerConnectResult *result;
|
||||
|
||||
/* NOTE: connect() implementations *MUST* handle cancellations themselves */
|
||||
result = MM_BEARER_GET_CLASS (self)->connect_finish (self, res, &error);
|
||||
result = MM_BASE_BEARER_GET_CLASS (self)->connect_finish (self, res, &error);
|
||||
if (!result) {
|
||||
mm_dbg ("Couldn't connect bearer '%s': '%s'",
|
||||
self->priv->path,
|
||||
@@ -500,7 +499,7 @@ connect_ready (MMBearer *self,
|
||||
|
||||
if (launch_disconnect) {
|
||||
bearer_update_status (self, MM_BEARER_STATUS_DISCONNECTING);
|
||||
MM_BEARER_GET_CLASS (self)->disconnect (
|
||||
MM_BASE_BEARER_GET_CLASS (self)->disconnect (
|
||||
self,
|
||||
(GAsyncReadyCallback)disconnect_after_cancel_ready,
|
||||
NULL);
|
||||
@@ -512,14 +511,14 @@ connect_ready (MMBearer *self,
|
||||
}
|
||||
|
||||
void
|
||||
mm_bearer_connect (MMBearer *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
mm_base_bearer_connect (MMBaseBearer *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GSimpleAsyncResult *result;
|
||||
|
||||
g_assert (MM_BEARER_GET_CLASS (self)->connect != NULL);
|
||||
g_assert (MM_BEARER_GET_CLASS (self)->connect_finish != NULL);
|
||||
g_assert (MM_BASE_BEARER_GET_CLASS (self)->connect != NULL);
|
||||
g_assert (MM_BASE_BEARER_GET_CLASS (self)->connect_finish != NULL);
|
||||
|
||||
/* If already connecting, return error, don't allow a second request. */
|
||||
if (self->priv->status == MM_BEARER_STATUS_CONNECTING) {
|
||||
@@ -577,7 +576,7 @@ mm_bearer_connect (MMBearer *self,
|
||||
result = g_simple_async_result_new (G_OBJECT (self),
|
||||
callback,
|
||||
user_data,
|
||||
mm_bearer_connect);
|
||||
mm_base_bearer_connect);
|
||||
|
||||
/* If already connected, done */
|
||||
if (self->priv->status == MM_BEARER_STATUS_CONNECTED) {
|
||||
@@ -591,7 +590,7 @@ mm_bearer_connect (MMBearer *self,
|
||||
mm_dbg ("Connecting bearer '%s'", self->priv->path);
|
||||
self->priv->connect_cancellable = g_cancellable_new ();
|
||||
bearer_update_status (self, MM_BEARER_STATUS_CONNECTING);
|
||||
MM_BEARER_GET_CLASS (self)->connect (
|
||||
MM_BASE_BEARER_GET_CLASS (self)->connect (
|
||||
self,
|
||||
self->priv->connect_cancellable,
|
||||
(GAsyncReadyCallback)connect_ready,
|
||||
@@ -599,7 +598,7 @@ mm_bearer_connect (MMBearer *self,
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
MMBearer *self;
|
||||
MMBaseBearer *self;
|
||||
MMBaseModem *modem;
|
||||
GDBusMethodInvocation *invocation;
|
||||
} HandleConnectContext;
|
||||
@@ -614,13 +613,13 @@ handle_connect_context_free (HandleConnectContext *ctx)
|
||||
}
|
||||
|
||||
static void
|
||||
handle_connect_ready (MMBearer *self,
|
||||
handle_connect_ready (MMBaseBearer *self,
|
||||
GAsyncResult *res,
|
||||
HandleConnectContext *ctx)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!mm_bearer_connect_finish (self, res, &error))
|
||||
if (!mm_base_bearer_connect_finish (self, res, &error))
|
||||
g_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||
else
|
||||
mm_gdbus_bearer_complete_connect (MM_GDBUS_BEARER (self), ctx->invocation);
|
||||
@@ -641,13 +640,13 @@ handle_connect_auth_ready (MMBaseModem *modem,
|
||||
return;
|
||||
}
|
||||
|
||||
mm_bearer_connect (ctx->self,
|
||||
(GAsyncReadyCallback)handle_connect_ready,
|
||||
ctx);
|
||||
mm_base_bearer_connect (ctx->self,
|
||||
(GAsyncReadyCallback)handle_connect_ready,
|
||||
ctx);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
handle_connect (MMBearer *self,
|
||||
handle_connect (MMBaseBearer *self,
|
||||
GDBusMethodInvocation *invocation)
|
||||
{
|
||||
HandleConnectContext *ctx;
|
||||
@@ -656,7 +655,7 @@ handle_connect (MMBearer *self,
|
||||
ctx->self = g_object_ref (self);
|
||||
ctx->invocation = g_object_ref (invocation);
|
||||
g_object_get (self,
|
||||
MM_BEARER_MODEM, &ctx->modem,
|
||||
MM_BASE_BEARER_MODEM, &ctx->modem,
|
||||
NULL);
|
||||
|
||||
mm_base_modem_authorize (ctx->modem,
|
||||
@@ -671,21 +670,21 @@ handle_connect (MMBearer *self,
|
||||
/* DISCONNECT */
|
||||
|
||||
gboolean
|
||||
mm_bearer_disconnect_finish (MMBearer *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
mm_base_bearer_disconnect_finish (MMBaseBearer *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
||||
}
|
||||
|
||||
static void
|
||||
disconnect_ready (MMBearer *self,
|
||||
disconnect_ready (MMBaseBearer *self,
|
||||
GAsyncResult *res,
|
||||
GSimpleAsyncResult *simple)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!MM_BEARER_GET_CLASS (self)->disconnect_finish (self, res, &error)) {
|
||||
if (!MM_BASE_BEARER_GET_CLASS (self)->disconnect_finish (self, res, &error)) {
|
||||
mm_dbg ("Couldn't disconnect bearer '%s'", self->priv->path);
|
||||
bearer_update_status (self, MM_BEARER_STATUS_CONNECTED);
|
||||
g_simple_async_result_take_error (simple, error);
|
||||
@@ -701,7 +700,7 @@ disconnect_ready (MMBearer *self,
|
||||
}
|
||||
|
||||
static void
|
||||
status_changed_complete_disconnect (MMBearer *self,
|
||||
status_changed_complete_disconnect (MMBaseBearer *self,
|
||||
GParamSpec *pspec,
|
||||
GSimpleAsyncResult *simple)
|
||||
{
|
||||
@@ -724,19 +723,19 @@ status_changed_complete_disconnect (MMBearer *self,
|
||||
}
|
||||
|
||||
void
|
||||
mm_bearer_disconnect (MMBearer *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
mm_base_bearer_disconnect (MMBaseBearer *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GSimpleAsyncResult *simple;
|
||||
|
||||
g_assert (MM_BEARER_GET_CLASS (self)->disconnect != NULL);
|
||||
g_assert (MM_BEARER_GET_CLASS (self)->disconnect_finish != NULL);
|
||||
g_assert (MM_BASE_BEARER_GET_CLASS (self)->disconnect != NULL);
|
||||
g_assert (MM_BASE_BEARER_GET_CLASS (self)->disconnect_finish != NULL);
|
||||
|
||||
simple = g_simple_async_result_new (G_OBJECT (self),
|
||||
callback,
|
||||
user_data,
|
||||
mm_bearer_disconnect);
|
||||
mm_base_bearer_disconnect);
|
||||
|
||||
/* If already disconnected, done */
|
||||
if (self->priv->status == MM_BEARER_STATUS_DISCONNECTED) {
|
||||
@@ -773,7 +772,7 @@ mm_bearer_disconnect (MMBearer *self,
|
||||
*/
|
||||
self->priv->disconnect_signal_handler =
|
||||
g_signal_connect (self,
|
||||
"notify::" MM_BEARER_STATUS,
|
||||
"notify::" MM_BASE_BEARER_STATUS,
|
||||
(GCallback)status_changed_complete_disconnect,
|
||||
simple); /* takes ownership */
|
||||
|
||||
@@ -782,14 +781,14 @@ mm_bearer_disconnect (MMBearer *self,
|
||||
|
||||
/* Disconnecting! */
|
||||
bearer_update_status (self, MM_BEARER_STATUS_DISCONNECTING);
|
||||
MM_BEARER_GET_CLASS (self)->disconnect (
|
||||
MM_BASE_BEARER_GET_CLASS (self)->disconnect (
|
||||
self,
|
||||
(GAsyncReadyCallback)disconnect_ready,
|
||||
simple); /* takes ownership */
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
MMBearer *self;
|
||||
MMBaseBearer *self;
|
||||
MMBaseModem *modem;
|
||||
GDBusMethodInvocation *invocation;
|
||||
} HandleDisconnectContext;
|
||||
@@ -804,13 +803,13 @@ handle_disconnect_context_free (HandleDisconnectContext *ctx)
|
||||
}
|
||||
|
||||
static void
|
||||
handle_disconnect_ready (MMBearer *self,
|
||||
handle_disconnect_ready (MMBaseBearer *self,
|
||||
GAsyncResult *res,
|
||||
HandleDisconnectContext *ctx)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!mm_bearer_disconnect_finish (self, res, &error))
|
||||
if (!mm_base_bearer_disconnect_finish (self, res, &error))
|
||||
g_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||
else
|
||||
mm_gdbus_bearer_complete_disconnect (MM_GDBUS_BEARER (self), ctx->invocation);
|
||||
@@ -831,13 +830,13 @@ handle_disconnect_auth_ready (MMBaseModem *modem,
|
||||
return;
|
||||
}
|
||||
|
||||
mm_bearer_disconnect (ctx->self,
|
||||
(GAsyncReadyCallback)handle_disconnect_ready,
|
||||
ctx);
|
||||
mm_base_bearer_disconnect (ctx->self,
|
||||
(GAsyncReadyCallback)handle_disconnect_ready,
|
||||
ctx);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
handle_disconnect (MMBearer *self,
|
||||
handle_disconnect (MMBaseBearer *self,
|
||||
GDBusMethodInvocation *invocation)
|
||||
{
|
||||
HandleDisconnectContext *ctx;
|
||||
@@ -846,7 +845,7 @@ handle_disconnect (MMBearer *self,
|
||||
ctx->self = g_object_ref (self);
|
||||
ctx->invocation = g_object_ref (invocation);
|
||||
g_object_get (self,
|
||||
MM_BEARER_MODEM, &ctx->modem,
|
||||
MM_BASE_BEARER_MODEM, &ctx->modem,
|
||||
NULL);
|
||||
|
||||
mm_base_modem_authorize (ctx->modem,
|
||||
@@ -860,7 +859,7 @@ handle_disconnect (MMBearer *self,
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
mm_bearer_dbus_export (MMBearer *self)
|
||||
base_bearer_dbus_export (MMBaseBearer *self)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
@@ -886,7 +885,7 @@ mm_bearer_dbus_export (MMBearer *self)
|
||||
}
|
||||
|
||||
static void
|
||||
mm_bearer_dbus_unexport (MMBearer *self)
|
||||
base_bearer_dbus_unexport (MMBaseBearer *self)
|
||||
{
|
||||
const gchar *path;
|
||||
|
||||
@@ -901,25 +900,25 @@ mm_bearer_dbus_unexport (MMBearer *self)
|
||||
/*****************************************************************************/
|
||||
|
||||
MMBearerStatus
|
||||
mm_bearer_get_status (MMBearer *self)
|
||||
mm_base_bearer_get_status (MMBaseBearer *self)
|
||||
{
|
||||
return self->priv->status;
|
||||
}
|
||||
|
||||
const gchar *
|
||||
mm_bearer_get_path (MMBearer *self)
|
||||
mm_base_bearer_get_path (MMBaseBearer *self)
|
||||
{
|
||||
return self->priv->path;
|
||||
}
|
||||
|
||||
MMBearerProperties *
|
||||
mm_bearer_peek_config (MMBearer *self)
|
||||
mm_base_bearer_peek_config (MMBaseBearer *self)
|
||||
{
|
||||
return self->priv->config;
|
||||
}
|
||||
|
||||
MMBearerProperties *
|
||||
mm_bearer_get_config (MMBearer *self)
|
||||
mm_base_bearer_get_config (MMBaseBearer *self)
|
||||
{
|
||||
return (self->priv->config ?
|
||||
g_object_ref (self->priv->config) :
|
||||
@@ -927,7 +926,7 @@ mm_bearer_get_config (MMBearer *self)
|
||||
}
|
||||
|
||||
MMBearerIpFamily
|
||||
mm_bearer_get_default_ip_family (MMBearer *self)
|
||||
mm_base_bearer_get_default_ip_family (MMBaseBearer *self)
|
||||
{
|
||||
return self->priv->default_ip_family;
|
||||
}
|
||||
@@ -935,12 +934,12 @@ mm_bearer_get_default_ip_family (MMBearer *self)
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
disconnect_force_ready (MMBearer *self,
|
||||
disconnect_force_ready (MMBaseBearer *self,
|
||||
GAsyncResult *res)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!MM_BEARER_GET_CLASS (self)->disconnect_finish (self, res, &error)) {
|
||||
if (!MM_BASE_BEARER_GET_CLASS (self)->disconnect_finish (self, res, &error)) {
|
||||
mm_warn ("Error disconnecting bearer '%s': '%s'. "
|
||||
"Will assume disconnected anyway.",
|
||||
self->priv->path,
|
||||
@@ -955,11 +954,11 @@ disconnect_force_ready (MMBearer *self,
|
||||
* chance to correctly update their own connection state, in case this base
|
||||
* class ignores a failed disconnection attempt.
|
||||
*/
|
||||
mm_bearer_report_connection_status (self, MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
|
||||
mm_base_bearer_report_connection_status (self, MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
|
||||
}
|
||||
|
||||
void
|
||||
mm_bearer_disconnect_force (MMBearer *self)
|
||||
mm_base_bearer_disconnect_force (MMBaseBearer *self)
|
||||
{
|
||||
if (self->priv->status == MM_BEARER_STATUS_DISCONNECTING ||
|
||||
self->priv->status == MM_BEARER_STATUS_DISCONNECTED)
|
||||
@@ -975,7 +974,7 @@ mm_bearer_disconnect_force (MMBearer *self)
|
||||
|
||||
/* Disconnecting! */
|
||||
bearer_update_status (self, MM_BEARER_STATUS_DISCONNECTING);
|
||||
MM_BEARER_GET_CLASS (self)->disconnect (
|
||||
MM_BASE_BEARER_GET_CLASS (self)->disconnect (
|
||||
self,
|
||||
(GAsyncReadyCallback)disconnect_force_ready,
|
||||
NULL);
|
||||
@@ -984,7 +983,7 @@ mm_bearer_disconnect_force (MMBearer *self)
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
report_connection_status (MMBearer *self,
|
||||
report_connection_status (MMBaseBearer *self,
|
||||
MMBearerConnectionStatus status)
|
||||
{
|
||||
/* The only status expected at this point is DISCONNECTED.
|
||||
@@ -999,10 +998,10 @@ report_connection_status (MMBearer *self,
|
||||
}
|
||||
|
||||
void
|
||||
mm_bearer_report_connection_status (MMBearer *self,
|
||||
MMBearerConnectionStatus status)
|
||||
mm_base_bearer_report_connection_status (MMBaseBearer *self,
|
||||
MMBearerConnectionStatus status)
|
||||
{
|
||||
return MM_BEARER_GET_CLASS (self)->report_connection_status (self, status);
|
||||
return MM_BASE_BEARER_GET_CLASS (self)->report_connection_status (self, status);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1011,7 +1010,7 @@ set_property (GObject *object,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
MMBearer *self = MM_BEARER (object);
|
||||
MMBaseBearer *self = MM_BASE_BEARER (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_PATH:
|
||||
@@ -1021,7 +1020,7 @@ set_property (GObject *object,
|
||||
/* Export when we get a DBus connection AND we have a path */
|
||||
if (self->priv->path &&
|
||||
self->priv->connection)
|
||||
mm_bearer_dbus_export (self);
|
||||
base_bearer_dbus_export (self);
|
||||
break;
|
||||
case PROP_CONNECTION:
|
||||
g_clear_object (&self->priv->connection);
|
||||
@@ -1029,9 +1028,9 @@ set_property (GObject *object,
|
||||
|
||||
/* Export when we get a DBus connection AND we have a path */
|
||||
if (!self->priv->connection)
|
||||
mm_bearer_dbus_unexport (self);
|
||||
base_bearer_dbus_unexport (self);
|
||||
else if (self->priv->path)
|
||||
mm_bearer_dbus_export (self);
|
||||
base_bearer_dbus_export (self);
|
||||
break;
|
||||
case PROP_MODEM:
|
||||
g_clear_object (&self->priv->modem);
|
||||
@@ -1040,7 +1039,7 @@ set_property (GObject *object,
|
||||
/* Bind the modem's connection (which is set when it is exported,
|
||||
* and unset when unexported) to the BEARER's connection */
|
||||
g_object_bind_property (self->priv->modem, MM_BASE_MODEM_CONNECTION,
|
||||
self, MM_BEARER_CONNECTION,
|
||||
self, MM_BASE_BEARER_CONNECTION,
|
||||
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
||||
if (self->priv->config) {
|
||||
/* Listen to 3GPP/CDMA registration state changes. We need both
|
||||
@@ -1085,7 +1084,7 @@ get_property (GObject *object,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
MMBearer *self = MM_BEARER (object);
|
||||
MMBaseBearer *self = MM_BASE_BEARER (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_PATH:
|
||||
@@ -1113,12 +1112,12 @@ get_property (GObject *object,
|
||||
}
|
||||
|
||||
static void
|
||||
mm_bearer_init (MMBearer *self)
|
||||
mm_base_bearer_init (MMBaseBearer *self)
|
||||
{
|
||||
/* Initialize private data */
|
||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
||||
MM_TYPE_BEARER,
|
||||
MMBearerPrivate);
|
||||
MM_TYPE_BASE_BEARER,
|
||||
MMBaseBearerPrivate);
|
||||
self->priv->status = MM_BEARER_STATUS_DISCONNECTED;
|
||||
self->priv->reason_3gpp = CONNECTION_FORBIDDEN_REASON_NONE;
|
||||
self->priv->reason_cdma = CONNECTION_FORBIDDEN_REASON_NONE;
|
||||
@@ -1129,7 +1128,7 @@ mm_bearer_init (MMBearer *self)
|
||||
mm_gdbus_bearer_set_connected (MM_GDBUS_BEARER (self), FALSE);
|
||||
mm_gdbus_bearer_set_suspended (MM_GDBUS_BEARER (self), FALSE);
|
||||
mm_gdbus_bearer_set_properties (MM_GDBUS_BEARER (self), NULL);
|
||||
mm_gdbus_bearer_set_ip_timeout (MM_GDBUS_BEARER (self), MM_BEARER_IP_TIMEOUT_DEFAULT);
|
||||
mm_gdbus_bearer_set_ip_timeout (MM_GDBUS_BEARER (self), BEARER_IP_TIMEOUT_DEFAULT);
|
||||
mm_gdbus_bearer_set_ip4_config (MM_GDBUS_BEARER (self),
|
||||
mm_bearer_ip_config_get_dictionary (NULL));
|
||||
mm_gdbus_bearer_set_ip6_config (MM_GDBUS_BEARER (self),
|
||||
@@ -1139,20 +1138,20 @@ mm_bearer_init (MMBearer *self)
|
||||
static void
|
||||
finalize (GObject *object)
|
||||
{
|
||||
MMBearer *self = MM_BEARER (object);
|
||||
MMBaseBearer *self = MM_BASE_BEARER (object);
|
||||
|
||||
g_free (self->priv->path);
|
||||
|
||||
G_OBJECT_CLASS (mm_bearer_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (mm_base_bearer_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
dispose (GObject *object)
|
||||
{
|
||||
MMBearer *self = MM_BEARER (object);
|
||||
MMBaseBearer *self = MM_BASE_BEARER (object);
|
||||
|
||||
if (self->priv->connection) {
|
||||
mm_bearer_dbus_unexport (self);
|
||||
base_bearer_dbus_unexport (self);
|
||||
g_clear_object (&self->priv->connection);
|
||||
}
|
||||
|
||||
@@ -1162,15 +1161,15 @@ dispose (GObject *object)
|
||||
g_clear_object (&self->priv->modem);
|
||||
g_clear_object (&self->priv->config);
|
||||
|
||||
G_OBJECT_CLASS (mm_bearer_parent_class)->dispose (object);
|
||||
G_OBJECT_CLASS (mm_base_bearer_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
mm_bearer_class_init (MMBearerClass *klass)
|
||||
mm_base_bearer_class_init (MMBaseBearerClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (MMBearerPrivate));
|
||||
g_type_class_add_private (object_class, sizeof (MMBaseBearerPrivate));
|
||||
|
||||
/* Virtual methods */
|
||||
object_class->get_property = get_property;
|
||||
@@ -1181,7 +1180,7 @@ mm_bearer_class_init (MMBearerClass *klass)
|
||||
klass->report_connection_status = report_connection_status;
|
||||
|
||||
properties[PROP_CONNECTION] =
|
||||
g_param_spec_object (MM_BEARER_CONNECTION,
|
||||
g_param_spec_object (MM_BASE_BEARER_CONNECTION,
|
||||
"Connection",
|
||||
"GDBus connection to the system bus.",
|
||||
G_TYPE_DBUS_CONNECTION,
|
||||
@@ -1189,7 +1188,7 @@ mm_bearer_class_init (MMBearerClass *klass)
|
||||
g_object_class_install_property (object_class, PROP_CONNECTION, properties[PROP_CONNECTION]);
|
||||
|
||||
properties[PROP_PATH] =
|
||||
g_param_spec_string (MM_BEARER_PATH,
|
||||
g_param_spec_string (MM_BASE_BEARER_PATH,
|
||||
"Path",
|
||||
"DBus path of the Bearer",
|
||||
NULL,
|
||||
@@ -1197,7 +1196,7 @@ mm_bearer_class_init (MMBearerClass *klass)
|
||||
g_object_class_install_property (object_class, PROP_PATH, properties[PROP_PATH]);
|
||||
|
||||
properties[PROP_MODEM] =
|
||||
g_param_spec_object (MM_BEARER_MODEM,
|
||||
g_param_spec_object (MM_BASE_BEARER_MODEM,
|
||||
"Modem",
|
||||
"The Modem which owns this Bearer",
|
||||
MM_TYPE_BASE_MODEM,
|
||||
@@ -1205,7 +1204,7 @@ mm_bearer_class_init (MMBearerClass *klass)
|
||||
g_object_class_install_property (object_class, PROP_MODEM, properties[PROP_MODEM]);
|
||||
|
||||
properties[PROP_STATUS] =
|
||||
g_param_spec_enum (MM_BEARER_STATUS,
|
||||
g_param_spec_enum (MM_BASE_BEARER_STATUS,
|
||||
"Bearer status",
|
||||
"Status of the bearer",
|
||||
MM_TYPE_BEARER_STATUS,
|
||||
@@ -1214,7 +1213,7 @@ mm_bearer_class_init (MMBearerClass *klass)
|
||||
g_object_class_install_property (object_class, PROP_STATUS, properties[PROP_STATUS]);
|
||||
|
||||
properties[PROP_CONFIG] =
|
||||
g_param_spec_object (MM_BEARER_CONFIG,
|
||||
g_param_spec_object (MM_BASE_BEARER_CONFIG,
|
||||
"Bearer configuration",
|
||||
"List of user provided properties",
|
||||
MM_TYPE_BEARER_PROPERTIES,
|
||||
@@ -1222,7 +1221,7 @@ mm_bearer_class_init (MMBearerClass *klass)
|
||||
g_object_class_install_property (object_class, PROP_CONFIG, properties[PROP_CONFIG]);
|
||||
|
||||
properties[PROP_DEFAULT_IP_FAMILY] =
|
||||
g_param_spec_flags (MM_BEARER_DEFAULT_IP_FAMILY,
|
||||
g_param_spec_flags (MM_BASE_BEARER_DEFAULT_IP_FAMILY,
|
||||
"Bearer default IP family",
|
||||
"IP family to use for this bearer when no IP family is specified",
|
||||
MM_TYPE_BEARER_IP_FAMILY,
|
@@ -16,12 +16,13 @@
|
||||
* Copyright (C) 2011 - 2013 Aleksander Morgado <aleksander@gnu.org>
|
||||
*/
|
||||
|
||||
#ifndef MM_BEARER_H
|
||||
#define MM_BEARER_H
|
||||
#ifndef MM_BASE_BEARER_H
|
||||
#define MM_BASE_BEARER_H
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#include <ModemManager.h>
|
||||
#define _LIBMM_INSIDE_MM
|
||||
#include <libmm-glib.h>
|
||||
|
||||
@@ -42,23 +43,23 @@ MMBearerIpConfig *mm_bearer_connect_result_peek_ipv6_config (MMBearerConnec
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#define MM_TYPE_BEARER (mm_bearer_get_type ())
|
||||
#define MM_BEARER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BEARER, MMBearer))
|
||||
#define MM_BEARER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BEARER, MMBearerClass))
|
||||
#define MM_IS_BEARER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_BEARER))
|
||||
#define MM_IS_BEARER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_BEARER))
|
||||
#define MM_BEARER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_BEARER, MMBearerClass))
|
||||
#define MM_TYPE_BASE_BEARER (mm_base_bearer_get_type ())
|
||||
#define MM_BASE_BEARER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BASE_BEARER, MMBaseBearer))
|
||||
#define MM_BASE_BEARER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BASE_BEARER, MMBaseBearerClass))
|
||||
#define MM_IS_BASE_BEARER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_BASE_BEARER))
|
||||
#define MM_IS_BASE_BEARER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_BASE_BEARER))
|
||||
#define MM_BASE_BEARER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_BASE_BEARER, MMBaseBearerClass))
|
||||
|
||||
typedef struct _MMBearer MMBearer;
|
||||
typedef struct _MMBearerClass MMBearerClass;
|
||||
typedef struct _MMBearerPrivate MMBearerPrivate;
|
||||
typedef struct _MMBaseBearer MMBaseBearer;
|
||||
typedef struct _MMBaseBearerClass MMBaseBearerClass;
|
||||
typedef struct _MMBaseBearerPrivate MMBaseBearerPrivate;
|
||||
|
||||
#define MM_BEARER_PATH "bearer-path"
|
||||
#define MM_BEARER_CONNECTION "bearer-connection"
|
||||
#define MM_BEARER_MODEM "bearer-modem"
|
||||
#define MM_BEARER_STATUS "bearer-status"
|
||||
#define MM_BEARER_CONFIG "bearer-config"
|
||||
#define MM_BEARER_DEFAULT_IP_FAMILY "bearer-deafult-ip-family"
|
||||
#define MM_BASE_BEARER_PATH "bearer-path"
|
||||
#define MM_BASE_BEARER_CONNECTION "bearer-connection"
|
||||
#define MM_BASE_BEARER_MODEM "bearer-modem"
|
||||
#define MM_BASE_BEARER_STATUS "bearer-status"
|
||||
#define MM_BASE_BEARER_CONFIG "bearer-config"
|
||||
#define MM_BASE_BEARER_DEFAULT_IP_FAMILY "bearer-deafult-ip-family"
|
||||
|
||||
typedef enum { /*< underscore_name=mm_bearer_status >*/
|
||||
MM_BEARER_STATUS_DISCONNECTED,
|
||||
@@ -75,64 +76,64 @@ typedef enum { /*< underscore_name=mm_bearer_connection_status >*/
|
||||
MM_BEARER_CONNECTION_STATUS_CONNECTION_FAILED,
|
||||
} MMBearerConnectionStatus;
|
||||
|
||||
struct _MMBearer {
|
||||
struct _MMBaseBearer {
|
||||
MmGdbusBearerSkeleton parent;
|
||||
MMBearerPrivate *priv;
|
||||
MMBaseBearerPrivate *priv;
|
||||
};
|
||||
|
||||
struct _MMBearerClass {
|
||||
struct _MMBaseBearerClass {
|
||||
MmGdbusBearerSkeletonClass parent;
|
||||
|
||||
/* Connect this bearer */
|
||||
void (* connect) (MMBearer *bearer,
|
||||
void (* connect) (MMBaseBearer *bearer,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBearerConnectResult * (* connect_finish) (MMBearer *bearer,
|
||||
MMBearerConnectResult * (* connect_finish) (MMBaseBearer *bearer,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Disconnect this bearer */
|
||||
void (* disconnect) (MMBearer *bearer,
|
||||
void (* disconnect) (MMBaseBearer *bearer,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean (* disconnect_finish) (MMBearer *bearer,
|
||||
gboolean (* disconnect_finish) (MMBaseBearer *bearer,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Report connection status of this bearer */
|
||||
void (* report_connection_status) (MMBearer *bearer,
|
||||
void (* report_connection_status) (MMBaseBearer *bearer,
|
||||
MMBearerConnectionStatus status);
|
||||
};
|
||||
|
||||
GType mm_bearer_get_type (void);
|
||||
GType mm_base_bearer_get_type (void);
|
||||
|
||||
void mm_bearer_export (MMBearer *self);
|
||||
void mm_base_bearer_export (MMBaseBearer *self);
|
||||
|
||||
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);
|
||||
MMBearerIpFamily mm_bearer_get_default_ip_family (MMBearer *self);
|
||||
const gchar *mm_base_bearer_get_path (MMBaseBearer *self);
|
||||
MMBearerStatus mm_base_bearer_get_status (MMBaseBearer *self);
|
||||
MMBearerProperties *mm_base_bearer_peek_config (MMBaseBearer *self);
|
||||
MMBearerProperties *mm_base_bearer_get_config (MMBaseBearer *self);
|
||||
MMBearerIpFamily mm_base_bearer_get_default_ip_family (MMBaseBearer *self);
|
||||
|
||||
|
||||
void mm_bearer_connect (MMBearer *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean mm_bearer_connect_finish (MMBearer *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_base_bearer_connect (MMBaseBearer *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean mm_base_bearer_connect_finish (MMBaseBearer *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
void mm_bearer_disconnect (MMBearer *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean mm_bearer_disconnect_finish (MMBearer *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_base_bearer_disconnect (MMBaseBearer *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
gboolean mm_base_bearer_disconnect_finish (MMBaseBearer *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
void mm_bearer_disconnect_force (MMBearer *self);
|
||||
void mm_base_bearer_disconnect_force (MMBaseBearer *self);
|
||||
|
||||
void mm_bearer_report_connection_status (MMBearer *self,
|
||||
MMBearerConnectionStatus status);
|
||||
void mm_base_bearer_report_connection_status (MMBaseBearer *self,
|
||||
MMBearerConnectionStatus status);
|
||||
|
||||
#endif /* MM_BEARER_H */
|
||||
#endif /* MM_BASE_BEARER_H */
|
@@ -78,7 +78,7 @@ mm_bearer_list_get_count_active (MMBearerList *self)
|
||||
|
||||
gboolean
|
||||
mm_bearer_list_add_bearer (MMBearerList *self,
|
||||
MMBearer *bearer,
|
||||
MMBaseBearer *bearer,
|
||||
GError **error)
|
||||
{
|
||||
/* Just in case, ensure we don't go off limits */
|
||||
@@ -115,7 +115,7 @@ mm_bearer_list_delete_bearer (MMBearerList *self,
|
||||
}
|
||||
|
||||
for (l = self->priv->bearers; l; l = g_list_next (l)) {
|
||||
if (g_str_equal (path, mm_bearer_get_path (MM_BEARER (l->data)))) {
|
||||
if (g_str_equal (path, mm_base_bearer_get_path (MM_BASE_BEARER (l->data)))) {
|
||||
g_object_unref (l->data);
|
||||
self->priv->bearers = g_list_delete_link (self->priv->bearers, l);
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_NUM_BEARERS]);
|
||||
@@ -153,7 +153,7 @@ mm_bearer_list_get_paths (MMBearerList *self)
|
||||
1 + g_list_length (self->priv->bearers));
|
||||
|
||||
for (i = 0, l = self->priv->bearers; l; l = g_list_next (l))
|
||||
path_list[i++] = g_strdup (mm_bearer_get_path (MM_BEARER (l->data)));
|
||||
path_list[i++] = g_strdup (mm_base_bearer_get_path (MM_BASE_BEARER (l->data)));
|
||||
|
||||
return path_list;
|
||||
}
|
||||
@@ -166,14 +166,14 @@ mm_bearer_list_foreach (MMBearerList *self,
|
||||
g_list_foreach (self->priv->bearers, (GFunc)func, user_data);
|
||||
}
|
||||
|
||||
MMBearer *
|
||||
MMBaseBearer *
|
||||
mm_bearer_list_find (MMBearerList *self,
|
||||
MMBearerProperties *properties)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
for (l = self->priv->bearers; l; l = g_list_next (l)) {
|
||||
if (mm_bearer_properties_cmp (mm_bearer_peek_config (MM_BEARER (l->data)), properties))
|
||||
if (mm_bearer_properties_cmp (mm_base_bearer_peek_config (MM_BASE_BEARER (l->data)), properties))
|
||||
return g_object_ref (l->data);
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ mm_bearer_list_find (MMBearerList *self,
|
||||
typedef struct {
|
||||
GSimpleAsyncResult *result;
|
||||
GList *pending;
|
||||
MMBearer *current;
|
||||
MMBaseBearer *current;
|
||||
} DisconnectAllContext;
|
||||
|
||||
static void
|
||||
@@ -210,13 +210,13 @@ mm_bearer_list_disconnect_all_bearers_finish (MMBearerList *self,
|
||||
static void disconnect_next_bearer (DisconnectAllContext *ctx);
|
||||
|
||||
static void
|
||||
disconnect_ready (MMBearer *bearer,
|
||||
disconnect_ready (MMBaseBearer *bearer,
|
||||
GAsyncResult *res,
|
||||
DisconnectAllContext *ctx)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!mm_bearer_disconnect_finish (bearer, res, &error)) {
|
||||
if (!mm_base_bearer_disconnect_finish (bearer, res, &error)) {
|
||||
g_simple_async_result_take_error (ctx->result, error);
|
||||
disconnect_all_context_complete_and_free (ctx);
|
||||
return;
|
||||
@@ -238,12 +238,12 @@ disconnect_next_bearer (DisconnectAllContext *ctx)
|
||||
return;
|
||||
}
|
||||
|
||||
ctx->current = MM_BEARER (ctx->pending->data);
|
||||
ctx->current = MM_BASE_BEARER (ctx->pending->data);
|
||||
ctx->pending = g_list_delete_link (ctx->pending, ctx->pending);
|
||||
|
||||
mm_bearer_disconnect (ctx->current,
|
||||
(GAsyncReadyCallback)disconnect_ready,
|
||||
ctx);
|
||||
mm_base_bearer_disconnect (ctx->current,
|
||||
(GAsyncReadyCallback)disconnect_ready,
|
||||
ctx);
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "mm-bearer.h"
|
||||
#include "mm-base-bearer.h"
|
||||
|
||||
#define MM_TYPE_BEARER_LIST (mm_bearer_list_get_type ())
|
||||
#define MM_BEARER_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BEARER_LIST, MMBearerList))
|
||||
@@ -60,21 +60,21 @@ guint mm_bearer_list_get_max (MMBearerList *self);
|
||||
guint mm_bearer_list_get_max_active (MMBearerList *self);
|
||||
|
||||
gboolean mm_bearer_list_add_bearer (MMBearerList *self,
|
||||
MMBearer *bearer,
|
||||
MMBaseBearer *bearer,
|
||||
GError **error);
|
||||
gboolean mm_bearer_list_delete_bearer (MMBearerList *self,
|
||||
const gchar *path,
|
||||
GError **error);
|
||||
void mm_bearer_list_delete_all_bearers (MMBearerList *self);
|
||||
|
||||
typedef void (*MMBearerListForeachFunc) (MMBearer *bearer,
|
||||
typedef void (*MMBearerListForeachFunc) (MMBaseBearer *bearer,
|
||||
gpointer user_data);
|
||||
void mm_bearer_list_foreach (MMBearerList *self,
|
||||
MMBearerListForeachFunc func,
|
||||
gpointer user_data);
|
||||
|
||||
MMBearer *mm_bearer_list_find (MMBearerList *self,
|
||||
MMBearerProperties *properties);
|
||||
MMBaseBearer *mm_bearer_list_find (MMBearerList *self,
|
||||
MMBearerProperties *properties);
|
||||
|
||||
void mm_bearer_list_disconnect_all_bearers (MMBearerList *self,
|
||||
GAsyncReadyCallback callback,
|
||||
|
@@ -32,7 +32,7 @@
|
||||
#include "mm-bearer-mbim.h"
|
||||
#include "mm-log.h"
|
||||
|
||||
G_DEFINE_TYPE (MMBearerMbim, mm_bearer_mbim, MM_TYPE_BEARER)
|
||||
G_DEFINE_TYPE (MMBearerMbim, mm_bearer_mbim, MM_TYPE_BASE_BEARER)
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
@@ -61,7 +61,7 @@ peek_ports (gpointer self,
|
||||
MMBaseModem *modem = NULL;
|
||||
|
||||
g_object_get (G_OBJECT (self),
|
||||
MM_BEARER_MODEM, &modem,
|
||||
MM_BASE_BEARER_MODEM, &modem,
|
||||
NULL);
|
||||
g_assert (MM_IS_BASE_MODEM (modem));
|
||||
|
||||
@@ -146,7 +146,7 @@ connect_context_complete_and_free (ConnectContext *ctx)
|
||||
}
|
||||
|
||||
static MMBearerConnectResult *
|
||||
connect_finish (MMBearer *self,
|
||||
connect_finish (MMBaseBearer *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -736,7 +736,7 @@ connect_context_step (ConnectContext *ctx)
|
||||
ip_family == MM_BEARER_IP_FAMILY_ANY) {
|
||||
gchar * str;
|
||||
|
||||
ip_family = mm_bearer_get_default_ip_family (MM_BEARER (ctx->self));
|
||||
ip_family = mm_base_bearer_get_default_ip_family (MM_BASE_BEARER (ctx->self));
|
||||
str = mm_bearer_ip_family_build_string_from_mask (ip_family);
|
||||
mm_dbg ("No specific IP family requested, defaulting to %s", str);
|
||||
g_free (str);
|
||||
@@ -855,7 +855,7 @@ connect_context_step (ConnectContext *ctx)
|
||||
}
|
||||
|
||||
static void
|
||||
_connect (MMBearer *self,
|
||||
_connect (MMBaseBearer *self,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
@@ -870,12 +870,12 @@ _connect (MMBearer *self,
|
||||
return;
|
||||
|
||||
g_object_get (self,
|
||||
MM_BEARER_MODEM, &modem,
|
||||
MM_BASE_BEARER_MODEM, &modem,
|
||||
NULL);
|
||||
g_assert (modem);
|
||||
|
||||
/* Check whether we have an APN */
|
||||
apn = mm_bearer_properties_get_apn (mm_bearer_peek_config (MM_BEARER (self)));
|
||||
apn = mm_bearer_properties_get_apn (mm_base_bearer_peek_config (MM_BASE_BEARER (self)));
|
||||
|
||||
/* Is this a 3GPP only modem and no APN was given? If so, error */
|
||||
if (mm_iface_modem_is_3gpp_only (MM_IFACE_MODEM (modem)) && !apn) {
|
||||
@@ -908,7 +908,7 @@ _connect (MMBearer *self,
|
||||
_connect);
|
||||
|
||||
g_object_get (self,
|
||||
MM_BEARER_CONFIG, &ctx->properties,
|
||||
MM_BASE_BEARER_CONFIG, &ctx->properties,
|
||||
NULL);
|
||||
|
||||
/* Run! */
|
||||
@@ -943,7 +943,7 @@ disconnect_context_complete_and_free (DisconnectContext *ctx)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
disconnect_finish (MMBearer *self,
|
||||
disconnect_finish (MMBaseBearer *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -1074,7 +1074,7 @@ disconnect_context_step (DisconnectContext *ctx)
|
||||
}
|
||||
|
||||
static void
|
||||
disconnect (MMBearer *_self,
|
||||
disconnect (MMBaseBearer *_self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -1126,24 +1126,24 @@ mm_bearer_mbim_get_session_id (MMBearerMbim *self)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMBearer *
|
||||
MMBaseBearer *
|
||||
mm_bearer_mbim_new (MMBroadbandModemMbim *modem,
|
||||
MMBearerProperties *config,
|
||||
guint32 session_id)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
|
||||
/* The Mbim bearer inherits from MMBearer (so it's not a MMBroadbandBearer)
|
||||
/* The Mbim bearer inherits from MMBaseBearer (so it's not a MMBroadbandBearer)
|
||||
* and that means that the object is not async-initable, so we just use
|
||||
* g_object_new() here */
|
||||
bearer = g_object_new (MM_TYPE_BEARER_MBIM,
|
||||
MM_BEARER_MODEM, modem,
|
||||
MM_BEARER_CONFIG, config,
|
||||
MM_BASE_BEARER_MODEM, modem,
|
||||
MM_BASE_BEARER_CONFIG, config,
|
||||
MM_BEARER_MBIM_SESSION_ID, (guint)session_id,
|
||||
NULL);
|
||||
|
||||
/* Only export valid bearers */
|
||||
mm_bearer_export (bearer);
|
||||
mm_base_bearer_export (bearer);
|
||||
|
||||
return bearer;
|
||||
}
|
||||
@@ -1208,7 +1208,7 @@ static void
|
||||
mm_bearer_mbim_class_init (MMBearerMbimClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
MMBearerClass *bearer_class = MM_BEARER_CLASS (klass);
|
||||
MMBaseBearerClass *base_bearer_class = MM_BASE_BEARER_CLASS (klass);
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (MMBearerMbimPrivate));
|
||||
|
||||
@@ -1217,10 +1217,10 @@ mm_bearer_mbim_class_init (MMBearerMbimClass *klass)
|
||||
object_class->get_property = get_property;
|
||||
object_class->set_property = set_property;
|
||||
|
||||
bearer_class->connect = _connect;
|
||||
bearer_class->connect_finish = connect_finish;
|
||||
bearer_class->disconnect = disconnect;
|
||||
bearer_class->disconnect_finish = disconnect_finish;
|
||||
base_bearer_class->connect = _connect;
|
||||
base_bearer_class->connect_finish = connect_finish;
|
||||
base_bearer_class->disconnect = disconnect;
|
||||
base_bearer_class->disconnect_finish = disconnect_finish;
|
||||
|
||||
properties[PROP_SESSION_ID] =
|
||||
g_param_spec_uint (MM_BEARER_MBIM_SESSION_ID,
|
||||
|
@@ -22,7 +22,7 @@
|
||||
#define _LIBMM_INSIDE_MM
|
||||
#include <libmm-glib.h>
|
||||
|
||||
#include "mm-bearer.h"
|
||||
#include "mm-base-bearer.h"
|
||||
#include "mm-broadband-modem-mbim.h"
|
||||
|
||||
#define MM_TYPE_BEARER_MBIM (mm_bearer_mbim_get_type ())
|
||||
@@ -39,21 +39,21 @@ typedef struct _MMBearerMbimClass MMBearerMbimClass;
|
||||
typedef struct _MMBearerMbimPrivate MMBearerMbimPrivate;
|
||||
|
||||
struct _MMBearerMbim {
|
||||
MMBearer parent;
|
||||
MMBaseBearer parent;
|
||||
MMBearerMbimPrivate *priv;
|
||||
};
|
||||
|
||||
struct _MMBearerMbimClass {
|
||||
MMBearerClass parent;
|
||||
MMBaseBearerClass parent;
|
||||
};
|
||||
|
||||
GType mm_bearer_mbim_get_type (void);
|
||||
|
||||
/* MBIM bearer creation implementation.
|
||||
* NOTE it is *not* a broadband bearer, so not async-initable */
|
||||
MMBearer *mm_bearer_mbim_new (MMBroadbandModemMbim *modem,
|
||||
MMBearerProperties *config,
|
||||
guint32 session_id);
|
||||
MMBaseBearer *mm_bearer_mbim_new (MMBroadbandModemMbim *modem,
|
||||
MMBearerProperties *config,
|
||||
guint32 session_id);
|
||||
|
||||
guint32 mm_bearer_mbim_get_session_id (MMBearerMbim *self);
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include "mm-log.h"
|
||||
#include "mm-modem-helpers.h"
|
||||
|
||||
G_DEFINE_TYPE (MMBearerQmi, mm_bearer_qmi, MM_TYPE_BEARER);
|
||||
G_DEFINE_TYPE (MMBearerQmi, mm_bearer_qmi, MM_TYPE_BASE_BEARER);
|
||||
|
||||
#define GLOBAL_PACKET_DATA_HANDLE 0xFFFFFFFF
|
||||
|
||||
@@ -116,7 +116,7 @@ connect_context_complete_and_free (ConnectContext *ctx)
|
||||
}
|
||||
|
||||
static MMBearerConnectResult *
|
||||
connect_finish (MMBearer *self,
|
||||
connect_finish (MMBaseBearer *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -869,7 +869,7 @@ connect_context_step (ConnectContext *ctx)
|
||||
}
|
||||
|
||||
static void
|
||||
_connect (MMBearer *self,
|
||||
_connect (MMBaseBearer *self,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
@@ -883,7 +883,7 @@ _connect (MMBearer *self,
|
||||
const gchar *apn;
|
||||
|
||||
g_object_get (self,
|
||||
MM_BEARER_MODEM, &modem,
|
||||
MM_BASE_BEARER_MODEM, &modem,
|
||||
NULL);
|
||||
g_assert (modem);
|
||||
|
||||
@@ -915,7 +915,7 @@ _connect (MMBearer *self,
|
||||
}
|
||||
|
||||
/* Check whether we have an APN */
|
||||
apn = mm_bearer_properties_get_apn (mm_bearer_peek_config (MM_BEARER (self)));
|
||||
apn = mm_bearer_properties_get_apn (mm_base_bearer_peek_config (MM_BASE_BEARER (self)));
|
||||
|
||||
/* Is this a 3GPP only modem and no APN was given? If so, error */
|
||||
if (mm_iface_modem_is_3gpp_only (MM_IFACE_MODEM (modem)) && !apn) {
|
||||
@@ -963,7 +963,7 @@ _connect (MMBearer *self,
|
||||
connect);
|
||||
|
||||
g_object_get (self,
|
||||
MM_BEARER_CONFIG, &properties,
|
||||
MM_BASE_BEARER_CONFIG, &properties,
|
||||
NULL);
|
||||
|
||||
if (properties) {
|
||||
@@ -979,7 +979,7 @@ _connect (MMBearer *self,
|
||||
ip_family == MM_BEARER_IP_FAMILY_ANY) {
|
||||
gchar *ip_family_str;
|
||||
|
||||
ip_family = mm_bearer_get_default_ip_family (self);
|
||||
ip_family = mm_base_bearer_get_default_ip_family (self);
|
||||
ip_family_str = mm_bearer_ip_family_build_string_from_mask (ip_family);
|
||||
mm_dbg ("No specific IP family requested, defaulting to %s",
|
||||
ip_family_str);
|
||||
@@ -1088,7 +1088,7 @@ disconnect_context_complete_and_free (DisconnectContext *ctx)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
disconnect_finish (MMBearer *self,
|
||||
disconnect_finish (MMBaseBearer *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -1236,7 +1236,7 @@ disconnect_context_step (DisconnectContext *ctx)
|
||||
}
|
||||
|
||||
static void
|
||||
disconnect (MMBearer *_self,
|
||||
disconnect (MMBaseBearer *_self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -1276,7 +1276,7 @@ disconnect (MMBearer *_self,
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
report_connection_status (MMBearer *self,
|
||||
report_connection_status (MMBaseBearer *self,
|
||||
MMBearerConnectionStatus status)
|
||||
{
|
||||
if (status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED)
|
||||
@@ -1284,27 +1284,27 @@ report_connection_status (MMBearer *self,
|
||||
reset_bearer_connection (MM_BEARER_QMI (self), TRUE, TRUE);
|
||||
|
||||
/* Chain up parent's report_connection_status() */
|
||||
MM_BEARER_CLASS (mm_bearer_qmi_parent_class)->report_connection_status (self, status);
|
||||
MM_BASE_BEARER_CLASS (mm_bearer_qmi_parent_class)->report_connection_status (self, status);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
MMBearer *
|
||||
MMBaseBearer *
|
||||
mm_bearer_qmi_new (MMBroadbandModemQmi *modem,
|
||||
MMBearerProperties *config)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
|
||||
/* The Qmi bearer inherits from MMBearer (so it's not a MMBroadbandBearer)
|
||||
/* The Qmi bearer inherits from MMBaseBearer (so it's not a MMBroadbandBearer)
|
||||
* and that means that the object is not async-initable, so we just use
|
||||
* g_object_new() here */
|
||||
bearer = g_object_new (MM_TYPE_BEARER_QMI,
|
||||
MM_BEARER_MODEM, modem,
|
||||
MM_BEARER_CONFIG, config,
|
||||
MM_BASE_BEARER_MODEM, modem,
|
||||
MM_BASE_BEARER_CONFIG, config,
|
||||
NULL);
|
||||
|
||||
/* Only export valid bearers */
|
||||
mm_bearer_export (bearer);
|
||||
mm_base_bearer_export (bearer);
|
||||
|
||||
return bearer;
|
||||
}
|
||||
@@ -1334,16 +1334,16 @@ static void
|
||||
mm_bearer_qmi_class_init (MMBearerQmiClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
MMBearerClass *bearer_class = MM_BEARER_CLASS (klass);
|
||||
MMBaseBearerClass *base_bearer_class = MM_BASE_BEARER_CLASS (klass);
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (MMBearerQmiPrivate));
|
||||
|
||||
/* Virtual methods */
|
||||
object_class->dispose = dispose;
|
||||
|
||||
bearer_class->connect = _connect;
|
||||
bearer_class->connect_finish = connect_finish;
|
||||
bearer_class->disconnect = disconnect;
|
||||
bearer_class->disconnect_finish = disconnect_finish;
|
||||
bearer_class->report_connection_status = report_connection_status;
|
||||
base_bearer_class->connect = _connect;
|
||||
base_bearer_class->connect_finish = connect_finish;
|
||||
base_bearer_class->disconnect = disconnect;
|
||||
base_bearer_class->disconnect_finish = disconnect_finish;
|
||||
base_bearer_class->report_connection_status = report_connection_status;
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@
|
||||
#define _LIBMM_INSIDE_MM
|
||||
#include <libmm-glib.h>
|
||||
|
||||
#include "mm-bearer.h"
|
||||
#include "mm-base-bearer.h"
|
||||
#include "mm-broadband-modem-qmi.h"
|
||||
|
||||
#define MM_TYPE_BEARER_QMI (mm_bearer_qmi_get_type ())
|
||||
@@ -39,19 +39,19 @@ typedef struct _MMBearerQmiClass MMBearerQmiClass;
|
||||
typedef struct _MMBearerQmiPrivate MMBearerQmiPrivate;
|
||||
|
||||
struct _MMBearerQmi {
|
||||
MMBearer parent;
|
||||
MMBaseBearer parent;
|
||||
MMBearerQmiPrivate *priv;
|
||||
};
|
||||
|
||||
struct _MMBearerQmiClass {
|
||||
MMBearerClass parent;
|
||||
MMBaseBearerClass parent;
|
||||
};
|
||||
|
||||
GType mm_bearer_qmi_get_type (void);
|
||||
|
||||
/* QMI bearer creation implementation.
|
||||
* NOTE it is *not* a broadband bearer, so not async-initable */
|
||||
MMBearer *mm_bearer_qmi_new (MMBroadbandModemQmi *modem,
|
||||
MMBearerProperties *config);
|
||||
MMBaseBearer *mm_bearer_qmi_new (MMBroadbandModemQmi *modem,
|
||||
MMBearerProperties *config);
|
||||
|
||||
#endif /* MM_BEARER_QMI_H */
|
||||
|
@@ -38,7 +38,7 @@
|
||||
|
||||
static void async_initable_iface_init (GAsyncInitableIface *iface);
|
||||
|
||||
G_DEFINE_TYPE_EXTENDED (MMBroadbandBearer, mm_broadband_bearer, MM_TYPE_BEARER, 0,
|
||||
G_DEFINE_TYPE_EXTENDED (MMBroadbandBearer, mm_broadband_bearer, MM_TYPE_BASE_BEARER, 0,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE,
|
||||
async_initable_iface_init));
|
||||
|
||||
@@ -167,12 +167,12 @@ detailed_connect_context_new (MMBroadbandBearer *self,
|
||||
user_data,
|
||||
detailed_connect_context_new);
|
||||
|
||||
ctx->ip_family = mm_bearer_properties_get_ip_type (mm_bearer_peek_config (MM_BEARER (self)));
|
||||
ctx->ip_family = mm_bearer_properties_get_ip_type (mm_base_bearer_peek_config (MM_BASE_BEARER (self)));
|
||||
if (ctx->ip_family == MM_BEARER_IP_FAMILY_NONE ||
|
||||
ctx->ip_family == MM_BEARER_IP_FAMILY_ANY) {
|
||||
gchar *default_family;
|
||||
|
||||
ctx->ip_family = mm_bearer_get_default_ip_family (MM_BEARER (self));
|
||||
ctx->ip_family = mm_base_bearer_get_default_ip_family (MM_BASE_BEARER (self));
|
||||
default_family = mm_bearer_ip_family_build_string_from_mask (ctx->ip_family);
|
||||
mm_dbg ("No specific IP family requested, defaulting to %s", default_family);
|
||||
g_free (default_family);
|
||||
@@ -272,7 +272,7 @@ 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)));
|
||||
number = mm_bearer_properties_get_number (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
|
||||
/* If a number was given when creating the bearer, use that one.
|
||||
* Otherwise, use the default one, #777
|
||||
@@ -351,14 +351,14 @@ current_rm_protocol_ready (MMBaseModem *self,
|
||||
return;
|
||||
}
|
||||
|
||||
if (current_rm != mm_bearer_properties_get_rm_protocol (mm_bearer_peek_config (MM_BEARER (self)))) {
|
||||
if (current_rm != mm_bearer_properties_get_rm_protocol (mm_base_bearer_peek_config (MM_BASE_BEARER (self)))) {
|
||||
guint new_index;
|
||||
gchar *command;
|
||||
|
||||
mm_dbg ("Setting requested RM protocol...");
|
||||
|
||||
new_index = (mm_cdma_get_index_from_rm_protocol (
|
||||
mm_bearer_properties_get_rm_protocol (mm_bearer_peek_config (MM_BEARER (self))),
|
||||
mm_bearer_properties_get_rm_protocol (mm_base_bearer_peek_config (MM_BASE_BEARER (self))),
|
||||
&error));
|
||||
if (error) {
|
||||
mm_warn ("Cannot set RM protocol: '%s'",
|
||||
@@ -419,7 +419,7 @@ connect_cdma (MMBroadbandBearer *self,
|
||||
ctx->close_data_on_exit = TRUE;
|
||||
|
||||
if (mm_bearer_properties_get_rm_protocol (
|
||||
mm_bearer_peek_config (MM_BEARER (self))) !=
|
||||
mm_base_bearer_peek_config (MM_BASE_BEARER (self))) !=
|
||||
MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN) {
|
||||
/* Need to query current RM protocol */
|
||||
mm_dbg ("Querying current RM protocol set...");
|
||||
@@ -828,7 +828,7 @@ find_cid_ready (MMBaseModem *modem,
|
||||
}
|
||||
|
||||
/* Otherwise, initialize a new PDP context with our APN */
|
||||
apn = mm_port_serial_at_quote_string (mm_bearer_properties_get_apn (mm_bearer_peek_config (MM_BEARER (ctx->self))));
|
||||
apn = mm_port_serial_at_quote_string (mm_bearer_properties_get_apn (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))));
|
||||
command = g_strdup_printf ("+CGDCONT=%u,\"%s\",%s",
|
||||
ctx->cid,
|
||||
pdp_type,
|
||||
@@ -984,7 +984,7 @@ parse_pdp_list (MMBaseModem *modem,
|
||||
} else {
|
||||
const gchar *apn;
|
||||
|
||||
apn = mm_bearer_properties_get_apn (mm_bearer_peek_config (MM_BEARER (ctx->self)));
|
||||
apn = mm_bearer_properties_get_apn (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
if (apn && g_str_equal (pdp->apn, apn)) {
|
||||
gchar *ip_family_str;
|
||||
|
||||
@@ -1070,7 +1070,7 @@ connect_context_complete_and_free (ConnectContext *ctx)
|
||||
}
|
||||
|
||||
static MMBearerConnectResult *
|
||||
connect_finish (MMBearer *self,
|
||||
connect_finish (MMBaseBearer *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -1138,7 +1138,7 @@ connect_3gpp_ready (MMBroadbandBearer *self,
|
||||
}
|
||||
|
||||
static void
|
||||
connect (MMBearer *self,
|
||||
connect (MMBaseBearer *self,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
@@ -1162,7 +1162,7 @@ connect (MMBearer *self,
|
||||
|
||||
/* Get the owner modem object */
|
||||
g_object_get (self,
|
||||
MM_BEARER_MODEM, &modem,
|
||||
MM_BASE_BEARER_MODEM, &modem,
|
||||
NULL);
|
||||
g_assert (modem != NULL);
|
||||
|
||||
@@ -1213,7 +1213,7 @@ connect (MMBearer *self,
|
||||
*/
|
||||
|
||||
/* Check whether we have an APN */
|
||||
apn = mm_bearer_properties_get_apn (mm_bearer_peek_config (MM_BEARER (self)));
|
||||
apn = mm_bearer_properties_get_apn (mm_base_bearer_peek_config (MM_BASE_BEARER (self)));
|
||||
|
||||
/* Is this a 3GPP only modem and no APN was given? If so, error */
|
||||
if (mm_iface_modem_is_3gpp_only (MM_IFACE_MODEM (modem)) && !apn) {
|
||||
@@ -1665,7 +1665,7 @@ disconnect_context_complete_and_free (DisconnectContext *ctx)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
disconnect_finish (MMBearer *self,
|
||||
disconnect_finish (MMBaseBearer *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -1742,7 +1742,7 @@ disconnect_3gpp_ready (MMBroadbandBearer *self,
|
||||
}
|
||||
|
||||
static void
|
||||
disconnect (MMBearer *self,
|
||||
disconnect (MMBaseBearer *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -1762,7 +1762,7 @@ disconnect (MMBearer *self,
|
||||
}
|
||||
|
||||
g_object_get (self,
|
||||
MM_BEARER_MODEM, &modem,
|
||||
MM_BASE_BEARER_MODEM, &modem,
|
||||
NULL);
|
||||
g_assert (modem != NULL);
|
||||
|
||||
@@ -1823,7 +1823,7 @@ disconnect (MMBearer *self,
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
report_connection_status (MMBearer *self,
|
||||
report_connection_status (MMBaseBearer *self,
|
||||
MMBearerConnectionStatus status)
|
||||
{
|
||||
if (status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED)
|
||||
@@ -1831,7 +1831,7 @@ report_connection_status (MMBearer *self,
|
||||
reset_bearer_connection (MM_BROADBAND_BEARER (self));
|
||||
|
||||
/* Chain up parent's report_connection_status() */
|
||||
MM_BEARER_CLASS (mm_broadband_bearer_parent_class)->report_connection_status (
|
||||
MM_BASE_BEARER_CLASS (mm_broadband_bearer_parent_class)->report_connection_status (
|
||||
self,
|
||||
status);
|
||||
}
|
||||
@@ -1873,7 +1873,7 @@ init_async_context_free (InitAsyncContext *ctx,
|
||||
g_free (ctx);
|
||||
}
|
||||
|
||||
MMBearer *
|
||||
MMBaseBearer *
|
||||
mm_broadband_bearer_new_finish (GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
@@ -1888,9 +1888,9 @@ mm_broadband_bearer_new_finish (GAsyncResult *res,
|
||||
return NULL;
|
||||
|
||||
/* Only export valid bearers */
|
||||
mm_bearer_export (MM_BEARER (bearer));
|
||||
mm_base_bearer_export (MM_BASE_BEARER (bearer));
|
||||
|
||||
return MM_BEARER (bearer);
|
||||
return MM_BASE_BEARER (bearer);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -1923,7 +1923,7 @@ crm_range_ready (MMBaseModem *modem,
|
||||
&error)) {
|
||||
MMModemCdmaRmProtocol current;
|
||||
|
||||
current = mm_bearer_properties_get_rm_protocol (mm_bearer_peek_config (MM_BEARER (ctx->self)));
|
||||
current = mm_bearer_properties_get_rm_protocol (mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self)));
|
||||
/* Check if value within the range */
|
||||
if (current >= min &&
|
||||
current <= max) {
|
||||
@@ -1960,7 +1960,7 @@ interface_initialization_step (InitAsyncContext *ctx)
|
||||
* supported. */
|
||||
if (mm_iface_modem_is_cdma (MM_IFACE_MODEM (ctx->modem)) &&
|
||||
mm_bearer_properties_get_rm_protocol (
|
||||
mm_bearer_peek_config (MM_BEARER (ctx->self))) != MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN) {
|
||||
mm_base_bearer_peek_config (MM_BASE_BEARER (ctx->self))) != MM_MODEM_CDMA_RM_PROTOCOL_UNKNOWN) {
|
||||
mm_base_modem_at_command_full (ctx->modem,
|
||||
ctx->port,
|
||||
"+CRM=?",
|
||||
@@ -2008,7 +2008,7 @@ initable_init_async (GAsyncInitable *initable,
|
||||
NULL);
|
||||
|
||||
g_object_get (initable,
|
||||
MM_BEARER_MODEM, &ctx->modem,
|
||||
MM_BASE_BEARER_MODEM, &ctx->modem,
|
||||
NULL);
|
||||
|
||||
ctx->port = mm_base_modem_get_port_primary (ctx->modem);
|
||||
@@ -2045,8 +2045,8 @@ mm_broadband_bearer_new (MMBroadbandModem *modem,
|
||||
cancellable,
|
||||
callback,
|
||||
user_data,
|
||||
MM_BEARER_MODEM, modem,
|
||||
MM_BEARER_CONFIG, properties,
|
||||
MM_BASE_BEARER_MODEM, modem,
|
||||
MM_BASE_BEARER_CONFIG, properties,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -2083,18 +2083,18 @@ static void
|
||||
mm_broadband_bearer_class_init (MMBroadbandBearerClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
MMBearerClass *bearer_class = MM_BEARER_CLASS (klass);
|
||||
MMBaseBearerClass *base_bearer_class = MM_BASE_BEARER_CLASS (klass);
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (MMBroadbandBearerPrivate));
|
||||
|
||||
/* Virtual methods */
|
||||
object_class->dispose = dispose;
|
||||
|
||||
bearer_class->connect = connect;
|
||||
bearer_class->connect_finish = connect_finish;
|
||||
bearer_class->disconnect = disconnect;
|
||||
bearer_class->disconnect_finish = disconnect_finish;
|
||||
bearer_class->report_connection_status = report_connection_status;
|
||||
base_bearer_class->connect = connect;
|
||||
base_bearer_class->connect_finish = connect_finish;
|
||||
base_bearer_class->disconnect = disconnect;
|
||||
base_bearer_class->disconnect_finish = disconnect_finish;
|
||||
base_bearer_class->report_connection_status = report_connection_status;
|
||||
|
||||
klass->connect_3gpp = connect_3gpp;
|
||||
klass->connect_3gpp_finish = detailed_connect_finish;
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#define _LIBMM_INSIDE_MM
|
||||
#include <libmm-glib.h>
|
||||
|
||||
#include "mm-bearer.h"
|
||||
#include "mm-base-bearer.h"
|
||||
#include "mm-broadband-modem.h"
|
||||
|
||||
#define MM_TYPE_BROADBAND_BEARER (mm_broadband_bearer_get_type ())
|
||||
@@ -40,12 +40,12 @@ typedef struct _MMBroadbandBearerClass MMBroadbandBearerClass;
|
||||
typedef struct _MMBroadbandBearerPrivate MMBroadbandBearerPrivate;
|
||||
|
||||
struct _MMBroadbandBearer {
|
||||
MMBearer parent;
|
||||
MMBaseBearer parent;
|
||||
MMBroadbandBearerPrivate *priv;
|
||||
};
|
||||
|
||||
struct _MMBroadbandBearerClass {
|
||||
MMBearerClass parent;
|
||||
MMBaseBearerClass parent;
|
||||
|
||||
/* Full 3GPP connection sequence */
|
||||
void (* connect_3gpp) (MMBroadbandBearer *self,
|
||||
@@ -129,14 +129,14 @@ struct _MMBroadbandBearerClass {
|
||||
GType mm_broadband_bearer_get_type (void);
|
||||
|
||||
/* Default 3GPP bearer creation implementation */
|
||||
void mm_broadband_bearer_new (MMBroadbandModem *modem,
|
||||
MMBearerProperties *properties,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBearer *mm_broadband_bearer_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_broadband_bearer_new (MMBroadbandModem *modem,
|
||||
MMBearerProperties *properties,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseBearer *mm_broadband_bearer_new_finish (GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
guint mm_broadband_bearer_get_3gpp_cid (MMBroadbandBearer *self);
|
||||
guint mm_broadband_bearer_get_3gpp_cid (MMBroadbandBearer *self);
|
||||
|
||||
#endif /* MM_BROADBAND_BEARER_H */
|
||||
|
@@ -1054,15 +1054,15 @@ modem_power_up (MMIfaceModem *self,
|
||||
/*****************************************************************************/
|
||||
/* Create Bearer (Modem interface) */
|
||||
|
||||
static MMBearer *
|
||||
static MMBaseBearer *
|
||||
modem_create_bearer_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
|
||||
bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res));
|
||||
mm_dbg ("New bearer created at DBus path '%s'", mm_bearer_get_path (bearer));
|
||||
mm_dbg ("New bearer created at DBus path '%s'", mm_base_bearer_get_path (bearer));
|
||||
|
||||
return g_object_ref (bearer);
|
||||
}
|
||||
@@ -1073,7 +1073,7 @@ typedef struct {
|
||||
} FindSessionId;
|
||||
|
||||
static void
|
||||
bearer_list_session_id_foreach (MMBearer *bearer,
|
||||
bearer_list_session_id_foreach (MMBaseBearer *bearer,
|
||||
gpointer user_data)
|
||||
{
|
||||
FindSessionId *ctx = user_data;
|
||||
@@ -1124,7 +1124,7 @@ modem_create_bearer (MMIfaceModem *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
GSimpleAsyncResult *result;
|
||||
gint session_id;
|
||||
|
||||
@@ -1632,15 +1632,15 @@ typedef struct {
|
||||
} ReportDisconnectedStatusContext;
|
||||
|
||||
static void
|
||||
bearer_list_report_disconnected_status (MMBearer *bearer,
|
||||
bearer_list_report_disconnected_status (MMBaseBearer *bearer,
|
||||
gpointer user_data)
|
||||
{
|
||||
ReportDisconnectedStatusContext *ctx = user_data;
|
||||
|
||||
if (MM_IS_BEARER_MBIM (bearer) &&
|
||||
mm_bearer_mbim_get_session_id (MM_BEARER_MBIM (bearer)) == ctx->session_id) {
|
||||
mm_dbg ("Bearer '%s' was disconnected.", mm_bearer_get_path (bearer));
|
||||
mm_bearer_report_connection_status (bearer, MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
|
||||
mm_dbg ("Bearer '%s' was disconnected.", mm_base_bearer_get_path (bearer));
|
||||
mm_base_bearer_report_connection_status (bearer, MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -288,15 +288,15 @@ power_cycle (MMBroadbandModemQmi *self,
|
||||
/*****************************************************************************/
|
||||
/* Create Bearer (Modem interface) */
|
||||
|
||||
static MMBearer *
|
||||
static MMBaseBearer *
|
||||
modem_create_bearer_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
|
||||
bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res));
|
||||
mm_dbg ("New bearer created at DBus path '%s'", mm_bearer_get_path (bearer));
|
||||
mm_dbg ("New bearer created at DBus path '%s'", mm_base_bearer_get_path (bearer));
|
||||
|
||||
return g_object_ref (bearer);
|
||||
}
|
||||
@@ -307,7 +307,7 @@ modem_create_bearer (MMIfaceModem *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
GSimpleAsyncResult *result;
|
||||
|
||||
/* Set a new ref to the bearer object as result */
|
||||
@@ -318,9 +318,7 @@ modem_create_bearer (MMIfaceModem *self,
|
||||
|
||||
/* We just create a MMBearerQmi */
|
||||
mm_dbg ("Creating QMI bearer in QMI modem");
|
||||
bearer = mm_bearer_qmi_new (MM_BROADBAND_MODEM_QMI (self),
|
||||
properties);
|
||||
|
||||
bearer = mm_bearer_qmi_new (MM_BROADBAND_MODEM_QMI (self), properties);
|
||||
g_simple_async_result_set_op_res_gpointer (result, bearer, g_object_unref);
|
||||
g_simple_async_result_complete_in_idle (result);
|
||||
g_object_unref (result);
|
||||
|
@@ -233,18 +233,18 @@ response_processor_string_ignore_at_errors (MMBaseModem *self,
|
||||
/*****************************************************************************/
|
||||
/* Create Bearer (Modem interface) */
|
||||
|
||||
static MMBearer *
|
||||
static MMBaseBearer *
|
||||
modem_create_bearer_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
|
||||
if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error))
|
||||
return NULL;
|
||||
|
||||
bearer = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res));
|
||||
mm_dbg ("New bearer created at DBus path '%s'", mm_bearer_get_path (bearer));
|
||||
mm_dbg ("New bearer created at DBus path '%s'", mm_base_bearer_get_path (bearer));
|
||||
|
||||
return g_object_ref (bearer);
|
||||
}
|
||||
@@ -254,7 +254,7 @@ broadband_bearer_new_ready (GObject *source,
|
||||
GAsyncResult *res,
|
||||
GSimpleAsyncResult *simple)
|
||||
{
|
||||
MMBearer *bearer = NULL;
|
||||
MMBaseBearer *bearer = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
bearer = mm_broadband_bearer_new_finish (res, &error);
|
||||
|
@@ -191,7 +191,7 @@ typedef struct {
|
||||
MMSimpleConnectProperties *properties;
|
||||
|
||||
/* Results to set */
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
} ConnectionContext;
|
||||
|
||||
static void
|
||||
@@ -211,13 +211,13 @@ connection_context_free (ConnectionContext *ctx)
|
||||
static void connection_step (ConnectionContext *ctx);
|
||||
|
||||
static void
|
||||
connect_bearer_ready (MMBearer *bearer,
|
||||
connect_bearer_ready (MMBaseBearer *bearer,
|
||||
GAsyncResult *res,
|
||||
ConnectionContext *ctx)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!mm_bearer_connect_finish (bearer, res, &error)) {
|
||||
if (!mm_base_bearer_connect_finish (bearer, res, &error)) {
|
||||
mm_dbg ("Couldn't connect bearer: '%s'", error->message);
|
||||
g_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||
connection_context_free (ctx);
|
||||
@@ -415,18 +415,18 @@ update_lock_info_ready (MMIfaceModem *self,
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
MMBearer *found;
|
||||
MMBaseBearer *found;
|
||||
} BearerListFindContext;
|
||||
|
||||
static void
|
||||
bearer_list_find_disconnected (MMBearer *bearer,
|
||||
bearer_list_find_disconnected (MMBaseBearer *bearer,
|
||||
BearerListFindContext *ctx)
|
||||
{
|
||||
/* If already marked one to remove, do nothing */
|
||||
if (ctx->found)
|
||||
return;
|
||||
|
||||
if (mm_bearer_get_status (bearer) == MM_BEARER_STATUS_DISCONNECTED)
|
||||
if (mm_base_bearer_get_status (bearer) == MM_BEARER_STATUS_DISCONNECTED)
|
||||
ctx->found = g_object_ref (bearer);
|
||||
}
|
||||
|
||||
@@ -534,15 +534,15 @@ connection_step (ConnectionContext *ctx)
|
||||
GError *error = NULL;
|
||||
|
||||
if (!mm_bearer_list_delete_bearer (list,
|
||||
mm_bearer_get_path (foreach_ctx.found),
|
||||
mm_base_bearer_get_path (foreach_ctx.found),
|
||||
&error)) {
|
||||
mm_dbg ("Couldn't delete disconnected bearer at '%s': '%s'",
|
||||
mm_bearer_get_path (foreach_ctx.found),
|
||||
mm_base_bearer_get_path (foreach_ctx.found),
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
} else
|
||||
mm_dbg ("Deleted disconnected bearer at '%s'",
|
||||
mm_bearer_get_path (foreach_ctx.found));
|
||||
mm_base_bearer_get_path (foreach_ctx.found));
|
||||
g_object_unref (foreach_ctx.found);
|
||||
}
|
||||
|
||||
@@ -571,7 +571,7 @@ connection_step (ConnectionContext *ctx)
|
||||
}
|
||||
|
||||
mm_dbg ("Using already existing bearer at '%s'...",
|
||||
mm_bearer_get_path (ctx->bearer));
|
||||
mm_base_bearer_get_path (ctx->bearer));
|
||||
g_object_unref (list);
|
||||
g_object_unref (bearer_properties);
|
||||
/* Fall down to next step */
|
||||
@@ -584,15 +584,15 @@ connection_step (ConnectionContext *ctx)
|
||||
|
||||
/* Wait... if we're already using an existing bearer, we need to check if it is
|
||||
* already connected; and if so, just don't do anything else */
|
||||
if (mm_bearer_get_status (ctx->bearer) != MM_BEARER_STATUS_CONNECTED) {
|
||||
mm_bearer_connect (ctx->bearer,
|
||||
(GAsyncReadyCallback)connect_bearer_ready,
|
||||
ctx);
|
||||
if (mm_base_bearer_get_status (ctx->bearer) != MM_BEARER_STATUS_CONNECTED) {
|
||||
mm_base_bearer_connect (ctx->bearer,
|
||||
(GAsyncReadyCallback)connect_bearer_ready,
|
||||
ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
mm_dbg ("Bearer at '%s' is already connected...",
|
||||
mm_bearer_get_path (ctx->bearer));
|
||||
mm_base_bearer_get_path (ctx->bearer));
|
||||
|
||||
/* Fall down to next step */
|
||||
ctx->step++;
|
||||
@@ -604,7 +604,7 @@ connection_step (ConnectionContext *ctx)
|
||||
mm_gdbus_modem_simple_complete_connect (
|
||||
ctx->skeleton,
|
||||
ctx->invocation,
|
||||
mm_bearer_get_path (ctx->bearer));
|
||||
mm_base_bearer_get_path (ctx->bearer));
|
||||
connection_context_free (ctx);
|
||||
return;
|
||||
}
|
||||
@@ -748,7 +748,7 @@ typedef struct {
|
||||
GDBusMethodInvocation *invocation;
|
||||
gchar *bearer_path;
|
||||
GList *bearers;
|
||||
MMBearer *current;
|
||||
MMBaseBearer *current;
|
||||
} DisconnectionContext;
|
||||
|
||||
static void
|
||||
@@ -767,13 +767,13 @@ disconnection_context_free (DisconnectionContext *ctx)
|
||||
static void disconnect_next_bearer (DisconnectionContext *ctx);
|
||||
|
||||
static void
|
||||
disconnect_ready (MMBearer *bearer,
|
||||
disconnect_ready (MMBaseBearer *bearer,
|
||||
GAsyncResult *res,
|
||||
DisconnectionContext *ctx)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
if (!mm_bearer_disconnect_finish (bearer, res, &error)) {
|
||||
if (!mm_base_bearer_disconnect_finish (bearer, res, &error)) {
|
||||
g_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||
disconnection_context_free (ctx);
|
||||
return;
|
||||
@@ -796,20 +796,20 @@ disconnect_next_bearer (DisconnectionContext *ctx)
|
||||
return;
|
||||
}
|
||||
|
||||
ctx->current = MM_BEARER (ctx->bearers->data);
|
||||
ctx->current = MM_BASE_BEARER (ctx->bearers->data);
|
||||
ctx->bearers = g_list_delete_link (ctx->bearers, ctx->bearers);
|
||||
|
||||
mm_bearer_disconnect (ctx->current,
|
||||
(GAsyncReadyCallback)disconnect_ready,
|
||||
ctx);
|
||||
mm_base_bearer_disconnect (ctx->current,
|
||||
(GAsyncReadyCallback)disconnect_ready,
|
||||
ctx);
|
||||
}
|
||||
|
||||
static void
|
||||
build_connected_bearer_list (MMBearer *bearer,
|
||||
build_connected_bearer_list (MMBaseBearer *bearer,
|
||||
DisconnectionContext *ctx)
|
||||
{
|
||||
if (!ctx->bearer_path ||
|
||||
g_str_equal (ctx->bearer_path, mm_bearer_get_path (bearer)))
|
||||
g_str_equal (ctx->bearer_path, mm_base_bearer_get_path (bearer)))
|
||||
ctx->bearers = g_list_prepend (ctx->bearers, g_object_ref (bearer));
|
||||
}
|
||||
|
||||
|
@@ -378,23 +378,23 @@ bearer_list_updated (MMBearerList *bearer_list,
|
||||
static MMModemState get_current_consolidated_state (MMIfaceModem *self, MMModemState modem_state);
|
||||
|
||||
typedef struct {
|
||||
MMBearer *self;
|
||||
MMBaseBearer *self;
|
||||
guint others_connected;
|
||||
} CountOthersConnectedContext;
|
||||
|
||||
static void
|
||||
bearer_list_count_others_connected (MMBearer *bearer,
|
||||
bearer_list_count_others_connected (MMBaseBearer *bearer,
|
||||
CountOthersConnectedContext *ctx)
|
||||
{
|
||||
/* We can safely compare pointers here */
|
||||
if (bearer != ctx->self &&
|
||||
mm_bearer_get_status (bearer) == MM_BEARER_STATUS_CONNECTED) {
|
||||
mm_base_bearer_get_status (bearer) == MM_BEARER_STATUS_CONNECTED) {
|
||||
ctx->others_connected++;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
bearer_status_changed (MMBearer *bearer,
|
||||
bearer_status_changed (MMBaseBearer *bearer,
|
||||
GParamSpec *pspec,
|
||||
MMIfaceModem *self)
|
||||
{
|
||||
@@ -429,7 +429,7 @@ bearer_status_changed (MMBearer *bearer,
|
||||
if (!ctx.others_connected) {
|
||||
MMModemState new_state = MM_MODEM_STATE_UNKNOWN;
|
||||
|
||||
switch (mm_bearer_get_status (bearer)) {
|
||||
switch (mm_base_bearer_get_status (bearer)) {
|
||||
case MM_BEARER_STATUS_CONNECTED:
|
||||
new_state = MM_MODEM_STATE_CONNECTED;
|
||||
break;
|
||||
@@ -469,7 +469,7 @@ create_bearer_context_complete_and_free (CreateBearerContext *ctx)
|
||||
g_slice_free (CreateBearerContext, ctx);
|
||||
}
|
||||
|
||||
MMBearer *
|
||||
MMBaseBearer *
|
||||
mm_iface_modem_create_bearer_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
@@ -485,7 +485,7 @@ create_bearer_ready (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
CreateBearerContext *ctx)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
GError *error = NULL;
|
||||
|
||||
bearer = MM_IFACE_MODEM_GET_INTERFACE (self)->create_bearer_finish (self, res, &error);
|
||||
@@ -505,7 +505,7 @@ create_bearer_ready (MMIfaceModem *self,
|
||||
/* If bearer properly created and added to the list, follow its
|
||||
* status */
|
||||
g_signal_connect (bearer,
|
||||
"notify::" MM_BEARER_STATUS,
|
||||
"notify::" MM_BASE_BEARER_STATUS,
|
||||
(GCallback)bearer_status_changed,
|
||||
self);
|
||||
g_simple_async_result_set_op_res_gpointer (ctx->result, bearer, g_object_unref);
|
||||
@@ -579,7 +579,7 @@ handle_create_bearer_ready (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
HandleCreateBearerContext *ctx)
|
||||
{
|
||||
MMBearer *bearer;
|
||||
MMBaseBearer *bearer;
|
||||
GError *error = NULL;
|
||||
|
||||
bearer = mm_iface_modem_create_bearer_finish (self, res, &error);
|
||||
@@ -588,7 +588,7 @@ handle_create_bearer_ready (MMIfaceModem *self,
|
||||
else {
|
||||
mm_gdbus_modem_complete_create_bearer (ctx->skeleton,
|
||||
ctx->invocation,
|
||||
mm_bearer_get_path (bearer));
|
||||
mm_base_bearer_get_path (bearer));
|
||||
g_object_unref (bearer);
|
||||
}
|
||||
|
||||
@@ -1329,10 +1329,10 @@ periodic_signal_quality_check_enable (MMIfaceModem *self)
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
bearer_list_count_connected (MMBearer *bearer,
|
||||
bearer_list_count_connected (MMBaseBearer *bearer,
|
||||
guint *count)
|
||||
{
|
||||
if (mm_bearer_get_status (bearer) == MM_BEARER_STATUS_CONNECTED)
|
||||
if (mm_base_bearer_get_status (bearer) == MM_BEARER_STATUS_CONNECTED)
|
||||
(*count)++;
|
||||
}
|
||||
|
||||
|
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "mm-charsets.h"
|
||||
#include "mm-port-serial-at.h"
|
||||
#include "mm-bearer.h"
|
||||
#include "mm-base-bearer.h"
|
||||
#include "mm-sim.h"
|
||||
|
||||
#define MM_TYPE_IFACE_MODEM (mm_iface_modem_get_type ())
|
||||
@@ -324,9 +324,9 @@ struct _MMIfaceModem {
|
||||
MMBearerProperties *properties,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBearer * (*create_bearer_finish) (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
MMBaseBearer * (*create_bearer_finish) (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
};
|
||||
|
||||
GType mm_iface_modem_get_type (void);
|
||||
@@ -462,13 +462,13 @@ gboolean mm_iface_modem_set_current_bands_finish (MMIfaceModem *self,
|
||||
GError **error);
|
||||
|
||||
/* Allow creating bearers */
|
||||
void mm_iface_modem_create_bearer (MMIfaceModem *self,
|
||||
MMBearerProperties *properties,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBearer *mm_iface_modem_create_bearer_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
void mm_iface_modem_create_bearer (MMIfaceModem *self,
|
||||
MMBearerProperties *properties,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
MMBaseBearer *mm_iface_modem_create_bearer_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
/* Helper method to wait for a final state */
|
||||
void mm_iface_modem_wait_for_final_state (MMIfaceModem *self,
|
||||
|
Reference in New Issue
Block a user