diff options
author | Dan Williams <dan@ioncontrol.co> | 2025-04-30 15:43:52 -0500 |
---|---|---|
committer | Dan Williams <dan@ioncontrol.co> | 2025-05-08 20:08:06 -0500 |
commit | ec5104c9a87a440bb791987ffe05e53bf235ae02 (patch) | |
tree | 48ff299064c675975c2b94c435cd5fef9466e508 /src | |
parent | ef5cee3ab578c2fde8ca6cc636f10acfdb79f123 (diff) |
Move log parent and connection property binding to helper
Continues removing usage of MMBaseModem in a bunch of files
by splitting out bits of its usage to separate interfaces.
Signed-off-by: Dan Williams <dan@ioncontrol.co>
Diffstat (limited to 'src')
55 files changed, 376 insertions, 75 deletions
diff --git a/src/meson.build b/src/meson.build index 7516a6ee..c3242953 100644 --- a/src/meson.build +++ b/src/meson.build @@ -298,6 +298,7 @@ sources = files( 'mm-base-modem.c', 'mm-base-sim.c', 'mm-base-sms.c', + 'mm-bind.c', 'mm-bearer-list.c', 'mm-broadband-bearer.c', 'mm-broadband-modem.c', diff --git a/src/mm-base-bearer.c b/src/mm-base-bearer.c index 3c7d2d99..7dadfff0 100644 --- a/src/mm-base-bearer.c +++ b/src/mm-base-bearer.c @@ -42,6 +42,7 @@ #include "mm-bearer-stats.h" #include "mm-dispatcher-connection.h" #include "mm-auth-provider.h" +#include "mm-bind.h" /* We require up to 20s to get a proper IP when using PPP */ #define BEARER_IP_TIMEOUT_DEFAULT 20 @@ -55,9 +56,11 @@ #define BEARER_CONNECTION_MONITOR_TIMEOUT 5 static void log_object_iface_init (MMLogObjectInterface *iface); +static void bind_iface_init (MMBindInterface *iface); G_DEFINE_TYPE_EXTENDED (MMBaseBearer, mm_base_bearer, MM_GDBUS_TYPE_BEARER_SKELETON, 0, - G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init)) + G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_BIND, bind_iface_init)) typedef enum { CONNECTION_FORBIDDEN_REASON_NONE, @@ -71,6 +74,7 @@ enum { PROP_0, PROP_PATH, PROP_CONNECTION, + PROP_BIND_TO, PROP_MODEM, PROP_STATUS, PROP_CONFIG, @@ -88,6 +92,9 @@ struct _MMBaseBearerPrivate { MMAuthProvider *authp; GCancellable *authp_cancellable; + /* The object this bearer is bound to */ + GObject *bind_to; + /* The modem which owns this BEARER */ MMBaseModem *modem; /* The path where the BEARER object is exported */ @@ -1744,17 +1751,15 @@ set_property (GObject *object, else if (self->priv->path) base_bearer_dbus_export (self); break; + case PROP_BIND_TO: + g_clear_object (&self->priv->bind_to); + self->priv->bind_to = g_value_dup_object (value); + mm_bind_to (MM_BIND (self), MM_BASE_BEARER_CONNECTION, self->priv->bind_to); + break; case PROP_MODEM: g_clear_object (&self->priv->modem); self->priv->modem = g_value_dup_object (value); if (self->priv->modem) { - /* Set owner ID */ - mm_log_object_set_owner_id (MM_LOG_OBJECT (self), mm_log_object_get_id (MM_LOG_OBJECT (self->priv->modem))); - /* 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_BASE_BEARER_CONNECTION, - G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE); if (self->priv->config) { /* Listen to 3GPP/CDMA registration state changes. We need both * 'config' and 'modem' set. */ @@ -1804,6 +1809,9 @@ get_property (GObject *object, case PROP_CONNECTION: g_value_set_object (value, self->priv->connection); break; + case PROP_BIND_TO: + g_value_set_object (value, self->priv->bind_to); + break; case PROP_MODEM: g_value_set_object (value, self->priv->modem); break; @@ -1886,6 +1894,7 @@ dispose (GObject *object) reset_deferred_unregistration (self); g_clear_object (&self->priv->modem); + g_clear_object (&self->priv->bind_to); g_clear_object (&self->priv->config); g_cancellable_cancel (self->priv->authp_cancellable); g_clear_object (&self->priv->authp_cancellable); @@ -1900,6 +1909,11 @@ log_object_iface_init (MMLogObjectInterface *iface) } static void +bind_iface_init (MMBindInterface *iface) +{ +} + +static void mm_base_bearer_class_init (MMBaseBearerClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); @@ -1930,6 +1944,8 @@ mm_base_bearer_class_init (MMBaseBearerClass *klass) G_PARAM_READWRITE); g_object_class_install_property (object_class, PROP_PATH, properties[PROP_PATH]); + g_object_class_override_property (object_class, PROP_BIND_TO, MM_BIND_TO); + properties[PROP_MODEM] = g_param_spec_object (MM_BASE_BEARER_MODEM, "Modem", diff --git a/src/mm-base-call.c b/src/mm-base-call.c index c1408559..6308fd18 100644 --- a/src/mm-base-call.c +++ b/src/mm-base-call.c @@ -35,16 +35,20 @@ #include "mm-log-object.h" #include "mm-modem-helpers.h" #include "mm-error-helpers.h" +#include "mm-bind.h" static void log_object_iface_init (MMLogObjectInterface *iface); +static void bind_iface_init (MMBindInterface *iface); G_DEFINE_TYPE_EXTENDED (MMBaseCall, mm_base_call, MM_GDBUS_TYPE_CALL_SKELETON, 0, - G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init)) + G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_BIND, bind_iface_init)) enum { PROP_0, PROP_PATH, PROP_CONNECTION, + PROP_BIND_TO, PROP_MODEM, PROP_SKIP_INCOMING_TIMEOUT, PROP_SUPPORTS_DIALING_TO_RINGING, @@ -63,6 +67,9 @@ struct _MMBaseCallPrivate { MMAuthProvider *authp; GCancellable *authp_cancellable; + /* The object this Call is bound to */ + GObject *bind_to; + /* The modem which owns this call */ MMBaseModem *modem; /* The path where the call object is exported */ @@ -1304,6 +1311,7 @@ log_object_build_id (MMLogObject *_self) MMBaseCall * mm_base_call_new (MMBaseModem *modem, + GObject *bind_to, MMCallDirection direction, const gchar *number, gboolean skip_incoming_timeout, @@ -1312,6 +1320,7 @@ mm_base_call_new (MMBaseModem *modem, { return MM_BASE_CALL (g_object_new (MM_TYPE_BASE_CALL, MM_BASE_CALL_MODEM, modem, + MM_BIND_TO, bind_to, "direction", direction, "number", number, MM_BASE_CALL_SKIP_INCOMING_TIMEOUT, skip_incoming_timeout, @@ -1351,18 +1360,14 @@ set_property (GObject *object, else if (self->priv->path) call_dbus_export (self); break; + case PROP_BIND_TO: + g_clear_object (&self->priv->bind_to); + self->priv->bind_to = g_value_dup_object (value); + mm_bind_to (MM_BIND (self), MM_BASE_CALL_CONNECTION, self->priv->bind_to); + break; case PROP_MODEM: g_clear_object (&self->priv->modem); self->priv->modem = g_value_dup_object (value); - if (self->priv->modem) { - /* Set owner ID */ - mm_log_object_set_owner_id (MM_LOG_OBJECT (self), mm_log_object_get_id (MM_LOG_OBJECT (self->priv->modem))); - /* Bind the modem's connection (which is set when it is exported, - * and unset when unexported) to the call's connection */ - g_object_bind_property (self->priv->modem, MM_BASE_MODEM_CONNECTION, - self, MM_BASE_CALL_CONNECTION, - G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE); - } break; case PROP_SKIP_INCOMING_TIMEOUT: self->priv->skip_incoming_timeout = g_value_get_boolean (value); @@ -1394,6 +1399,9 @@ get_property (GObject *object, case PROP_CONNECTION: g_value_set_object (value, self->priv->connection); break; + case PROP_BIND_TO: + g_value_set_object (value, self->priv->bind_to); + break; case PROP_MODEM: g_value_set_object (value, self->priv->modem); break; @@ -1459,6 +1467,7 @@ dispose (GObject *object) } g_clear_object (&self->priv->modem); + g_clear_object (&self->priv->bind_to); g_cancellable_cancel (self->priv->authp_cancellable); g_clear_object (&self->priv->authp_cancellable); @@ -1472,6 +1481,11 @@ log_object_iface_init (MMLogObjectInterface *iface) } static void +bind_iface_init (MMBindInterface *iface) +{ +} + +static void mm_base_call_class_init (MMBaseCallClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); @@ -1511,6 +1525,8 @@ mm_base_call_class_init (MMBaseCallClass *klass) G_PARAM_READWRITE); g_object_class_install_property (object_class, PROP_PATH, properties[PROP_PATH]); + g_object_class_override_property (object_class, PROP_BIND_TO, MM_BIND_TO); + properties[PROP_MODEM] = g_param_spec_object (MM_BASE_CALL_MODEM, "Modem", diff --git a/src/mm-base-call.h b/src/mm-base-call.h index 4359497e..fc69bf2f 100644 --- a/src/mm-base-call.h +++ b/src/mm-base-call.h @@ -101,6 +101,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBaseCall, g_object_unref) /* This one can be overridden by plugins */ MMBaseCall *mm_base_call_new (MMBaseModem *modem, + GObject *bind_to, MMCallDirection direction, const gchar *number, gboolean skip_incoming_timeout, diff --git a/src/mm-base-cbm.c b/src/mm-base-cbm.c index 212d2ce8..af02120e 100644 --- a/src/mm-base-cbm.c +++ b/src/mm-base-cbm.c @@ -34,16 +34,20 @@ #include "mm-log-object.h" #include "mm-modem-helpers.h" #include "mm-error-helpers.h" +#include "mm-bind.h" static void log_object_iface_init (MMLogObjectInterface *iface); +static void bind_iface_init (MMBindInterface *iface); G_DEFINE_TYPE_EXTENDED (MMBaseCbm, mm_base_cbm, MM_GDBUS_TYPE_CBM_SKELETON, 0, - G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init)) + G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_BIND, bind_iface_init)) enum { PROP_0, PROP_PATH, PROP_CONNECTION, + PROP_BIND_TO, PROP_MODEM, PROP_MAX_PARTS, PROP_SERIAL, @@ -57,6 +61,9 @@ struct _MMBaseCbmPrivate { GDBusConnection *connection; guint dbus_id; + /* The object this CBM is bound to */ + GObject *bind_to; + /* The modem which owns this CBM */ MMBaseModem *modem; /* The path where the CBM object is exported */ @@ -323,10 +330,12 @@ mm_base_cbm_take_part (MMBaseCbm *self, } MMBaseCbm * -mm_base_cbm_new (MMBaseModem *modem) +mm_base_cbm_new (MMBaseModem *modem, + GObject *bind_to) { return MM_BASE_CBM (g_object_new (MM_TYPE_BASE_CBM, MM_BASE_CBM_MODEM, modem, + MM_BIND_TO, bind_to, NULL)); } @@ -405,18 +414,14 @@ set_property (GObject *object, else if (self->priv->path) cbm_dbus_export (self); break; + case PROP_BIND_TO: + g_clear_object (&self->priv->bind_to); + self->priv->bind_to = g_value_dup_object (value); + mm_bind_to (MM_BIND (self), MM_BASE_CBM_CONNECTION, self->priv->bind_to); + break; case PROP_MODEM: g_clear_object (&self->priv->modem); self->priv->modem = g_value_dup_object (value); - if (self->priv->modem) { - /* Set owner ID */ - mm_log_object_set_owner_id (MM_LOG_OBJECT (self), mm_log_object_get_id (MM_LOG_OBJECT (self->priv->modem))); - /* Bind the modem's connection (which is set when it is exported, - * and unset when unexported) to the CBM's connection */ - g_object_bind_property (self->priv->modem, MM_BASE_MODEM_CONNECTION, - self, MM_BASE_CBM_CONNECTION, - G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE); - } break; case PROP_MAX_PARTS: self->priv->max_parts = g_value_get_uint (value); @@ -445,6 +450,9 @@ get_property (GObject *object, case PROP_CONNECTION: g_value_set_object (value, self->priv->connection); break; + case PROP_BIND_TO: + g_value_set_object (value, self->priv->bind_to); + break; case PROP_MODEM: g_value_set_object (value, self->priv->modem); break; @@ -497,6 +505,7 @@ dispose (GObject *object) } g_clear_object (&self->priv->modem); + g_clear_object (&self->priv->bind_to); G_OBJECT_CLASS (mm_base_cbm_parent_class)->dispose (object); } @@ -508,6 +517,11 @@ log_object_iface_init (MMLogObjectInterface *iface) } static void +bind_iface_init (MMBindInterface *iface) +{ +} + +static void mm_base_cbm_class_init (MMBaseCbmClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); @@ -534,6 +548,8 @@ mm_base_cbm_class_init (MMBaseCbmClass *klass) NULL, G_PARAM_READWRITE); + g_object_class_override_property (object_class, PROP_BIND_TO, MM_BIND_TO); + properties[PROP_MODEM] = g_param_spec_object (MM_BASE_CBM_MODEM, "Modem", diff --git a/src/mm-base-cbm.h b/src/mm-base-cbm.h index 538cd9d1..08dcd3ae 100644 --- a/src/mm-base-cbm.h +++ b/src/mm-base-cbm.h @@ -56,7 +56,8 @@ struct _MMBaseCbmClass { GType mm_base_cbm_get_type (void); G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBaseCbm, g_object_unref) -MMBaseCbm *mm_base_cbm_new (MMBaseModem *modem); +MMBaseCbm *mm_base_cbm_new (MMBaseModem *modem, + GObject *bind_to); gboolean mm_base_cbm_take_part (MMBaseCbm *self, MMCbmPart *part, GError **error); diff --git a/src/mm-base-modem.c b/src/mm-base-modem.c index 2e4337fe..eb7c04ca 100644 --- a/src/mm-base-modem.c +++ b/src/mm-base-modem.c @@ -39,6 +39,7 @@ #include "mm-daemon-enums-types.h" #include "mm-serial-parsers.h" #include "mm-modem-helpers.h" +#include "mm-bind.h" static void log_object_iface_init (MMLogObjectInterface *iface); static void auth_iface_init (MMIfaceAuthInterface *iface); @@ -2752,7 +2753,7 @@ mm_base_modem_class_init (MMBaseModemClass *klass) g_object_class_install_property (object_class, PROP_SUBSYSTEM_DEVICE_ID, properties[PROP_SUBSYSTEM_DEVICE_ID]); properties[PROP_CONNECTION] = - g_param_spec_object (MM_BASE_MODEM_CONNECTION, + g_param_spec_object (MM_BINDABLE_CONNECTION, "Connection", "GDBus connection to the system bus.", G_TYPE_DBUS_CONNECTION, diff --git a/src/mm-base-modem.h b/src/mm-base-modem.h index acdaec3c..1f35b913 100644 --- a/src/mm-base-modem.h +++ b/src/mm-base-modem.h @@ -57,7 +57,6 @@ typedef struct _MMBaseModem MMBaseModem; typedef struct _MMBaseModemClass MMBaseModemClass; typedef struct _MMBaseModemPrivate MMBaseModemPrivate; -#define MM_BASE_MODEM_CONNECTION "base-modem-connection" #define MM_BASE_MODEM_MAX_TIMEOUTS "base-modem-max-timeouts" #define MM_BASE_MODEM_VALID "base-modem-valid" #define MM_BASE_MODEM_DEVICE "base-modem-device" diff --git a/src/mm-base-sim.c b/src/mm-base-sim.c index 04dbcf65..9bffe872 100644 --- a/src/mm-base-sim.c +++ b/src/mm-base-sim.c @@ -34,18 +34,22 @@ #include "mm-log-object.h" #include "mm-modem-helpers.h" #include "mm-error-helpers.h" +#include "mm-bind.h" static void async_initable_iface_init (GAsyncInitableIface *iface); static void log_object_iface_init (MMLogObjectInterface *iface); +static void bind_iface_init (MMBindInterface *iface); G_DEFINE_TYPE_EXTENDED (MMBaseSim, mm_base_sim, MM_GDBUS_TYPE_SIM_SKELETON, 0, G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, async_initable_iface_init) - G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init)) + G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_BIND, bind_iface_init)) enum { PROP_0, PROP_PATH, PROP_CONNECTION, + PROP_BIND_TO, PROP_MODEM, PROP_SLOT_NUMBER, PROP_LAST @@ -67,6 +71,9 @@ struct _MMBaseSimPrivate { MMAuthProvider *authp; GCancellable *authp_cancellable; + /* The object this SIM is bound to */ + GObject *bind_to; + /* The modem which owns this SIM */ MMBaseModem *modem; /* The path where the SIM object is exported */ @@ -2295,6 +2302,7 @@ load_gid2 (MMBaseSim *self, MMBaseSim * mm_base_sim_new_initialized (MMBaseModem *modem, + GObject *bind_to, guint slot_number, gboolean active, const gchar *sim_identifier, @@ -2308,6 +2316,7 @@ mm_base_sim_new_initialized (MMBaseModem *modem, sim = MM_BASE_SIM (g_object_new (MM_TYPE_BASE_SIM, MM_BASE_SIM_MODEM, modem, + MM_BIND_TO, bind_to, MM_BASE_SIM_SLOT_NUMBER, slot_number, "active", active, "sim-identifier", sim_identifier, @@ -2897,6 +2906,7 @@ initable_init_async (GAsyncInitable *initable, void mm_base_sim_new (MMBaseModem *modem, + GObject *bind_to, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) @@ -2907,6 +2917,7 @@ mm_base_sim_new (MMBaseModem *modem, callback, user_data, MM_BASE_SIM_MODEM, modem, + MM_BIND_TO, bind_to, "active", TRUE, /* by default always active */ NULL); } @@ -2972,18 +2983,14 @@ set_property (GObject *object, else if (self->priv->path) sim_dbus_export (self); break; + case PROP_BIND_TO: + g_clear_object (&self->priv->bind_to); + self->priv->bind_to = g_value_dup_object (value); + mm_bind_to (MM_BIND (self), MM_BASE_SIM_CONNECTION, self->priv->bind_to); + break; case PROP_MODEM: g_clear_object (&self->priv->modem); self->priv->modem = g_value_dup_object (value); - if (self->priv->modem) { - /* Set owner ID */ - mm_log_object_set_owner_id (MM_LOG_OBJECT (self), mm_log_object_get_id (MM_LOG_OBJECT (self->priv->modem))); - /* Bind the modem's connection (which is set when it is exported, - * and unset when unexported) to the SIM's connection */ - g_object_bind_property (self->priv->modem, MM_BASE_MODEM_CONNECTION, - self, MM_BASE_SIM_CONNECTION, - G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE); - } break; case PROP_SLOT_NUMBER: self->priv->slot_number = g_value_get_uint (value); @@ -3009,6 +3016,9 @@ get_property (GObject *object, case PROP_CONNECTION: g_value_set_object (value, self->priv->connection); break; + case PROP_BIND_TO: + g_value_set_object (value, self->priv->bind_to); + break; case PROP_MODEM: g_value_set_object (value, self->priv->modem); break; @@ -3056,6 +3066,7 @@ dispose (GObject *object) } g_clear_object (&self->priv->modem); + g_clear_object (&self->priv->bind_to); g_cancellable_cancel (self->priv->authp_cancellable); g_clear_object (&self->priv->authp_cancellable); @@ -3076,6 +3087,11 @@ log_object_iface_init (MMLogObjectInterface *iface) } static void +bind_iface_init (MMBindInterface *iface) +{ +} + +static void mm_base_sim_class_init (MMBaseSimClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); @@ -3139,6 +3155,8 @@ mm_base_sim_class_init (MMBaseSimClass *klass) G_PARAM_READWRITE); g_object_class_install_property (object_class, PROP_MODEM, properties[PROP_MODEM]); + g_object_class_override_property (object_class, PROP_BIND_TO, MM_BIND_TO); + properties[PROP_SLOT_NUMBER] = g_param_spec_uint (MM_BASE_SIM_SLOT_NUMBER, "Slot number", diff --git a/src/mm-base-sim.h b/src/mm-base-sim.h index 60901c0d..8339988c 100644 --- a/src/mm-base-sim.h +++ b/src/mm-base-sim.h @@ -213,6 +213,7 @@ GType mm_base_sim_get_type (void); G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBaseSim, g_object_unref) void mm_base_sim_new (MMBaseModem *modem, + GObject *bind_to, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); @@ -228,6 +229,7 @@ gboolean mm_base_sim_initialize_finish (MMBaseSim *self, GError **error); MMBaseSim *mm_base_sim_new_initialized (MMBaseModem *modem, + GObject *bind_to, guint slot_number, gboolean active, const gchar *sim_identifier, diff --git a/src/mm-base-sms.c b/src/mm-base-sms.c index f7d46321..0e7c7527 100644 --- a/src/mm-base-sms.c +++ b/src/mm-base-sms.c @@ -37,16 +37,20 @@ #include "mm-modem-helpers.h" #include "mm-error-helpers.h" #include "mm-auth-provider.h" +#include "mm-bind.h" static void log_object_iface_init (MMLogObjectInterface *iface); +static void bind_iface_init (MMBindInterface *iface); G_DEFINE_TYPE_EXTENDED (MMBaseSms, mm_base_sms, MM_GDBUS_TYPE_SMS_SKELETON, 0, - G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init)) + G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_BIND, bind_iface_init)) enum { PROP_0, PROP_PATH, PROP_CONNECTION, + PROP_BIND_TO, PROP_MODEM, PROP_IS_MULTIPART, PROP_MAX_PARTS, @@ -65,6 +69,9 @@ struct _MMBaseSmsPrivate { MMAuthProvider *authp; GCancellable *authp_cancellable; + /* The object this SMS is bound to */ + GObject *bind_to; + /* The modem which owns this SMS */ MMBaseModem *modem; /* The path where the SMS object is exported */ @@ -1798,6 +1805,7 @@ mm_base_sms_new (MMBaseModem *modem) { return MM_BASE_SMS (g_object_new (MM_TYPE_BASE_SMS, MM_BASE_SMS_MODEM, modem, + MM_BIND_TO, modem, NULL)); } @@ -1995,18 +2003,14 @@ set_property (GObject *object, else if (self->priv->path) sms_dbus_export (self); break; + case PROP_BIND_TO: + g_clear_object (&self->priv->bind_to); + self->priv->bind_to = g_value_dup_object (value); + mm_bind_to (MM_BIND (self), MM_BASE_SMS_CONNECTION, self->priv->bind_to); + break; case PROP_MODEM: g_clear_object (&self->priv->modem); self->priv->modem = g_value_dup_object (value); - if (self->priv->modem) { - /* Set owner ID */ - mm_log_object_set_owner_id (MM_LOG_OBJECT (self), mm_log_object_get_id (MM_LOG_OBJECT (self->priv->modem))); - /* Bind the modem's connection (which is set when it is exported, - * and unset when unexported) to the SMS's connection */ - g_object_bind_property (self->priv->modem, MM_BASE_MODEM_CONNECTION, - self, MM_BASE_SMS_CONNECTION, - G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE); - } break; case PROP_IS_MULTIPART: self->priv->is_multipart = g_value_get_boolean (value); @@ -2038,6 +2042,9 @@ get_property (GObject *object, case PROP_CONNECTION: g_value_set_object (value, self->priv->connection); break; + case PROP_BIND_TO: + g_value_set_object (value, self->priv->bind_to); + break; case PROP_MODEM: g_value_set_object (value, self->priv->modem); break; @@ -2098,6 +2105,7 @@ dispose (GObject *object) } g_clear_object (&self->priv->modem); + g_clear_object (&self->priv->bind_to); g_cancellable_cancel (self->priv->authp_cancellable); g_clear_object (&self->priv->authp_cancellable); @@ -2111,6 +2119,11 @@ log_object_iface_init (MMLogObjectInterface *iface) } static void +bind_iface_init (MMBindInterface *iface) +{ +} + +static void mm_base_sms_class_init (MMBaseSmsClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); @@ -2146,6 +2159,8 @@ mm_base_sms_class_init (MMBaseSmsClass *klass) G_PARAM_READWRITE); g_object_class_install_property (object_class, PROP_PATH, properties[PROP_PATH]); + g_object_class_override_property (object_class, PROP_BIND_TO, MM_BIND_TO); + properties[PROP_MODEM] = g_param_spec_object (MM_BASE_SMS_MODEM, "Modem", diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c index 33a1b8f1..eb30f78a 100644 --- a/src/mm-bearer-mbim.c +++ b/src/mm-bearer-mbim.c @@ -33,6 +33,7 @@ #include "mm-bearer-mbim.h" #include "mm-log-object.h" #include "mm-context.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMBearerMbim, mm_bearer_mbim, MM_TYPE_BASE_BEARER) @@ -2019,6 +2020,7 @@ mm_bearer_mbim_new (MMBroadbandModemMbim *modem, * g_object_new() here */ bearer = g_object_new (MM_TYPE_BEARER_MBIM, MM_BASE_BEARER_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), MM_BASE_BEARER_CONFIG, config, NULL); diff --git a/src/mm-bearer-qmi.c b/src/mm-bearer-qmi.c index cccbf239..8f387ce8 100644 --- a/src/mm-bearer-qmi.c +++ b/src/mm-bearer-qmi.c @@ -37,6 +37,7 @@ #include "mm-log-object.h" #include "mm-modem-helpers.h" #include "mm-context.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMBearerQmi, mm_bearer_qmi, MM_TYPE_BASE_BEARER) @@ -2959,6 +2960,7 @@ mm_bearer_qmi_new (MMBroadbandModemQmi *modem, * g_object_new() here */ bearer = g_object_new (MM_TYPE_BEARER_QMI, MM_BASE_BEARER_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), MM_BASE_BEARER_CONFIG, config, NULL); diff --git a/src/mm-bind.c b/src/mm-bind.c new file mode 100644 index 00000000..cef83bea --- /dev/null +++ b/src/mm-bind.c @@ -0,0 +1,62 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2025 Dan Williams <dan@ioncontrol.co> + */ + +#include "mm-bind.h" +#include "mm-log-object.h" + +G_DEFINE_INTERFACE (MMBind, mm_bind, MM_TYPE_LOG_OBJECT) + +gboolean +mm_bind_to (MMBind *self, const gchar *local_propname, GObject *other_object) +{ + if (other_object) { + /* Set log owner ID */ + mm_log_object_set_owner_id (MM_LOG_OBJECT (self), + mm_log_object_get_id (MM_LOG_OBJECT (other_object))); + + if (local_propname) { + /* Bind the other object's connection property (which is set when it is + * exported, and unset when unexported) to this object's connection + * property. + */ + g_object_bind_property (other_object, + MM_BINDABLE_CONNECTION, + self, + local_propname, + G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE); + } + } + return !!other_object; +} + +static void +mm_bind_default_init (MMBindInterface *iface) +{ + static gsize initialized = 0; + + if (!g_once_init_enter (&initialized)) + return; + + /* Properties */ + g_object_interface_install_property ( + iface, + g_param_spec_object (MM_BIND_TO, + "Bind to", + "Bind to this object", + G_TYPE_OBJECT, + G_PARAM_READWRITE)); + + g_once_init_leave (&initialized, 1); +} diff --git a/src/mm-bind.h b/src/mm-bind.h new file mode 100644 index 00000000..144df2de --- /dev/null +++ b/src/mm-bind.h @@ -0,0 +1,42 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details: + * + * Copyright (C) 2025 Dan Williams <dan@ioncontrol.co> + */ + +#ifndef MM_CHILD_H +#define MM_CHILD_H + +#include <glib.h> +#include <glib-object.h> + +/* Properties */ +#define MM_BIND_TO "bind-to" + +/* Property name used by an object that wants to allow others + * to bind its connection property. + */ +#define MM_BINDABLE_CONNECTION "bind-connection" + +#define MM_TYPE_BIND mm_bind_get_type () +G_DECLARE_INTERFACE (MMBind, mm_bind, MM, BIND, MMBind) + +struct _MMBindInterface +{ + GTypeInterface g_iface; +}; + +gboolean mm_bind_to (MMBind *self, + const gchar *local_propname, + GObject *other_object); + +#endif /* MM_LOG_OBJECT_H */ diff --git a/src/mm-broadband-bearer.c b/src/mm-broadband-bearer.c index dfd9d489..4c8690d7 100644 --- a/src/mm-broadband-bearer.c +++ b/src/mm-broadband-bearer.c @@ -37,6 +37,7 @@ #include "mm-modem-helpers.h" #include "mm-port-enums-types.h" #include "mm-helper-enums-types.h" +#include "mm-bind.h" static void async_initable_iface_init (GAsyncInitableIface *iface); @@ -1966,6 +1967,7 @@ mm_broadband_bearer_new (MMBroadbandModem *modem, callback, user_data, MM_BASE_BEARER_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), MM_BASE_BEARER_CONFIG, bearer_properties, MM_BROADBAND_BEARER_FLOW_CONTROL, flow_control, NULL); diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c index 16f2a088..bd79ceca 100644 --- a/src/mm-broadband-modem-qmi.c +++ b/src/mm-broadband-modem-qmi.c @@ -11550,7 +11550,7 @@ cell_broadcast_create_cbm (MMIfaceModemCellBroadcast *_self) return iface_modem_cell_broadcast_parent->create_cbm (_self); } - return mm_base_cbm_new (MM_BASE_MODEM (self)); + return mm_base_cbm_new (MM_BASE_MODEM (self), G_OBJECT (self)); } /*****************************************************************************/ diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index 6eb04fe2..2ccde45e 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -63,6 +63,7 @@ #include "libqcdm/src/logs.h" #include "libqcdm/src/log-items.h" #include "mm-helper-enums-types.h" +#include "mm-bind.h" static void iface_modem_init (MMIfaceModemInterface *iface); static void iface_modem_3gpp_init (MMIfaceModem3gppInterface *iface); @@ -504,6 +505,7 @@ modem_create_sim (MMIfaceModem *self, { /* New generic SIM */ mm_base_sim_new (MM_BASE_MODEM (self), + G_OBJECT (self), NULL, /* cancellable */ callback, user_data); @@ -5905,6 +5907,7 @@ modem_3gpp_create_initial_eps_bearer (MMIfaceModem3gpp *self, * attempt connection through this bearer object. */ bearer = g_object_new (MM_TYPE_BASE_BEARER, MM_BASE_BEARER_MODEM, MM_BASE_MODEM (self), + MM_BIND_TO, G_OBJECT (self), MM_BASE_BEARER_CONFIG, config, "bearer-type", MM_BEARER_TYPE_DEFAULT_ATTACH, "connected", TRUE, @@ -8896,6 +8899,7 @@ modem_voice_create_call (MMIfaceModemVoice *_self, MMBroadbandModem *self = MM_BROADBAND_MODEM (_self); return mm_base_call_new (MM_BASE_MODEM (self), + G_OBJECT (self), direction, number, /* If +CLCC is supported, we want no incoming timeout. @@ -10688,7 +10692,7 @@ modem_cell_broadcast_cleanup_unsolicited_events (MMIfaceModemCellBroadcast *self static MMBaseCbm * modem_cell_broadcast_create_cbm (MMIfaceModemCellBroadcast *self) { - return mm_base_cbm_new (MM_BASE_MODEM (self)); + return mm_base_cbm_new (MM_BASE_MODEM (self), G_OBJECT (self)); } /***********************************************************************************/ diff --git a/src/mm-call-qmi.c b/src/mm-call-qmi.c index 8fad9584..441be147 100644 --- a/src/mm-call-qmi.c +++ b/src/mm-call-qmi.c @@ -31,6 +31,7 @@ #include "mm-call-qmi.h" #include "mm-base-modem.h" #include "mm-log-object.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMCallQmi, mm_call_qmi, MM_TYPE_BASE_CALL) @@ -492,6 +493,7 @@ mm_call_qmi_new (MMBaseModem *modem, { return MM_BASE_CALL (g_object_new (MM_TYPE_CALL_QMI, MM_BASE_CALL_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), "direction", direction, "number", number, MM_BASE_CALL_SKIP_INCOMING_TIMEOUT, TRUE, diff --git a/src/mm-cbm-list.c b/src/mm-cbm-list.c index b86246a6..02d91bdc 100644 --- a/src/mm-cbm-list.c +++ b/src/mm-cbm-list.c @@ -32,14 +32,18 @@ #include "mm-cbm-list.h" #include "mm-base-cbm.h" #include "mm-log-object.h" +#include "mm-bind.h" static void log_object_iface_init (MMLogObjectInterface *iface); +static void bind_iface_init (MMBindInterface *iface); G_DEFINE_TYPE_EXTENDED (MMCbmList, mm_cbm_list, G_TYPE_OBJECT, 0, - G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init)) + G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_BIND, bind_iface_init)) enum { PROP_0, + PROP_BIND_TO, PROP_MODEM, PROP_LAST }; @@ -53,6 +57,8 @@ enum { static guint signals[SIGNAL_LAST]; struct _MMCbmListPrivate { + /* The object this CBM list is bound to */ + GObject *bind_to; /* The owner modem */ MMBaseModem *modem; /* List of cbm objects */ @@ -283,11 +289,12 @@ log_object_build_id (MMLogObject *_self) /*****************************************************************************/ MMCbmList * -mm_cbm_list_new (MMBaseModem *modem) +mm_cbm_list_new (MMBaseModem *modem, GObject *bind_to) { /* Create the object */ return g_object_new (MM_TYPE_CBM_LIST, MM_CBM_LIST_MODEM, modem, + MM_BIND_TO, bind_to, NULL); } @@ -300,14 +307,14 @@ set_property (GObject *object, MMCbmList *self = MM_CBM_LIST (object); switch (prop_id) { + case PROP_BIND_TO: + g_clear_object (&self->priv->bind_to); + self->priv->bind_to = g_value_dup_object (value); + mm_bind_to (MM_BIND (self), NULL, self->priv->bind_to); + break; case PROP_MODEM: g_clear_object (&self->priv->modem); self->priv->modem = g_value_dup_object (value); - if (self->priv->modem) { - /* Set owner ID */ - mm_log_object_set_owner_id (MM_LOG_OBJECT (self), - mm_log_object_get_id (MM_LOG_OBJECT (self->priv->modem))); - } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -324,6 +331,9 @@ get_property (GObject *object, MMCbmList *self = MM_CBM_LIST (object); switch (prop_id) { + case PROP_BIND_TO: + g_value_set_object (value, self->priv->bind_to); + break; case PROP_MODEM: g_value_set_object (value, self->priv->modem); break; @@ -348,6 +358,7 @@ dispose (GObject *object) MMCbmList *self = MM_CBM_LIST (object); g_clear_object (&self->priv->modem); + g_clear_object (&self->priv->bind_to); g_list_free_full (self->priv->list, g_object_unref); self->priv->list = NULL; @@ -361,6 +372,11 @@ log_object_iface_init (MMLogObjectInterface *iface) } static void +bind_iface_init (MMBindInterface *iface) +{ +} + +static void mm_cbm_list_class_init (MMCbmListClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); @@ -381,6 +397,8 @@ mm_cbm_list_class_init (MMCbmListClass *klass) G_PARAM_READWRITE); g_object_class_install_property (object_class, PROP_MODEM, properties[PROP_MODEM]); + g_object_class_override_property (object_class, PROP_BIND_TO, MM_BIND_TO); + /* Signals */ signals[SIGNAL_ADDED] = g_signal_new (MM_CBM_ADDED, diff --git a/src/mm-cbm-list.h b/src/mm-cbm-list.h index 79a48878..2c493659 100644 --- a/src/mm-cbm-list.h +++ b/src/mm-cbm-list.h @@ -57,7 +57,8 @@ struct _MMCbmListClass { GType mm_cbm_list_get_type (void); G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCbmList, g_object_unref) -MMCbmList *mm_cbm_list_new (MMBaseModem *modem); +MMCbmList *mm_cbm_list_new (MMBaseModem *modem, + GObject *bind_to); GStrv mm_cbm_list_get_paths (MMCbmList *self); guint mm_cbm_list_get_count (MMCbmList *self); diff --git a/src/mm-device.c b/src/mm-device.c index b2e3541a..b991f18d 100644 --- a/src/mm-device.c +++ b/src/mm-device.c @@ -27,6 +27,7 @@ #include "mm-plugin.h" #include "mm-log-object.h" #include "mm-daemon-enums-types.h" +#include "mm-bind.h" static void log_object_iface_init (MMLogObjectInterface *iface); @@ -341,7 +342,7 @@ unexport_modem (MMDevice *self) if (path != NULL) { g_dbus_object_manager_server_unexport (self->priv->object_manager, path); g_object_set (self->priv->modem, - MM_BASE_MODEM_CONNECTION, NULL, + MM_BINDABLE_CONNECTION, NULL, NULL); mm_obj_dbg (self, "unexported modem from path '%s'", path); g_free (path); @@ -389,7 +390,7 @@ export_modem (MMDevice *self) path = g_strdup_printf (MM_DBUS_MODEM_PREFIX "/%d", mm_base_modem_get_dbus_id (self->priv->modem)); g_object_set (self->priv->modem, "g-object-path", path, - MM_BASE_MODEM_CONNECTION, connection, + MM_BINDABLE_CONNECTION, connection, NULL); g_dbus_object_manager_server_export (self->priv->object_manager, diff --git a/src/mm-iface-modem-cell-broadcast.c b/src/mm-iface-modem-cell-broadcast.c index b29d01c5..d6fdbdfe 100644 --- a/src/mm-iface-modem-cell-broadcast.c +++ b/src/mm-iface-modem-cell-broadcast.c @@ -640,7 +640,7 @@ interface_enabling_step (GTask *task) case ENABLING_STEP_FIRST: { g_autoptr (MMCbmList) list = NULL; - list = mm_cbm_list_new (MM_BASE_MODEM (self)); + list = mm_cbm_list_new (MM_BASE_MODEM (self), G_OBJECT (self)); g_object_set (self, MM_IFACE_MODEM_CELL_BROADCAST_CBM_LIST, list, NULL); diff --git a/src/mm-iface-modem-messaging.c b/src/mm-iface-modem-messaging.c index 0634b578..581843c5 100644 --- a/src/mm-iface-modem-messaging.c +++ b/src/mm-iface-modem-messaging.c @@ -1008,7 +1008,7 @@ interface_enabling_step (GTask *task) case ENABLING_STEP_FIRST: { MMSmsList *list; - list = mm_sms_list_new (MM_BASE_MODEM (self)); + list = mm_sms_list_new (MM_BASE_MODEM (self), G_OBJECT (self)); g_object_set (self, MM_IFACE_MODEM_MESSAGING_SMS_LIST, list, NULL); diff --git a/src/mm-sim-mbim.c b/src/mm-sim-mbim.c index 525b3296..5b09fd67 100644 --- a/src/mm-sim-mbim.c +++ b/src/mm-sim-mbim.c @@ -31,6 +31,7 @@ #include "mm-log-object.h" #include "mm-modem-helpers-mbim.h" #include "mm-sim-mbim.h" +#include "mm-bind.h" #define MS_UICC_LOW_LEVEL_SUPPORTED_VERSION 0x01 @@ -1734,6 +1735,7 @@ mm_sim_mbim_new (MMBaseModem *modem, callback, user_data, MM_BASE_SIM_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), "active", TRUE, /* by default always active */ NULL); } @@ -1755,6 +1757,7 @@ mm_sim_mbim_new_initialized (MMBaseModem *modem, sim = MM_BASE_SIM (g_object_new (MM_TYPE_SIM_MBIM, MM_BASE_SIM_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), MM_BASE_SIM_SLOT_NUMBER, slot_number, "active", active, "sim-type", sim_type, diff --git a/src/mm-sim-qmi.c b/src/mm-sim-qmi.c index 0ac3b6eb..f06f4808 100644 --- a/src/mm-sim-qmi.c +++ b/src/mm-sim-qmi.c @@ -31,6 +31,7 @@ #include "mm-sim-qmi.h" #include "mm-modem-helpers-qmi.h" #include "mm-shared-qmi.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMSimQmi, mm_sim_qmi, MM_TYPE_BASE_SIM) @@ -1819,6 +1820,7 @@ mm_sim_qmi_new (MMBaseModem *modem, callback, user_data, MM_BASE_SIM_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), MM_SIM_QMI_DMS_UIM_DEPRECATED, dms_uim_deprecated, "active", TRUE, /* by default always active */ NULL); @@ -1840,6 +1842,7 @@ mm_sim_qmi_new_initialized (MMBaseModem *modem, sim = MM_BASE_SIM (g_object_new (MM_TYPE_SIM_QMI, MM_BASE_SIM_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), MM_SIM_QMI_DMS_UIM_DEPRECATED, dms_uim_deprecated, MM_BASE_SIM_SLOT_NUMBER, slot_number, "active", active, diff --git a/src/mm-sms-list.c b/src/mm-sms-list.c index 3bad49aa..f2401dae 100644 --- a/src/mm-sms-list.c +++ b/src/mm-sms-list.c @@ -28,14 +28,18 @@ #include "mm-sms-list.h" #include "mm-base-sms.h" #include "mm-log-object.h" +#include "mm-bind.h" static void log_object_iface_init (MMLogObjectInterface *iface); +static void bind_iface_init (MMBindInterface *iface); G_DEFINE_TYPE_EXTENDED (MMSmsList, mm_sms_list, G_TYPE_OBJECT, 0, - G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init)) + G_IMPLEMENT_INTERFACE (MM_TYPE_LOG_OBJECT, log_object_iface_init) + G_IMPLEMENT_INTERFACE (MM_TYPE_BIND, bind_iface_init)) enum { PROP_0, + PROP_BIND_TO, PROP_MODEM, PROP_LAST }; @@ -49,6 +53,8 @@ enum { static guint signals[SIGNAL_LAST]; struct _MMSmsListPrivate { + /* The object this SMS list is bound to */ + GObject *bind_to; /* The owner modem */ MMBaseModem *modem; /* List of sms objects */ @@ -397,11 +403,12 @@ log_object_build_id (MMLogObject *_self) /*****************************************************************************/ MMSmsList * -mm_sms_list_new (MMBaseModem *modem) +mm_sms_list_new (MMBaseModem *modem, GObject *bind_to) { /* Create the object */ return g_object_new (MM_TYPE_SMS_LIST, MM_SMS_LIST_MODEM, modem, + MM_BIND_TO, bind_to, NULL); } @@ -414,13 +421,14 @@ set_property (GObject *object, MMSmsList *self = MM_SMS_LIST (object); switch (prop_id) { + case PROP_BIND_TO: + g_clear_object (&self->priv->bind_to); + self->priv->bind_to = g_value_dup_object (value); + mm_bind_to (MM_BIND (self), NULL, self->priv->bind_to); + break; case PROP_MODEM: g_clear_object (&self->priv->modem); self->priv->modem = g_value_dup_object (value); - if (self->priv->modem) { - /* Set owner ID */ - mm_log_object_set_owner_id (MM_LOG_OBJECT (self), mm_log_object_get_id (MM_LOG_OBJECT (self->priv->modem))); - } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -437,6 +445,9 @@ get_property (GObject *object, MMSmsList *self = MM_SMS_LIST (object); switch (prop_id) { + case PROP_BIND_TO: + g_value_set_object (value, self->priv->bind_to); + break; case PROP_MODEM: g_value_set_object (value, self->priv->modem); break; @@ -461,6 +472,7 @@ dispose (GObject *object) MMSmsList *self = MM_SMS_LIST (object); g_clear_object (&self->priv->modem); + g_clear_object (&self->priv->bind_to); g_list_free_full (self->priv->list, g_object_unref); self->priv->list = NULL; @@ -474,6 +486,11 @@ log_object_iface_init (MMLogObjectInterface *iface) } static void +bind_iface_init (MMBindInterface *iface) +{ +} + +static void mm_sms_list_class_init (MMSmsListClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); @@ -494,6 +511,8 @@ mm_sms_list_class_init (MMSmsListClass *klass) G_PARAM_READWRITE); g_object_class_install_property (object_class, PROP_MODEM, properties[PROP_MODEM]); + g_object_class_override_property (object_class, PROP_BIND_TO, MM_BIND_TO); + /* Signals */ signals[SIGNAL_ADDED] = g_signal_new (MM_SMS_ADDED, diff --git a/src/mm-sms-list.h b/src/mm-sms-list.h index 8a77d6ca..775611c8 100644 --- a/src/mm-sms-list.h +++ b/src/mm-sms-list.h @@ -57,7 +57,8 @@ struct _MMSmsListClass { GType mm_sms_list_get_type (void); G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSmsList, g_object_unref) -MMSmsList *mm_sms_list_new (MMBaseModem *modem); +MMSmsList *mm_sms_list_new (MMBaseModem *modem, + GObject *bind_to); GStrv mm_sms_list_get_paths (MMSmsList *self); guint mm_sms_list_get_count (MMSmsList *self); diff --git a/src/mm-sms-mbim.c b/src/mm-sms-mbim.c index acbbee44..0a404aa5 100644 --- a/src/mm-sms-mbim.c +++ b/src/mm-sms-mbim.c @@ -31,6 +31,7 @@ #include "mm-base-modem.h" #include "mm-log-object.h" #include "mm-sms-part-3gpp.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMSmsMbim, mm_sms_mbim, MM_TYPE_BASE_SMS) @@ -345,6 +346,7 @@ mm_sms_mbim_new (MMBaseModem *modem) { return MM_BASE_SMS (g_object_new (MM_TYPE_SMS_MBIM, MM_BASE_SMS_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), NULL)); } diff --git a/src/mm-sms-qmi.c b/src/mm-sms-qmi.c index 3db0512e..abc45649 100644 --- a/src/mm-sms-qmi.c +++ b/src/mm-sms-qmi.c @@ -33,6 +33,7 @@ #include "mm-sms-part-3gpp.h" #include "mm-sms-part-cdma.h" #include "mm-log-object.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMSmsQmi, mm_sms_qmi, MM_TYPE_BASE_SMS) @@ -789,6 +790,7 @@ mm_sms_qmi_new (MMBaseModem *modem) { return MM_BASE_SMS (g_object_new (MM_TYPE_SMS_QMI, MM_BASE_SMS_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), NULL)); } diff --git a/src/plugins/altair/mm-broadband-bearer-altair-lte.c b/src/plugins/altair/mm-broadband-bearer-altair-lte.c index 4fee0f5f..7129d4f3 100644 --- a/src/plugins/altair/mm-broadband-bearer-altair-lte.c +++ b/src/plugins/altair/mm-broadband-bearer-altair-lte.c @@ -32,6 +32,7 @@ #include "mm-iface-modem-3gpp.h" #include "mm-log.h" #include "mm-modem-helpers.h" +#include "mm-bind.h" #define CONNECTION_CHECK_TIMEOUT_SEC 5 #define STATCM_TAG "%STATCM:" @@ -340,6 +341,7 @@ mm_broadband_bearer_altair_lte_new (MMBroadbandModemAltairLte *modem, callback, user_data, MM_BASE_BEARER_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), MM_BASE_BEARER_CONFIG, config, NULL); } diff --git a/src/plugins/cinterion/mm-broadband-bearer-cinterion.c b/src/plugins/cinterion/mm-broadband-bearer-cinterion.c index 8ab156e8..396837fe 100644 --- a/src/plugins/cinterion/mm-broadband-bearer-cinterion.c +++ b/src/plugins/cinterion/mm-broadband-bearer-cinterion.c @@ -28,6 +28,7 @@ #include "mm-modem-helpers.h" #include "mm-modem-helpers-cinterion.h" #include "mm-daemon-enums-types.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMBroadbandBearerCinterion, mm_broadband_bearer_cinterion, MM_TYPE_BROADBAND_BEARER) @@ -767,6 +768,7 @@ mm_broadband_bearer_cinterion_new (MMBroadbandModemCinterion *modem, callback, user_data, MM_BASE_BEARER_MODEM, modem, + MM_BIND_TO, modem, MM_BASE_BEARER_CONFIG, config, NULL); } diff --git a/src/plugins/cinterion/mm-broadband-modem-cinterion.c b/src/plugins/cinterion/mm-broadband-modem-cinterion.c index 31a3078a..3d70cf50 100644 --- a/src/plugins/cinterion/mm-broadband-modem-cinterion.c +++ b/src/plugins/cinterion/mm-broadband-modem-cinterion.c @@ -3128,7 +3128,9 @@ cinterion_simlocal_unsolicited_handler (MMPortSerialAt *port, if (sim == NULL && is_available) { mm_obj_info (self, "SIM in slot %i inserted", i + 1); - sim = mm_base_sim_new_initialized (MM_BASE_MODEM (self), i + 1, FALSE, + sim = mm_base_sim_new_initialized (MM_BASE_MODEM (self), + G_OBJECT (self), + i + 1, FALSE, NULL, NULL, NULL, NULL, NULL, NULL); mm_iface_modem_modify_sim (MM_IFACE_MODEM (self), i, sim); } else if (sim != NULL && !is_available) { @@ -3185,7 +3187,9 @@ cinterion_slot_availability_init_ready (MMBaseModem *_self, is_available = g_array_index (available, gboolean, i); if (is_available) - sim = mm_base_sim_new_initialized (MM_BASE_MODEM (self), i + 1, FALSE, + sim = mm_base_sim_new_initialized (MM_BASE_MODEM (self), + G_OBJECT (self), + i + 1, FALSE, NULL, NULL, NULL, NULL, NULL, NULL); g_ptr_array_add (ctx->sim_slots, sim); } diff --git a/src/plugins/cinterion/mm-shared-cinterion.c b/src/plugins/cinterion/mm-shared-cinterion.c index 8724ad3a..4ae1f503 100644 --- a/src/plugins/cinterion/mm-shared-cinterion.c +++ b/src/plugins/cinterion/mm-shared-cinterion.c @@ -1006,6 +1006,7 @@ mm_shared_cinterion_create_call (MMIfaceModemVoice *self, if (priv->slcc_support == FEATURE_SUPPORTED) { mm_obj_dbg (self, "created new call with ^SLCC support"); return mm_base_call_new (MM_BASE_MODEM (self), + G_OBJECT (self), direction, number, /* When SLCC is supported we have support for detailed diff --git a/src/plugins/fibocom/mm-broadband-bearer-fibocom-ecm.c b/src/plugins/fibocom/mm-broadband-bearer-fibocom-ecm.c index 06f28b8a..5b5ad78c 100644 --- a/src/plugins/fibocom/mm-broadband-bearer-fibocom-ecm.c +++ b/src/plugins/fibocom/mm-broadband-bearer-fibocom-ecm.c @@ -20,6 +20,7 @@ #include "mm-base-modem-at.h" #include "mm-iface-modem-3gpp.h" #include "mm-log.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMBroadbandBearerFibocomEcm, mm_broadband_bearer_fibocom_ecm, MM_TYPE_BROADBAND_BEARER) @@ -513,6 +514,7 @@ mm_broadband_bearer_fibocom_ecm_new (MMBroadbandModemFibocom *modem, callback, user_data, MM_BASE_BEARER_MODEM, modem, + MM_BIND_TO, modem, MM_BASE_BEARER_CONFIG, config, NULL); } diff --git a/src/plugins/huawei/mm-broadband-bearer-huawei.c b/src/plugins/huawei/mm-broadband-bearer-huawei.c index 19112af4..9c680a5c 100644 --- a/src/plugins/huawei/mm-broadband-bearer-huawei.c +++ b/src/plugins/huawei/mm-broadband-bearer-huawei.c @@ -31,6 +31,7 @@ #include "mm-modem-helpers.h" #include "mm-modem-helpers-huawei.h" #include "mm-daemon-enums-types.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMBroadbandBearerHuawei, mm_broadband_bearer_huawei, MM_TYPE_BROADBAND_BEARER) @@ -841,6 +842,7 @@ mm_broadband_bearer_huawei_new (MMBroadbandModemHuawei *modem, callback, user_data, MM_BASE_BEARER_MODEM, modem, + MM_BIND_TO, modem, MM_BASE_BEARER_CONFIG, config, NULL); } diff --git a/src/plugins/huawei/mm-broadband-modem-huawei.c b/src/plugins/huawei/mm-broadband-modem-huawei.c index cddde30a..5a7f2afc 100644 --- a/src/plugins/huawei/mm-broadband-modem-huawei.c +++ b/src/plugins/huawei/mm-broadband-modem-huawei.c @@ -3881,6 +3881,7 @@ create_call (MMIfaceModemVoice *self, const gchar *number) { return mm_base_call_new (MM_BASE_MODEM (self), + G_OBJECT (self), direction, number, TRUE, /* skip_incoming_timeout */ diff --git a/src/plugins/huawei/mm-sim-huawei.c b/src/plugins/huawei/mm-sim-huawei.c index f937c773..bfd55b3c 100644 --- a/src/plugins/huawei/mm-sim-huawei.c +++ b/src/plugins/huawei/mm-sim-huawei.c @@ -27,6 +27,7 @@ #include <libmm-glib.h> #include "mm-modem-helpers.h" #include "mm-base-modem-at.h" +#include "mm-bind.h" #include "mm-sim-huawei.h" @@ -148,6 +149,7 @@ mm_sim_huawei_new (MMBaseModem *modem, callback, user_data, MM_BASE_SIM_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), "active", TRUE, /* by default always active */ NULL); } diff --git a/src/plugins/icera/mm-broadband-bearer-icera.c b/src/plugins/icera/mm-broadband-bearer-icera.c index d9c8415e..7c51bc36 100644 --- a/src/plugins/icera/mm-broadband-bearer-icera.c +++ b/src/plugins/icera/mm-broadband-bearer-icera.c @@ -34,6 +34,7 @@ #include "mm-error-helpers.h" #include "mm-daemon-enums-types.h" #include "mm-modem-helpers-icera.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMBroadbandBearerIcera, mm_broadband_bearer_icera, MM_TYPE_BROADBAND_BEARER); @@ -791,6 +792,7 @@ mm_broadband_bearer_icera_new (MMBroadbandModem *modem, callback, user_data, MM_BASE_BEARER_MODEM, modem, + MM_BIND_TO, modem, MM_BASE_BEARER_CONFIG, config, MM_BROADBAND_BEARER_ICERA_DEFAULT_IP_METHOD, ip_method, NULL); diff --git a/src/plugins/iridium/mm-bearer-iridium.c b/src/plugins/iridium/mm-bearer-iridium.c index c9e2a058..70ea80bb 100644 --- a/src/plugins/iridium/mm-bearer-iridium.c +++ b/src/plugins/iridium/mm-bearer-iridium.c @@ -26,6 +26,7 @@ #include "mm-bearer-iridium.h" #include "mm-base-modem-at.h" +#include "mm-bind.h" /* Allow up to 200s to get a proper IP connection */ #define BEARER_IRIDIUM_IP_TIMEOUT_DEFAULT 200 @@ -234,6 +235,7 @@ mm_bearer_iridium_new (MMBroadbandModemIridium *modem, * g_object_get() here */ bearer = g_object_new (MM_TYPE_BEARER_IRIDIUM, MM_BASE_BEARER_MODEM, modem, + MM_BIND_TO, modem, MM_BASE_BEARER_CONFIG, config, "ip-timeout", BEARER_IRIDIUM_IP_TIMEOUT_DEFAULT, NULL); diff --git a/src/plugins/iridium/mm-sim-iridium.c b/src/plugins/iridium/mm-sim-iridium.c index 3495039b..001bdf03 100644 --- a/src/plugins/iridium/mm-sim-iridium.c +++ b/src/plugins/iridium/mm-sim-iridium.c @@ -25,6 +25,7 @@ #define _LIBMM_INSIDE_MM #include <libmm-glib.h> +#include "mm-bind.h" #include "mm-sim-iridium.h" G_DEFINE_TYPE (MMSimIridium, mm_sim_iridium, MM_TYPE_BASE_SIM) @@ -63,6 +64,7 @@ mm_sim_iridium_new (MMBaseModem *modem, callback, user_data, MM_BASE_SIM_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), "active", TRUE, /* by default always active */ NULL); } diff --git a/src/plugins/mbm/mm-broadband-bearer-mbm.c b/src/plugins/mbm/mm-broadband-bearer-mbm.c index a9a09682..5f766cb5 100644 --- a/src/plugins/mbm/mm-broadband-bearer-mbm.c +++ b/src/plugins/mbm/mm-broadband-bearer-mbm.c @@ -42,6 +42,7 @@ #include "mm-modem-helpers.h" #include "mm-modem-helpers-mbm.h" #include "mm-daemon-enums-types.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMBroadbandBearerMbm, mm_broadband_bearer_mbm, MM_TYPE_BROADBAND_BEARER) @@ -871,6 +872,7 @@ mm_broadband_bearer_mbm_new (MMBroadbandModemMbm *modem, callback, user_data, MM_BASE_BEARER_MODEM, modem, + MM_BIND_TO, modem, MM_BASE_BEARER_CONFIG, config, NULL); } diff --git a/src/plugins/mbm/mm-sim-mbm.c b/src/plugins/mbm/mm-sim-mbm.c index d3f73954..ec06b4a4 100644 --- a/src/plugins/mbm/mm-sim-mbm.c +++ b/src/plugins/mbm/mm-sim-mbm.c @@ -27,6 +27,7 @@ #include "mm-log-object.h" #include "mm-base-modem-at.h" #include "mm-sim-mbm.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMSimMbm, mm_sim_mbm, MM_TYPE_BASE_SIM) @@ -221,6 +222,7 @@ mm_sim_mbm_new (MMBaseModem *modem, callback, user_data, MM_BASE_SIM_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), "active", TRUE, /* by default always active */ NULL); } diff --git a/src/plugins/mtk/mm-bearer-mbim-mtk-fibocom.c b/src/plugins/mtk/mm-bearer-mbim-mtk-fibocom.c index 33398bd7..29b1f8fe 100644 --- a/src/plugins/mtk/mm-bearer-mbim-mtk-fibocom.c +++ b/src/plugins/mtk/mm-bearer-mbim-mtk-fibocom.c @@ -21,6 +21,7 @@ #include "mm-log-object.h" #include "mm-bearer-mbim-mtk-fibocom.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMBearerMbimMtkFibocom, mm_bearer_mbim_mtk_fibocom, MM_TYPE_BEARER_MBIM) @@ -151,6 +152,7 @@ mm_bearer_mbim_mtk_fibocom_new (MMBroadbandModemMbim *modem, * g_object_new() here */ self = g_object_new (MM_TYPE_BEARER_MBIM_MTK_FIBOCOM, MM_BASE_BEARER_MODEM, modem, + MM_BIND_TO, modem, MM_BASE_BEARER_CONFIG, config, MM_BEARER_MBIM_ASYNC_SLAAC, is_async_slaac_supported, NULL); diff --git a/src/plugins/nokia/mm-sim-nokia.c b/src/plugins/nokia/mm-sim-nokia.c index a0d7c81a..988508fd 100644 --- a/src/plugins/nokia/mm-sim-nokia.c +++ b/src/plugins/nokia/mm-sim-nokia.c @@ -25,6 +25,7 @@ #include <libmm-glib.h> #include "mm-sim-nokia.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMSimNokia, mm_sim_nokia, MM_TYPE_BASE_SIM) @@ -62,6 +63,7 @@ mm_sim_nokia_new (MMBaseModem *modem, callback, user_data, MM_BASE_SIM_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), "active", TRUE, /* by default always active */ NULL); } diff --git a/src/plugins/novatel/mm-broadband-bearer-novatel-lte.c b/src/plugins/novatel/mm-broadband-bearer-novatel-lte.c index 503997b3..50a93d63 100644 --- a/src/plugins/novatel/mm-broadband-bearer-novatel-lte.c +++ b/src/plugins/novatel/mm-broadband-bearer-novatel-lte.c @@ -32,6 +32,7 @@ #include "mm-broadband-bearer-novatel-lte.h" #include "mm-log-object.h" #include "mm-modem-helpers.h" +#include "mm-bind.h" #define QMISTATUS_TAG "$NWQMISTATUS:" @@ -551,6 +552,7 @@ mm_broadband_bearer_novatel_lte_new (MMBroadbandModemNovatelLte *modem, callback, user_data, MM_BASE_BEARER_MODEM, modem, + MM_BIND_TO, modem, MM_BASE_BEARER_CONFIG, config, NULL); } diff --git a/src/plugins/novatel/mm-sim-novatel-lte.c b/src/plugins/novatel/mm-sim-novatel-lte.c index 4d71bd80..51e4899b 100644 --- a/src/plugins/novatel/mm-sim-novatel-lte.c +++ b/src/plugins/novatel/mm-sim-novatel-lte.c @@ -25,6 +25,7 @@ #include <libmm-glib.h> #include "mm-modem-helpers.h" #include "mm-base-modem-at.h" +#include "mm-bind.h" #include "mm-sim-novatel-lte.h" @@ -215,6 +216,7 @@ mm_sim_novatel_lte_new (MMBaseModem *modem, callback, user_data, MM_BASE_SIM_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), "active", TRUE, /* by default always active */ NULL); } diff --git a/src/plugins/option/mm-broadband-bearer-hso.c b/src/plugins/option/mm-broadband-bearer-hso.c index c5c071b2..190ae6d7 100644 --- a/src/plugins/option/mm-broadband-bearer-hso.c +++ b/src/plugins/option/mm-broadband-bearer-hso.c @@ -33,6 +33,7 @@ #include "mm-log-object.h" #include "mm-modem-helpers.h" #include "mm-daemon-enums-types.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMBroadbandBearerHso, mm_broadband_bearer_hso, MM_TYPE_BROADBAND_BEARER); @@ -779,6 +780,7 @@ mm_broadband_bearer_hso_new (MMBroadbandModemHso *modem, callback, user_data, MM_BASE_BEARER_MODEM, modem, + MM_BIND_TO, modem, MM_BASE_BEARER_CONFIG, config, NULL); } diff --git a/src/plugins/option/mm-sim-option.c b/src/plugins/option/mm-sim-option.c index 0871c4f2..236d79fc 100644 --- a/src/plugins/option/mm-sim-option.c +++ b/src/plugins/option/mm-sim-option.c @@ -25,6 +25,7 @@ #include <libmm-glib.h> #include "mm-sim-option.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMSimOption, mm_sim_option, MM_TYPE_BASE_SIM) @@ -62,6 +63,7 @@ mm_sim_option_new (MMBaseModem *modem, callback, user_data, MM_BASE_SIM_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), "active", TRUE, /* by default always active */ NULL); } diff --git a/src/plugins/pantech/mm-sim-pantech.c b/src/plugins/pantech/mm-sim-pantech.c index 33414572..d2692abb 100644 --- a/src/plugins/pantech/mm-sim-pantech.c +++ b/src/plugins/pantech/mm-sim-pantech.c @@ -25,6 +25,7 @@ #include <libmm-glib.h> #include "mm-sim-pantech.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMSimPantech, mm_sim_pantech, MM_TYPE_BASE_SIM) @@ -62,6 +63,7 @@ mm_sim_pantech_new (MMBaseModem *modem, callback, user_data, MM_BASE_SIM_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), "active", TRUE, /* by default always active */ NULL); } diff --git a/src/plugins/sierra/mm-broadband-bearer-sierra.c b/src/plugins/sierra/mm-broadband-bearer-sierra.c index 4f0c9358..4cbee733 100644 --- a/src/plugins/sierra/mm-broadband-bearer-sierra.c +++ b/src/plugins/sierra/mm-broadband-bearer-sierra.c @@ -32,6 +32,7 @@ #include "mm-log-object.h" #include "mm-modem-helpers.h" #include "mm-modem-helpers-sierra.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMBroadbandBearerSierra, mm_broadband_bearer_sierra, MM_TYPE_BROADBAND_BEARER); @@ -599,6 +600,7 @@ mm_broadband_bearer_sierra_new (MMBroadbandModem *modem, callback, user_data, MM_BASE_BEARER_MODEM, modem, + MM_BIND_TO, modem, MM_BASE_BEARER_CONFIG, config, MM_BROADBAND_BEARER_SIERRA_IS_ICERA, is_icera, NULL); diff --git a/src/plugins/sierra/mm-sim-sierra.c b/src/plugins/sierra/mm-sim-sierra.c index 2f3caa48..5b141f41 100644 --- a/src/plugins/sierra/mm-sim-sierra.c +++ b/src/plugins/sierra/mm-sim-sierra.c @@ -27,6 +27,7 @@ #include <libmm-glib.h> #include "mm-modem-helpers.h" #include "mm-base-modem-at.h" +#include "mm-bind.h" #include "mm-sim-sierra.h" @@ -139,6 +140,7 @@ mm_sim_sierra_new (MMBaseModem *modem, callback, user_data, MM_BASE_SIM_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), "active", TRUE, /* by default always active */ NULL); } diff --git a/src/plugins/ublox/mm-broadband-bearer-ublox.c b/src/plugins/ublox/mm-broadband-bearer-ublox.c index e8eb007b..07180dde 100644 --- a/src/plugins/ublox/mm-broadband-bearer-ublox.c +++ b/src/plugins/ublox/mm-broadband-bearer-ublox.c @@ -32,6 +32,7 @@ #include "mm-ublox-enums-types.h" #include "mm-modem-helpers.h" #include "mm-modem-helpers-ublox.h" +#include "mm-bind.h" G_DEFINE_TYPE (MMBroadbandBearerUblox, mm_broadband_bearer_ublox, MM_TYPE_BROADBAND_BEARER) @@ -927,6 +928,7 @@ mm_broadband_bearer_ublox_new (MMBroadbandModem *modem, callback, user_data, MM_BASE_BEARER_MODEM, modem, + MM_BIND_TO, modem, MM_BASE_BEARER_CONFIG, config, MM_BROADBAND_BEARER_UBLOX_USB_PROFILE, profile, MM_BROADBAND_BEARER_UBLOX_NETWORKING_MODE, mode, diff --git a/src/plugins/ublox/mm-broadband-modem-ublox.c b/src/plugins/ublox/mm-broadband-modem-ublox.c index cbda1911..3c58adda 100644 --- a/src/plugins/ublox/mm-broadband-modem-ublox.c +++ b/src/plugins/ublox/mm-broadband-modem-ublox.c @@ -1506,6 +1506,7 @@ create_call (MMIfaceModemVoice *self, const gchar *number) { return mm_base_call_new (MM_BASE_MODEM (self), + G_OBJECT (self), direction, number, TRUE, /* skip_incoming_timeout */ diff --git a/src/plugins/ublox/mm-sim-ublox.c b/src/plugins/ublox/mm-sim-ublox.c index 5850767e..7650800a 100644 --- a/src/plugins/ublox/mm-sim-ublox.c +++ b/src/plugins/ublox/mm-sim-ublox.c @@ -26,6 +26,7 @@ #include "mm-log.h" #include "mm-modem-helpers.h" #include "mm-base-modem-at.h" +#include "mm-bind.h" #include "mm-sim-ublox.h" @@ -144,6 +145,7 @@ mm_sim_ublox_new (MMBaseModem *modem, callback, user_data, MM_BASE_SIM_MODEM, modem, + MM_BIND_TO, G_OBJECT (modem), "active", TRUE, /* by default always active */ NULL); } |