summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-06-16 16:45:27 +0200
committerAleksander Morgado <aleksander@lanedo.com>2013-06-24 19:37:38 +0200
commitcb046934c338954d14ab77fedef6b27d97d19183 (patch)
treeb7b52e506cd4c3bf0198f12787ff494d67a0e283 /src
parent76ff021a3c2a2e2339cfc3ce7d754f6e72dae5e7 (diff)
downloadModemManager-cb046934c338954d14ab77fedef6b27d97d19183.tar.gz
broadband-modem-mbim: check for messaging support
Diffstat (limited to 'src')
-rw-r--r--src/mm-broadband-modem-mbim.c68
1 files changed, 67 insertions, 1 deletions
diff --git a/src/mm-broadband-modem-mbim.c b/src/mm-broadband-modem-mbim.c
index 15b93d93f..eadb50db4 100644
--- a/src/mm-broadband-modem-mbim.c
+++ b/src/mm-broadband-modem-mbim.c
@@ -34,13 +34,16 @@
#include "mm-bearer-list.h"
#include "mm-iface-modem.h"
#include "mm-iface-modem-3gpp.h"
+#include "mm-iface-modem-messaging.h"
static void iface_modem_init (MMIfaceModem *iface);
static void iface_modem_3gpp_init (MMIfaceModem3gpp *iface);
+static void iface_modem_messaging_init (MMIfaceModemMessaging *iface);
G_DEFINE_TYPE_EXTENDED (MMBroadbandModemMbim, mm_broadband_modem_mbim, MM_TYPE_BROADBAND_MODEM, 0,
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM, iface_modem_init)
- G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_3GPP, iface_modem_3gpp_init))
+ G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_3GPP, iface_modem_3gpp_init)
+ G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_MESSAGING, iface_modem_messaging_init))
typedef enum {
PROCESS_NOTIFICATION_FLAG_NONE = 0,
@@ -2117,6 +2120,45 @@ modem_3gpp_register_in_network (MMIfaceModem3gpp *self,
}
/*****************************************************************************/
+/* Check support (Messaging interface) */
+
+static gboolean
+messaging_check_support_finish (MMIfaceModemMessaging *self,
+ GAsyncResult *res,
+ GError **error)
+{
+ /* no error expected here */
+ return g_simple_async_result_get_op_res_gboolean (G_SIMPLE_ASYNC_RESULT (res));
+}
+
+static void
+messaging_check_support (MMIfaceModemMessaging *_self,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ MMBroadbandModemMbim *self = MM_BROADBAND_MODEM_MBIM (_self);
+ GSimpleAsyncResult *result;
+
+ result = g_simple_async_result_new (G_OBJECT (self),
+ callback,
+ user_data,
+ messaging_check_support);
+
+ /* We only handle 3GPP messaging (PDU based) currently */
+ if (self->priv->caps_sms & MBIM_SMS_CAPS_PDU_RECEIVE &&
+ self->priv->caps_sms & MBIM_SMS_CAPS_PDU_SEND) {
+ mm_dbg ("Messaging capabilities supported");
+ g_simple_async_result_set_op_res_gboolean (result, TRUE);
+ } else {
+ mm_dbg ("Messaging capabilities not supported by this modem");
+ g_simple_async_result_set_op_res_gboolean (result, FALSE);
+ }
+
+ g_simple_async_result_complete_in_idle (result);
+ g_object_unref (result);
+}
+
+/*****************************************************************************/
MMBroadbandModemMbim *
mm_broadband_modem_mbim_new (const gchar *device,
@@ -2259,6 +2301,30 @@ iface_modem_3gpp_init (MMIfaceModem3gpp *iface)
}
static void
+iface_modem_messaging_init (MMIfaceModemMessaging *iface)
+{
+ iface->check_support = messaging_check_support;
+ iface->check_support_finish = messaging_check_support_finish;
+ iface->load_supported_storages = NULL;
+ iface->load_supported_storages_finish = NULL;
+ iface->setup_sms_format = NULL;
+ iface->setup_sms_format_finish = NULL;
+ iface->set_default_storage = NULL;
+ iface->set_default_storage_finish = NULL;
+ iface->load_initial_sms_parts = NULL;
+ iface->load_initial_sms_parts_finish = NULL;
+ iface->setup_unsolicited_events = NULL;
+ iface->setup_unsolicited_events_finish = NULL;
+ iface->cleanup_unsolicited_events = NULL;
+ iface->cleanup_unsolicited_events_finish = NULL;
+ iface->enable_unsolicited_events = NULL;
+ iface->enable_unsolicited_events_finish = NULL;
+ iface->disable_unsolicited_events = NULL;
+ iface->disable_unsolicited_events_finish = NULL;
+ iface->create_sms = NULL;
+}
+
+static void
mm_broadband_modem_mbim_class_init (MMBroadbandModemMbimClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);