aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Makefile.am4
-rw-r--r--plugins/zte/mm-broadband-modem-zte.c60
-rw-r--r--plugins/zte/mm-broadband-modem-zte.h49
-rw-r--r--plugins/zte/mm-plugin-zte.c12
4 files changed, 118 insertions, 7 deletions
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 1c58cb0e..a6372dc8 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -198,7 +198,9 @@ udevrules_DATA += nokia/77-mm-nokia-port-types.rules
# Zte
libmm_plugin_zte_la_SOURCES = \
zte/mm-plugin-zte.c \
- zte/mm-plugin-zte.h
+ zte/mm-plugin-zte.h \
+ zte/mm-broadband-modem-zte.h \
+ zte/mm-broadband-modem-zte.c
libmm_plugin_zte_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS)
libmm_plugin_zte_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS)
udevrules_DATA += zte/77-mm-zte-port-types.rules
diff --git a/plugins/zte/mm-broadband-modem-zte.c b/plugins/zte/mm-broadband-modem-zte.c
new file mode 100644
index 00000000..5aa8d61a
--- /dev/null
+++ b/plugins/zte/mm-broadband-modem-zte.c
@@ -0,0 +1,60 @@
+/* -*- 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) 2008 - 2009 Novell, Inc.
+ * Copyright (C) 2009 - 2012 Red Hat, Inc.
+ * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org>
+ */
+
+#include <config.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <ctype.h>
+
+#include "ModemManager.h"
+#include "mm-log.h"
+#include "mm-errors-types.h"
+#include "mm-base-modem-at.h"
+#include "mm-broadband-modem-zte.h"
+
+G_DEFINE_TYPE (MMBroadbandModemZte, mm_broadband_modem_zte, MM_TYPE_BROADBAND_MODEM);
+
+/*****************************************************************************/
+
+MMBroadbandModemZte *
+mm_broadband_modem_zte_new (const gchar *device,
+ const gchar *driver,
+ const gchar *plugin,
+ guint16 vendor_id,
+ guint16 product_id)
+{
+ return g_object_new (MM_TYPE_BROADBAND_MODEM_ZTE,
+ MM_BASE_MODEM_DEVICE, device,
+ MM_BASE_MODEM_DRIVER, driver,
+ MM_BASE_MODEM_PLUGIN, plugin,
+ MM_BASE_MODEM_VENDOR_ID, vendor_id,
+ MM_BASE_MODEM_PRODUCT_ID, product_id,
+ NULL);
+}
+
+static void
+mm_broadband_modem_zte_init (MMBroadbandModemZte *self)
+{
+}
+
+static void
+mm_broadband_modem_zte_class_init (MMBroadbandModemZteClass *klass)
+{
+}
diff --git a/plugins/zte/mm-broadband-modem-zte.h b/plugins/zte/mm-broadband-modem-zte.h
new file mode 100644
index 00000000..f9484cc7
--- /dev/null
+++ b/plugins/zte/mm-broadband-modem-zte.h
@@ -0,0 +1,49 @@
+/* -*- 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) 2008 - 2009 Novell, Inc.
+ * Copyright (C) 2009 - 2012 Red Hat, Inc.
+ * Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org>
+ */
+
+#ifndef MM_BROADBAND_MODEM_ZTE_H
+#define MM_BROADBAND_MODEM_ZTE_H
+
+#include "mm-broadband-modem.h"
+
+#define MM_TYPE_BROADBAND_MODEM_ZTE (mm_broadband_modem_zte_get_type ())
+#define MM_BROADBAND_MODEM_ZTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BROADBAND_MODEM_ZTE, MMBroadbandModemZte))
+#define MM_BROADBAND_MODEM_ZTE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BROADBAND_MODEM_ZTE, MMBroadbandModemZteClass))
+#define MM_IS_BROADBAND_MODEM_ZTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_BROADBAND_MODEM_ZTE))
+#define MM_IS_BROADBAND_MODEM_ZTE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_BROADBAND_MODEM_ZTE))
+#define MM_BROADBAND_MODEM_ZTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_BROADBAND_MODEM_ZTE, MMBroadbandModemZteClass))
+
+typedef struct _MMBroadbandModemZte MMBroadbandModemZte;
+typedef struct _MMBroadbandModemZteClass MMBroadbandModemZteClass;
+
+struct _MMBroadbandModemZte {
+ MMBroadbandModem parent;
+};
+
+struct _MMBroadbandModemZteClass{
+ MMBroadbandModemClass parent;
+};
+
+GType mm_broadband_modem_zte_get_type (void);
+
+MMBroadbandModemZte *mm_broadband_modem_zte_new (const gchar *device,
+ const gchar *driver,
+ const gchar *plugin,
+ guint16 vendor_id,
+ guint16 product_id);
+
+#endif /* MM_BROADBAND_MODEM_ZTE_H */
diff --git a/plugins/zte/mm-plugin-zte.c b/plugins/zte/mm-plugin-zte.c
index c08dc0ee..1dd06fbc 100644
--- a/plugins/zte/mm-plugin-zte.c
+++ b/plugins/zte/mm-plugin-zte.c
@@ -22,7 +22,7 @@
#include "mm-log.h"
#include "mm-plugin-zte.h"
-#include "mm-broadband-modem.h"
+#include "mm-broadband-modem-zte.h"
G_DEFINE_TYPE (MMPluginZte, mm_plugin_zte, MM_TYPE_PLUGIN)
@@ -58,11 +58,11 @@ create_modem (MMPlugin *self,
GList *probes,
GError **error)
{
- return MM_BASE_MODEM (mm_broadband_modem_new (sysfs_path,
- driver,
- mm_plugin_get_name (self),
- vendor,
- product));
+ return MM_BASE_MODEM (mm_broadband_modem_zte_new (sysfs_path,
+ driver,
+ mm_plugin_get_name (self),
+ vendor,
+ product));
}
static gboolean