aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-07-11 16:30:30 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-08-06 20:07:23 +0200
commit1f9c3ef61e687658516a868ab3f92e596c0832cb (patch)
tree827188467ec38ebd8c572e018e92dcf6c8a535a0
parent3fb5f1ae38cbcba50bc9a47613d4fee78f793524 (diff)
longcheer: new `MMBroadbandModemLongcheer' object
-rw-r--r--plugins/Makefile.am4
-rw-r--r--plugins/longcheer/mm-broadband-modem-longcheer.c60
-rw-r--r--plugins/longcheer/mm-broadband-modem-longcheer.h49
-rw-r--r--plugins/longcheer/mm-plugin-longcheer.c12
4 files changed, 118 insertions, 7 deletions
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index b2416216..1362cb4b 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -193,7 +193,9 @@ udevrules_DATA += nokia/77-mm-nokia-port-types.rules
# Longcheer (and rebranded dongles)
libmm_plugin_longcheer_la_SOURCES = \
longcheer/mm-plugin-longcheer.c \
- longcheer/mm-plugin-longcheer.h
+ longcheer/mm-plugin-longcheer.h \
+ longcheer/mm-broadband-modem-longcheer.h \
+ longcheer/mm-broadband-modem-longcheer.c
libmm_plugin_longcheer_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS)
libmm_plugin_longcheer_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS)
udevrules_DATA += longcheer/77-mm-longcheer-port-types.rules
diff --git a/plugins/longcheer/mm-broadband-modem-longcheer.c b/plugins/longcheer/mm-broadband-modem-longcheer.c
new file mode 100644
index 00000000..e4bb55ee
--- /dev/null
+++ b/plugins/longcheer/mm-broadband-modem-longcheer.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-longcheer.h"
+
+G_DEFINE_TYPE (MMBroadbandModemLongcheer, mm_broadband_modem_longcheer, MM_TYPE_BROADBAND_MODEM);
+
+/*****************************************************************************/
+
+MMBroadbandModemLongcheer *
+mm_broadband_modem_longcheer_new (const gchar *device,
+ const gchar *driver,
+ const gchar *plugin,
+ guint16 vendor_id,
+ guint16 product_id)
+{
+ return g_object_new (MM_TYPE_BROADBAND_MODEM_LONGCHEER,
+ 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_longcheer_init (MMBroadbandModemLongcheer *self)
+{
+}
+
+static void
+mm_broadband_modem_longcheer_class_init (MMBroadbandModemLongcheerClass *klass)
+{
+}
diff --git a/plugins/longcheer/mm-broadband-modem-longcheer.h b/plugins/longcheer/mm-broadband-modem-longcheer.h
new file mode 100644
index 00000000..35d45f85
--- /dev/null
+++ b/plugins/longcheer/mm-broadband-modem-longcheer.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_LONGCHEER_H
+#define MM_BROADBAND_MODEM_LONGCHEER_H
+
+#include "mm-broadband-modem.h"
+
+#define MM_TYPE_BROADBAND_MODEM_LONGCHEER (mm_broadband_modem_longcheer_get_type ())
+#define MM_BROADBAND_MODEM_LONGCHEER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BROADBAND_MODEM_LONGCHEER, MMBroadbandModemLongcheer))
+#define MM_BROADBAND_MODEM_LONGCHEER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BROADBAND_MODEM_LONGCHEER, MMBroadbandModemLongcheerClass))
+#define MM_IS_BROADBAND_MODEM_LONGCHEER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_BROADBAND_MODEM_LONGCHEER))
+#define MM_IS_BROADBAND_MODEM_LONGCHEER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_BROADBAND_MODEM_LONGCHEER))
+#define MM_BROADBAND_MODEM_LONGCHEER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_BROADBAND_MODEM_LONGCHEER, MMBroadbandModemLongcheerClass))
+
+typedef struct _MMBroadbandModemLongcheer MMBroadbandModemLongcheer;
+typedef struct _MMBroadbandModemLongcheerClass MMBroadbandModemLongcheerClass;
+
+struct _MMBroadbandModemLongcheer {
+ MMBroadbandModem parent;
+};
+
+struct _MMBroadbandModemLongcheerClass{
+ MMBroadbandModemClass parent;
+};
+
+GType mm_broadband_modem_longcheer_get_type (void);
+
+MMBroadbandModemLongcheer *mm_broadband_modem_longcheer_new (const gchar *device,
+ const gchar *driver,
+ const gchar *plugin,
+ guint16 vendor_id,
+ guint16 product_id);
+
+#endif /* MM_BROADBAND_MODEM_LONGCHEER_H */
diff --git a/plugins/longcheer/mm-plugin-longcheer.c b/plugins/longcheer/mm-plugin-longcheer.c
index f392cb76..4b94a590 100644
--- a/plugins/longcheer/mm-plugin-longcheer.c
+++ b/plugins/longcheer/mm-plugin-longcheer.c
@@ -23,7 +23,7 @@
#include "mm-log.h"
#include "mm-modem-helpers.h"
#include "mm-plugin-longcheer.h"
-#include "mm-broadband-modem.h"
+#include "mm-broadband-modem-longcheer.h"
G_DEFINE_TYPE (MMPluginLongcheer, mm_plugin_longcheer, MM_TYPE_PLUGIN)
@@ -187,11 +187,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_longcheer_new (sysfs_path,
+ driver,
+ mm_plugin_get_name (self),
+ vendor,
+ product));
}
static gboolean