aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-09-06 16:04:25 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-09-06 19:58:02 +0200
commitbdf4df2b6b9dd795f12f457f6ce101fee9679c64 (patch)
tree36c438a102273376ec9d02e505880fc42797705d
parent912eea79ef8510d2df15f3732c2abdcb0ab3e21f (diff)
sms-qmi: new `MMSmsQmi' object
-rw-r--r--src/Makefile.am2
-rw-r--r--src/mm-broadband-modem-qmi.c11
-rw-r--r--src/mm-sms-qmi.c50
-rw-r--r--src/mm-sms-qmi.h50
4 files changed, 113 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index f0f676b7..c27b8534 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -222,6 +222,8 @@ endif
# Additional QMI support in ModemManager
if WITH_QMI
ModemManager_SOURCES += \
+ mm-sms-qmi.h \
+ mm-sms-qmi.c \
mm-sim-qmi.h \
mm-sim-qmi.c \
mm-bearer-qmi.h \
diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c
index c8ec6631..c19f104c 100644
--- a/src/mm-broadband-modem-qmi.c
+++ b/src/mm-broadband-modem-qmi.c
@@ -35,6 +35,7 @@
#include "mm-iface-modem-messaging.h"
#include "mm-sim-qmi.h"
#include "mm-bearer-qmi.h"
+#include "mm-sms-qmi.h"
static void iface_modem_init (MMIfaceModem *iface);
static void iface_modem_3gpp_init (MMIfaceModem3gpp *iface);
@@ -5554,6 +5555,15 @@ messaging_enable_unsolicited_events (MMIfaceModemMessaging *self,
}
/*****************************************************************************/
+/* Create SMS (Messaging interface) */
+
+static MMSms *
+messaging_create_sms (MMIfaceModemMessaging *self)
+{
+ return mm_sms_qmi_new (MM_BASE_MODEM (self));
+}
+
+/*****************************************************************************/
/* First initialization step */
typedef struct {
@@ -5913,6 +5923,7 @@ iface_modem_messaging_init (MMIfaceModemMessaging *iface)
iface->enable_unsolicited_events_finish = messaging_enable_disable_unsolicited_events_finish;
iface->disable_unsolicited_events = messaging_disable_unsolicited_events;
iface->disable_unsolicited_events_finish = messaging_enable_disable_unsolicited_events_finish;
+ iface->create_sms = messaging_create_sms;
}
static void
diff --git a/src/mm-sms-qmi.c b/src/mm-sms-qmi.c
new file mode 100644
index 00000000..fbe430ef
--- /dev/null
+++ b/src/mm-sms-qmi.c
@@ -0,0 +1,50 @@
+/* -*- 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) 2012 Google, Inc.
+ */
+
+#include <config.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <ctype.h>
+
+#include <ModemManager.h>
+#include <libmm-common.h>
+
+#include "mm-sms-qmi.h"
+#include "mm-base-modem.h"
+#include "mm-log.h"
+
+G_DEFINE_TYPE (MMSmsQmi, mm_sms_qmi, MM_TYPE_SMS);
+
+/*****************************************************************************/
+
+MMSms *
+mm_sms_qmi_new (MMBaseModem *modem)
+{
+ return MM_SMS (g_object_new (MM_TYPE_SMS_QMI,
+ MM_SMS_MODEM, modem,
+ NULL));
+}
+
+static void
+mm_sms_qmi_init (MMSmsQmi *self)
+{
+}
+
+static void
+mm_sms_qmi_class_init (MMSmsQmiClass *klass)
+{
+}
diff --git a/src/mm-sms-qmi.h b/src/mm-sms-qmi.h
new file mode 100644
index 00000000..d6871d3f
--- /dev/null
+++ b/src/mm-sms-qmi.h
@@ -0,0 +1,50 @@
+/* -*- 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:
+ *
+ * Author: Aleksander Morgado <aleksander@lanedo.com>
+ *
+ * Copyright (C) 2012 Google, Inc.
+ */
+
+#ifndef MM_SMS_QMI_H
+#define MM_SMS_QMI_H
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include <libmm-common.h>
+
+#include "mm-sms.h"
+
+#define MM_TYPE_SMS_QMI (mm_sms_qmi_get_type ())
+#define MM_SMS_QMI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SMS_QMI, MMSmsQmi))
+#define MM_SMS_QMI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_SMS_QMI, MMSmsQmiClass))
+#define MM_IS_SMS_QMI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_SMS_QMI))
+#define MM_IS_SMS_QMI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_SMS_QMI))
+#define MM_SMS_QMI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_SMS_QMI, MMSmsQmiClass))
+
+typedef struct _MMSmsQmi MMSmsQmi;
+typedef struct _MMSmsQmiClass MMSmsQmiClass;
+
+struct _MMSmsQmi {
+ MMSms parent;
+};
+
+struct _MMSmsQmiClass {
+ MMSmsClass parent;
+};
+
+GType mm_sms_qmi_get_type (void);
+
+MMSms *mm_sms_qmi_new (MMBaseModem *modem);
+
+#endif /* MM_SMS_QMI_H */