aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mm-broadband-modem-mbim.c4
-rw-r--r--src/mm-broadband-modem-qmi.c10
-rw-r--r--src/mm-broadband-modem.c4
-rw-r--r--src/mm-iface-modem-messaging.c179
-rw-r--r--src/mm-iface-modem-messaging.h15
-rw-r--r--src/plugins/altair/mm-broadband-modem-altair-lte.c10
-rw-r--r--src/plugins/cinterion/mm-broadband-modem-cinterion.c18
-rw-r--r--src/plugins/iridium/mm-broadband-modem-iridium.c8
-rw-r--r--src/plugins/nokia/mm-broadband-modem-nokia.c6
-rw-r--r--src/plugins/novatel/mm-broadband-modem-novatel.c10
-rw-r--r--src/plugins/pantech/mm-broadband-modem-pantech.c8
-rw-r--r--src/plugins/thuraya/mm-broadband-modem-thuraya.c8
12 files changed, 126 insertions, 154 deletions
diff --git a/src/mm-broadband-modem-mbim.c b/src/mm-broadband-modem-mbim.c
index 842736ba..401cc7fb 100644
--- a/src/mm-broadband-modem-mbim.c
+++ b/src/mm-broadband-modem-mbim.c
@@ -56,7 +56,7 @@ static void iface_modem_3gpp_init (MMIfaceModem3gppInterface
static void iface_modem_3gpp_profile_manager_init (MMIfaceModem3gppProfileManagerInterface *iface);
static void iface_modem_3gpp_ussd_init (MMIfaceModem3gppUssdInterface *iface);
static void iface_modem_location_init (MMIfaceModemLocationInterface *iface);
-static void iface_modem_messaging_init (MMIfaceModemMessaging *iface);
+static void iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface);
static void iface_modem_signal_init (MMIfaceModemSignal *iface);
static void iface_modem_sar_init (MMIfaceModemSar *iface);
#if defined WITH_QMI && QMI_MBIM_QMUX_SUPPORTED
@@ -10295,7 +10295,7 @@ iface_modem_location_init (MMIfaceModemLocationInterface *iface)
}
static void
-iface_modem_messaging_init (MMIfaceModemMessaging *iface)
+iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface)
{
iface->check_support = messaging_check_support;
iface->check_support_finish = messaging_check_support_finish;
diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c
index be91c2c7..8c07d65b 100644
--- a/src/mm-broadband-modem-qmi.c
+++ b/src/mm-broadband-modem-qmi.c
@@ -59,7 +59,7 @@ static void iface_modem_3gpp_profile_manager_init (MMIfaceModem3gppProfileManage
static void iface_modem_3gpp_ussd_init (MMIfaceModem3gppUssdInterface *iface);
static void iface_modem_voice_init (MMIfaceModemVoice *iface);
static void iface_modem_cdma_init (MMIfaceModemCdma *iface);
-static void iface_modem_messaging_init (MMIfaceModemMessaging *iface);
+static void iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface);
static void iface_modem_location_init (MMIfaceModemLocationInterface *iface);
static void iface_modem_oma_init (MMIfaceModemOma *iface);
static void iface_modem_firmware_init (MMIfaceModemFirmwareInterface *iface);
@@ -67,9 +67,9 @@ static void iface_modem_sar_init (MMIfaceModemSar
static void iface_modem_signal_init (MMIfaceModemSignal *iface);
static void shared_qmi_init (MMSharedQmi *iface);
-static MMIfaceModemLocationInterface *iface_modem_location_parent;
-static MMIfaceModemMessaging *iface_modem_messaging_parent;
-static MMIfaceModemVoice *iface_modem_voice_parent;
+static MMIfaceModemLocationInterface *iface_modem_location_parent;
+static MMIfaceModemMessagingInterface *iface_modem_messaging_parent;
+static MMIfaceModemVoice *iface_modem_voice_parent;
G_DEFINE_TYPE_EXTENDED (MMBroadbandModemQmi, mm_broadband_modem_qmi, MM_TYPE_BROADBAND_MODEM, 0,
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM, iface_modem_init)
@@ -14076,7 +14076,7 @@ iface_modem_cdma_init (MMIfaceModemCdma *iface)
}
static void
-iface_modem_messaging_init (MMIfaceModemMessaging *iface)
+iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface)
{
iface_modem_messaging_parent = g_type_interface_peek_parent (iface);
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
index c866f60a..d50b096d 100644
--- a/src/mm-broadband-modem.c
+++ b/src/mm-broadband-modem.c
@@ -68,7 +68,7 @@ static void iface_modem_3gpp_ussd_init (MMIfaceModem3gppUssdInterface
static void iface_modem_cdma_init (MMIfaceModemCdma *iface);
static void iface_modem_simple_init (MMIfaceModemSimple *iface);
static void iface_modem_location_init (MMIfaceModemLocationInterface *iface);
-static void iface_modem_messaging_init (MMIfaceModemMessaging *iface);
+static void iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface);
static void iface_modem_voice_init (MMIfaceModemVoice *iface);
static void iface_modem_time_init (MMIfaceModemTime *iface);
static void iface_modem_signal_init (MMIfaceModemSignal *iface);
@@ -13679,7 +13679,7 @@ iface_modem_location_init (MMIfaceModemLocationInterface *iface)
}
static void
-iface_modem_messaging_init (MMIfaceModemMessaging *iface)
+iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface)
{
iface->check_support = modem_messaging_check_support;
iface->check_support_finish = modem_messaging_check_support_finish;
diff --git a/src/mm-iface-modem-messaging.c b/src/mm-iface-modem-messaging.c
index e5021058..6d515132 100644
--- a/src/mm-iface-modem-messaging.c
+++ b/src/mm-iface-modem-messaging.c
@@ -31,6 +31,8 @@ static GQuark support_checked_quark;
static GQuark supported_quark;
static GQuark storage_context_quark;
+G_DEFINE_INTERFACE (MMIfaceModemMessaging, mm_iface_modem_messaging, MM_TYPE_IFACE_MODEM)
+
/*****************************************************************************/
guint8
@@ -92,9 +94,9 @@ mm_iface_modem_messaging_bind_simple_status (MMIfaceModemMessaging *self,
MMBaseSms *
mm_iface_modem_messaging_create_sms (MMIfaceModemMessaging *self)
{
- g_assert (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->create_sms != NULL);
+ g_assert (MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->create_sms != NULL);
- return MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->create_sms (self);
+ return MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->create_sms (self);
}
/*****************************************************************************/
@@ -527,7 +529,7 @@ disable_unsolicited_events_ready (MMIfaceModemMessaging *self,
DisablingContext *ctx;
GError *error = NULL;
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->disable_unsolicited_events_finish (self, res, &error);
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->disable_unsolicited_events_finish (self, res, &error);
if (error) {
g_task_return_error (task, error);
g_object_unref (task);
@@ -548,7 +550,7 @@ cleanup_unsolicited_events_ready (MMIfaceModemMessaging *self,
DisablingContext *ctx;
GError *error = NULL;
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->cleanup_unsolicited_events_finish (self, res, &error);
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->cleanup_unsolicited_events_finish (self, res, &error);
if (error) {
g_task_return_error (task, error);
g_object_unref (task);
@@ -577,9 +579,9 @@ interface_disabling_step (GTask *task)
case DISABLING_STEP_DISABLE_UNSOLICITED_EVENTS:
/* Allow cleaning up unsolicited events */
- if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->disable_unsolicited_events &&
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->disable_unsolicited_events_finish) {
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->disable_unsolicited_events (
+ if (MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->disable_unsolicited_events &&
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->disable_unsolicited_events_finish) {
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->disable_unsolicited_events (
self,
(GAsyncReadyCallback)disable_unsolicited_events_ready,
task);
@@ -590,9 +592,9 @@ interface_disabling_step (GTask *task)
case DISABLING_STEP_CLEANUP_UNSOLICITED_EVENTS:
/* Allow cleaning up unsolicited events */
- if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->cleanup_unsolicited_events &&
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->cleanup_unsolicited_events_finish) {
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->cleanup_unsolicited_events (
+ if (MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->cleanup_unsolicited_events &&
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->cleanup_unsolicited_events_finish) {
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->cleanup_unsolicited_events (
self,
(GAsyncReadyCallback)cleanup_unsolicited_events_ready,
task);
@@ -693,7 +695,7 @@ setup_sms_format_ready (MMIfaceModemMessaging *self,
EnablingContext *ctx;
GError *error = NULL;
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->setup_sms_format_finish (self, res, &error);
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->setup_sms_format_finish (self, res, &error);
if (error) {
g_task_return_error (task, error);
g_object_unref (task);
@@ -718,7 +720,7 @@ load_initial_sms_parts_ready (MMIfaceModemMessaging *self,
ctx = g_task_get_task_data (task);
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->load_initial_sms_parts_finish (self, res, &error);
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->load_initial_sms_parts_finish (self, res, &error);
if (error) {
StorageContext *storage_ctx;
@@ -744,7 +746,7 @@ set_default_storage_ready (MMIfaceModemMessaging *self,
EnablingContext *ctx;
GError *error = NULL;
- if (!MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->set_default_storage_finish (self, res, &error)) {
+ if (!MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->set_default_storage_finish (self, res, &error)) {
mm_obj_warn (self, "could not set default storage: %s", error->message);
g_error_free (error);
}
@@ -787,7 +789,7 @@ load_initial_sms_parts_from_storages (GTask *task)
return;
}
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->load_initial_sms_parts (
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->load_initial_sms_parts (
self,
g_array_index (storage_ctx->supported_mem1,
MMSmsStorage,
@@ -804,7 +806,7 @@ setup_unsolicited_events_ready (MMIfaceModemMessaging *self,
EnablingContext *ctx;
GError *error = NULL;
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->setup_unsolicited_events_finish (self, res, &error);
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->setup_unsolicited_events_finish (self, res, &error);
if (error) {
g_task_return_error (task, error);
g_object_unref (task);
@@ -826,7 +828,7 @@ enable_unsolicited_events_ready (MMIfaceModemMessaging *self,
GError *error = NULL;
/* Not critical! */
- if (!MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->enable_unsolicited_events_finish (self, res, &error)) {
+ if (!MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->enable_unsolicited_events_finish (self, res, &error)) {
mm_obj_dbg (self, "couldn't enable unsolicited events: %s", error->message);
g_error_free (error);
}
@@ -924,9 +926,9 @@ interface_enabling_step (GTask *task)
case ENABLING_STEP_SETUP_SMS_FORMAT:
/* Allow setting SMS format to use */
- if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->setup_sms_format &&
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->setup_sms_format_finish) {
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->setup_sms_format (
+ if (MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->setup_sms_format &&
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->setup_sms_format_finish) {
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->setup_sms_format (
self,
(GAsyncReadyCallback)setup_sms_format_ready,
task);
@@ -951,9 +953,9 @@ interface_enabling_step (GTask *task)
if (default_storage == MM_SMS_STORAGE_UNKNOWN)
mm_obj_warn (self, "cannot set default storage, none of the suggested ones supported");
- else if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->set_default_storage &&
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->set_default_storage_finish) {
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->set_default_storage (
+ else if (MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->set_default_storage &&
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->set_default_storage_finish) {
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->set_default_storage (
self,
default_storage,
(GAsyncReadyCallback)set_default_storage_ready,
@@ -966,8 +968,8 @@ interface_enabling_step (GTask *task)
case ENABLING_STEP_LOAD_INITIAL_SMS_PARTS:
/* Allow loading the initial list of SMS parts */
- if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->load_initial_sms_parts &&
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->load_initial_sms_parts_finish) {
+ if (MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->load_initial_sms_parts &&
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->load_initial_sms_parts_finish) {
load_initial_sms_parts_from_storages (task);
return;
}
@@ -976,9 +978,9 @@ interface_enabling_step (GTask *task)
case ENABLING_STEP_SETUP_UNSOLICITED_EVENTS:
/* Allow setting up unsolicited events */
- if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->setup_unsolicited_events &&
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->setup_unsolicited_events_finish) {
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->setup_unsolicited_events (
+ if (MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->setup_unsolicited_events &&
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->setup_unsolicited_events_finish) {
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->setup_unsolicited_events (
self,
(GAsyncReadyCallback)setup_unsolicited_events_ready,
task);
@@ -989,9 +991,9 @@ interface_enabling_step (GTask *task)
case ENABLING_STEP_ENABLE_UNSOLICITED_EVENTS:
/* Allow setting up unsolicited events */
- if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->enable_unsolicited_events &&
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->enable_unsolicited_events_finish) {
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->enable_unsolicited_events (
+ if (MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->enable_unsolicited_events &&
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->enable_unsolicited_events_finish) {
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->enable_unsolicited_events (
self,
(GAsyncReadyCallback)enable_unsolicited_events_ready,
task);
@@ -1095,7 +1097,7 @@ load_supported_storages_ready (MMIfaceModemMessaging *self,
ctx = g_task_get_task_data (task);
storage_ctx = get_storage_context (self);
- if (!MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->load_supported_storages_finish (
+ if (!MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->load_supported_storages_finish (
self,
res,
&storage_ctx->supported_mem1,
@@ -1171,9 +1173,7 @@ check_support_ready (MMIfaceModemMessaging *self,
InitializationContext *ctx;
GError *error = NULL;
- if (!MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->check_support_finish (self,
- res,
- &error)) {
+ if (!MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->check_support_finish (self, res, &error)) {
if (error) {
/* This error shouldn't be treated as critical */
mm_obj_dbg (self, "messaging support check failed: %s", error->message);
@@ -1200,7 +1200,7 @@ init_current_storages_ready (MMIfaceModemMessaging *self,
InitializationContext *ctx;
GError *error = NULL;
- if (!MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->init_current_storages_finish (
+ if (!MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->init_current_storages_finish (
self,
res,
&error)) {
@@ -1255,9 +1255,9 @@ interface_initialization_step (GTask *task)
supported_quark,
GUINT_TO_POINTER (FALSE));
- if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->check_support &&
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->check_support_finish) {
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->check_support (
+ if (MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->check_support &&
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->check_support_finish) {
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->check_support (
self,
(GAsyncReadyCallback)check_support_ready,
task);
@@ -1284,9 +1284,9 @@ interface_initialization_step (GTask *task)
/* fall through */
case INITIALIZATION_STEP_LOAD_SUPPORTED_STORAGES:
- if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->load_supported_storages &&
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->load_supported_storages_finish) {
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->load_supported_storages (
+ if (MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->load_supported_storages &&
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->load_supported_storages_finish) {
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->load_supported_storages (
self,
(GAsyncReadyCallback)load_supported_storages_ready,
task);
@@ -1296,9 +1296,9 @@ interface_initialization_step (GTask *task)
/* fall through */
case INITIALIZATION_STEP_INIT_CURRENT_STORAGES:
- if (MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->init_current_storages &&
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->init_current_storages_finish) {
- MM_IFACE_MODEM_MESSAGING_GET_INTERFACE (self)->init_current_storages (
+ if (MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->init_current_storages &&
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->init_current_storages_finish) {
+ MM_IFACE_MODEM_MESSAGING_GET_IFACE (self)->init_current_storages (
self,
(GAsyncReadyCallback)init_current_storages_ready,
task);
@@ -1400,69 +1400,46 @@ mm_iface_modem_messaging_shutdown (MMIfaceModemMessaging *self)
/*****************************************************************************/
static void
-iface_modem_messaging_init (gpointer g_iface)
+mm_iface_modem_messaging_default_init (MMIfaceModemMessagingInterface *iface)
{
- static gboolean initialized = FALSE;
+ static gsize initialized = 0;
- if (initialized)
+ if (!g_once_init_enter (&initialized))
return;
/* Properties */
- g_object_interface_install_property
- (g_iface,
- g_param_spec_object (MM_IFACE_MODEM_MESSAGING_DBUS_SKELETON,
- "Messaging DBus skeleton",
- "DBus skeleton for the Messaging interface",
- MM_GDBUS_TYPE_MODEM_MESSAGING_SKELETON,
- G_PARAM_READWRITE));
-
- g_object_interface_install_property
- (g_iface,
- g_param_spec_object (MM_IFACE_MODEM_MESSAGING_SMS_LIST,
- "SMS list",
- "List of SMS objects managed in the interface",
- MM_TYPE_SMS_LIST,
+ g_object_interface_install_property (
+ iface,
+ g_param_spec_object (MM_IFACE_MODEM_MESSAGING_DBUS_SKELETON,
+ "Messaging DBus skeleton",
+ "DBus skeleton for the Messaging interface",
+ MM_GDBUS_TYPE_MODEM_MESSAGING_SKELETON,
+ G_PARAM_READWRITE));
+
+ g_object_interface_install_property (
+ iface,
+ g_param_spec_object (MM_IFACE_MODEM_MESSAGING_SMS_LIST,
+ "SMS list",
+ "List of SMS objects managed in the interface",
+ MM_TYPE_SMS_LIST,
+ G_PARAM_READWRITE));
+
+ g_object_interface_install_property (
+ iface,
+ g_param_spec_boolean (MM_IFACE_MODEM_MESSAGING_SMS_PDU_MODE,
+ "PDU mode",
+ "Whether PDU mode should be used",
+ FALSE,
G_PARAM_READWRITE));
- g_object_interface_install_property
- (g_iface,
- g_param_spec_boolean (MM_IFACE_MODEM_MESSAGING_SMS_PDU_MODE,
- "PDU mode",
- "Whether PDU mode should be used",
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_interface_install_property
- (g_iface,
- g_param_spec_enum (MM_IFACE_MODEM_MESSAGING_SMS_DEFAULT_STORAGE,
- "SMS default storage",
- "Default storage to be used when storing/receiving SMS messages",
- MM_TYPE_SMS_STORAGE,
- MM_SMS_STORAGE_ME,
- G_PARAM_READWRITE));
-
- initialized = TRUE;
-}
-
-GType
-mm_iface_modem_messaging_get_type (void)
-{
- static GType iface_modem_messaging_type = 0;
-
- if (!G_UNLIKELY (iface_modem_messaging_type)) {
- static const GTypeInfo info = {
- sizeof (MMIfaceModemMessaging), /* class_size */
- iface_modem_messaging_init, /* base_init */
- NULL, /* base_finalize */
- };
-
- iface_modem_messaging_type = g_type_register_static (G_TYPE_INTERFACE,
- "MMIfaceModemMessaging",
- &info,
- 0);
-
- g_type_interface_add_prerequisite (iface_modem_messaging_type, MM_TYPE_IFACE_MODEM);
- }
+ g_object_interface_install_property (
+ iface,
+ g_param_spec_enum (MM_IFACE_MODEM_MESSAGING_SMS_DEFAULT_STORAGE,
+ "SMS default storage",
+ "Default storage to be used when storing/receiving SMS messages",
+ MM_TYPE_SMS_STORAGE,
+ MM_SMS_STORAGE_ME,
+ G_PARAM_READWRITE));
- return iface_modem_messaging_type;
+ g_once_init_leave (&initialized, 1);
}
diff --git a/src/mm-iface-modem-messaging.h b/src/mm-iface-modem-messaging.h
index 64dfb2b1..2d8f7072 100644
--- a/src/mm-iface-modem-messaging.h
+++ b/src/mm-iface-modem-messaging.h
@@ -25,19 +25,17 @@
#include "mm-sms-part.h"
#include "mm-base-sms.h"
-#define MM_TYPE_IFACE_MODEM_MESSAGING (mm_iface_modem_messaging_get_type ())
-#define MM_IFACE_MODEM_MESSAGING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_IFACE_MODEM_MESSAGING, MMIfaceModemMessaging))
-#define MM_IS_IFACE_MODEM_MESSAGING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_IFACE_MODEM_MESSAGING))
-#define MM_IFACE_MODEM_MESSAGING_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MM_TYPE_IFACE_MODEM_MESSAGING, MMIfaceModemMessaging))
+#include "mm-iface-modem.h"
+
+#define MM_TYPE_IFACE_MODEM_MESSAGING mm_iface_modem_messaging_get_type ()
+G_DECLARE_INTERFACE (MMIfaceModemMessaging, mm_iface_modem_messaging, MM, IFACE_MODEM_MESSAGING, MMIfaceModem)
#define MM_IFACE_MODEM_MESSAGING_DBUS_SKELETON "iface-modem-messaging-dbus-skeleton"
#define MM_IFACE_MODEM_MESSAGING_SMS_LIST "iface-modem-messaging-sms-list"
#define MM_IFACE_MODEM_MESSAGING_SMS_PDU_MODE "iface-modem-messaging-sms-pdu-mode"
#define MM_IFACE_MODEM_MESSAGING_SMS_DEFAULT_STORAGE "iface-modem-messaging-sms-default-storage"
-typedef struct _MMIfaceModemMessaging MMIfaceModemMessaging;
-
-struct _MMIfaceModemMessaging {
+struct _MMIfaceModemMessagingInterface {
GTypeInterface g_iface;
/* Check for Messaging support (async) */
@@ -133,9 +131,6 @@ struct _MMIfaceModemMessaging {
MMBaseSms * (* create_sms) (MMIfaceModemMessaging *self);
};
-GType mm_iface_modem_messaging_get_type (void);
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMIfaceModemMessaging, g_object_unref)
-
/* Initialize Messaging interface (async) */
void mm_iface_modem_messaging_initialize (MMIfaceModemMessaging *self,
GCancellable *cancellable,
diff --git a/src/plugins/altair/mm-broadband-modem-altair-lte.c b/src/plugins/altair/mm-broadband-modem-altair-lte.c
index ea6fa8be..fcfa5806 100644
--- a/src/plugins/altair/mm-broadband-modem-altair-lte.c
+++ b/src/plugins/altair/mm-broadband-modem-altair-lte.c
@@ -41,10 +41,10 @@
#include "mm-serial-parsers.h"
#include "mm-bearer-list.h"
-static void iface_modem_init (MMIfaceModemInterface *iface);
-static void iface_modem_3gpp_init (MMIfaceModem3gppInterface *iface);
-static void iface_modem_3gpp_ussd_init (MMIfaceModem3gppUssdInterface *iface);
-static void iface_modem_messaging_init (MMIfaceModemMessaging *iface);
+static void iface_modem_init (MMIfaceModemInterface *iface);
+static void iface_modem_3gpp_init (MMIfaceModem3gppInterface *iface);
+static void iface_modem_3gpp_ussd_init (MMIfaceModem3gppUssdInterface *iface);
+static void iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface);
static MMIfaceModem3gppInterface *iface_modem_3gpp_parent;
@@ -1287,7 +1287,7 @@ iface_modem_3gpp_init (MMIfaceModem3gppInterface *iface)
}
static void
-iface_modem_messaging_init (MMIfaceModemMessaging *iface)
+iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface)
{
/* Currently no messaging is implemented - so skip checking*/
iface->check_support = NULL;
diff --git a/src/plugins/cinterion/mm-broadband-modem-cinterion.c b/src/plugins/cinterion/mm-broadband-modem-cinterion.c
index c3ff2693..92d349a6 100644
--- a/src/plugins/cinterion/mm-broadband-modem-cinterion.c
+++ b/src/plugins/cinterion/mm-broadband-modem-cinterion.c
@@ -42,14 +42,14 @@
#include "mm-broadband-bearer-cinterion.h"
#include "mm-iface-modem-signal.h"
-static void iface_modem_init (MMIfaceModemInterface *iface);
-static void iface_modem_3gpp_init (MMIfaceModem3gppInterface *iface);
-static void iface_modem_messaging_init (MMIfaceModemMessaging *iface);
-static void iface_modem_location_init (MMIfaceModemLocationInterface *iface);
-static void iface_modem_voice_init (MMIfaceModemVoice *iface);
-static void iface_modem_time_init (MMIfaceModemTime *iface);
-static void iface_modem_signal_init (MMIfaceModemSignal *iface);
-static void shared_cinterion_init (MMSharedCinterion *iface);
+static void iface_modem_init (MMIfaceModemInterface *iface);
+static void iface_modem_3gpp_init (MMIfaceModem3gppInterface *iface);
+static void iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface);
+static void iface_modem_location_init (MMIfaceModemLocationInterface *iface);
+static void iface_modem_voice_init (MMIfaceModemVoice *iface);
+static void iface_modem_time_init (MMIfaceModemTime *iface);
+static void iface_modem_signal_init (MMIfaceModemSignal *iface);
+static void shared_cinterion_init (MMSharedCinterion *iface);
static MMIfaceModemInterface *iface_modem_parent;
static MMIfaceModem3gppInterface *iface_modem_3gpp_parent;
@@ -3526,7 +3526,7 @@ iface_modem_3gpp_init (MMIfaceModem3gppInterface *iface)
}
static void
-iface_modem_messaging_init (MMIfaceModemMessaging *iface)
+iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface)
{
iface->check_support = messaging_check_support;
iface->check_support_finish = messaging_check_support_finish;
diff --git a/src/plugins/iridium/mm-broadband-modem-iridium.c b/src/plugins/iridium/mm-broadband-modem-iridium.c
index 46542ed1..e9cdc4bd 100644
--- a/src/plugins/iridium/mm-broadband-modem-iridium.c
+++ b/src/plugins/iridium/mm-broadband-modem-iridium.c
@@ -34,9 +34,9 @@
#include "mm-bearer-iridium.h"
#include "mm-modem-helpers.h"
-static void iface_modem_init (MMIfaceModemInterface *iface);
-static void iface_modem_3gpp_init (MMIfaceModem3gppInterface *iface);
-static void iface_modem_messaging_init (MMIfaceModemMessaging *iface);
+static void iface_modem_init (MMIfaceModemInterface *iface);
+static void iface_modem_3gpp_init (MMIfaceModem3gppInterface *iface);
+static void iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface);
G_DEFINE_TYPE_EXTENDED (MMBroadbandModemIridium, mm_broadband_modem_iridium, MM_TYPE_BROADBAND_MODEM, 0,
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM, iface_modem_init)
@@ -420,7 +420,7 @@ iface_modem_3gpp_init (MMIfaceModem3gppInterface *iface)
}
static void
-iface_modem_messaging_init (MMIfaceModemMessaging *iface)
+iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface)
{
iface->enable_unsolicited_events = messaging_enable_unsolicited_events;
iface->enable_unsolicited_events_finish = messaging_enable_unsolicited_events_finish;
diff --git a/src/plugins/nokia/mm-broadband-modem-nokia.c b/src/plugins/nokia/mm-broadband-modem-nokia.c
index 41698a2c..0d166310 100644
--- a/src/plugins/nokia/mm-broadband-modem-nokia.c
+++ b/src/plugins/nokia/mm-broadband-modem-nokia.c
@@ -34,8 +34,8 @@
#include "mm-broadband-modem-nokia.h"
#include "mm-sim-nokia.h"
-static void iface_modem_init (MMIfaceModemInterface *iface);
-static void iface_modem_messaging_init (MMIfaceModemMessaging *iface);
+static void iface_modem_init (MMIfaceModemInterface *iface);
+static void iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface);
static MMIfaceModemInterface *iface_modem_parent;
@@ -373,7 +373,7 @@ mm_broadband_modem_nokia_init (MMBroadbandModemNokia *self)
}
static void
-iface_modem_messaging_init (MMIfaceModemMessaging *iface)
+iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface)
{
/* Don't even try to check messaging support */
iface->check_support = NULL;
diff --git a/src/plugins/novatel/mm-broadband-modem-novatel.c b/src/plugins/novatel/mm-broadband-modem-novatel.c
index 904d3c28..586b1b50 100644
--- a/src/plugins/novatel/mm-broadband-modem-novatel.c
+++ b/src/plugins/novatel/mm-broadband-modem-novatel.c
@@ -38,10 +38,10 @@
#include "libqcdm/src/result.h"
#include "mm-log-object.h"
-static void iface_modem_init (MMIfaceModemInterface *iface);
-static void iface_modem_messaging_init (MMIfaceModemMessaging *iface);
-static void iface_modem_cdma_init (MMIfaceModemCdma *iface);
-static void iface_modem_time_init (MMIfaceModemTime *iface);
+static void iface_modem_init (MMIfaceModemInterface *iface);
+static void iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface);
+static void iface_modem_cdma_init (MMIfaceModemCdma *iface);
+static void iface_modem_time_init (MMIfaceModemTime *iface);
static MMIfaceModemInterface *iface_modem_parent;
@@ -1577,7 +1577,7 @@ iface_modem_init (MMIfaceModemInterface *iface)
}
static void
-iface_modem_messaging_init (MMIfaceModemMessaging *iface)
+iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface)
{
iface->enable_unsolicited_events = messaging_enable_unsolicited_events;
iface->enable_unsolicited_events_finish = messaging_enable_unsolicited_events_finish;
diff --git a/src/plugins/pantech/mm-broadband-modem-pantech.c b/src/plugins/pantech/mm-broadband-modem-pantech.c
index 510ef2d4..4327bf69 100644
--- a/src/plugins/pantech/mm-broadband-modem-pantech.c
+++ b/src/plugins/pantech/mm-broadband-modem-pantech.c
@@ -28,10 +28,10 @@
#include "mm-broadband-modem-pantech.h"
#include "mm-sim-pantech.h"
-static void iface_modem_init (MMIfaceModemInterface *iface);
-static void iface_modem_messaging_init (MMIfaceModemMessaging *iface);
+static void iface_modem_init (MMIfaceModemInterface *iface);
+static void iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface);
-static MMIfaceModemMessaging *iface_modem_messaging_parent;
+static MMIfaceModemMessagingInterface *iface_modem_messaging_parent;
G_DEFINE_TYPE_EXTENDED (MMBroadbandModemPantech, mm_broadband_modem_pantech, MM_TYPE_BROADBAND_MODEM, 0,
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM, iface_modem_init)
@@ -175,7 +175,7 @@ iface_modem_init (MMIfaceModemInterface *iface)
}
static void
-iface_modem_messaging_init (MMIfaceModemMessaging *iface)
+iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface)
{
iface_modem_messaging_parent = g_type_interface_peek_parent (iface);
diff --git a/src/plugins/thuraya/mm-broadband-modem-thuraya.c b/src/plugins/thuraya/mm-broadband-modem-thuraya.c
index 0571bb48..710c014f 100644
--- a/src/plugins/thuraya/mm-broadband-modem-thuraya.c
+++ b/src/plugins/thuraya/mm-broadband-modem-thuraya.c
@@ -34,9 +34,9 @@
#include "mm-modem-helpers.h"
#include "mm-modem-helpers-thuraya.h"
-static void iface_modem_init (MMIfaceModemInterface *iface);
-static void iface_modem_3gpp_init (MMIfaceModem3gppInterface *iface);
-static void iface_modem_messaging_init (MMIfaceModemMessaging *iface);
+static void iface_modem_init (MMIfaceModemInterface *iface);
+static void iface_modem_3gpp_init (MMIfaceModem3gppInterface *iface);
+static void iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface);
G_DEFINE_TYPE_EXTENDED (MMBroadbandModemThuraya, mm_broadband_modem_thuraya, MM_TYPE_BROADBAND_MODEM, 0,
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM, iface_modem_init)
@@ -274,7 +274,7 @@ iface_modem_3gpp_init (MMIfaceModem3gppInterface *iface)
}
static void
-iface_modem_messaging_init (MMIfaceModemMessaging *iface)
+iface_modem_messaging_init (MMIfaceModemMessagingInterface *iface)
{
iface->load_supported_storages = modem_messaging_load_supported_storages;
iface->load_supported_storages_finish = modem_messaging_load_supported_storages_finish;