diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-07-12 06:59:29 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-06 20:07:22 +0200 |
commit | 008beeedccf201c2e4f4438c26525bf9af71935d (patch) | |
tree | 2002413a0fbfbd427ba0bfe055f95406a6d277c5 /plugins | |
parent | efe2228515bcc702ac1f510b91629288d8876ed7 (diff) |
huawei: new `MMBroadbandModemHuawei' object
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Makefile.am | 4 | ||||
-rw-r--r-- | plugins/huawei/mm-broadband-modem-huawei.c | 60 | ||||
-rw-r--r-- | plugins/huawei/mm-broadband-modem-huawei.h | 49 | ||||
-rw-r--r-- | plugins/huawei/mm-plugin-huawei.c | 12 |
4 files changed, 118 insertions, 7 deletions
diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 2a0a96b7..f52ed9f2 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -97,7 +97,9 @@ libmm_plugin_gobi_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) # Huawei libmm_plugin_huawei_la_SOURCES = \ huawei/mm-plugin-huawei.c \ - huawei/mm-plugin-huawei.h + huawei/mm-plugin-huawei.h \ + huawei/mm-broadband-modem-huawei.c \ + huawei/mm-broadband-modem-huawei.h libmm_plugin_huawei_la_CPPFLAGS = $(PLUGIN_COMMON_COMPILER_FLAGS) libmm_plugin_huawei_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS) diff --git a/plugins/huawei/mm-broadband-modem-huawei.c b/plugins/huawei/mm-broadband-modem-huawei.c new file mode 100644 index 00000000..893d4b08 --- /dev/null +++ b/plugins/huawei/mm-broadband-modem-huawei.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 - 2011 Red Hat, Inc. + * Copyright (C) 2011 Google Inc. + */ + +#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-huawei.h" + +G_DEFINE_TYPE (MMBroadbandModemHuawei, mm_broadband_modem_huawei, MM_TYPE_BROADBAND_MODEM); + +/*****************************************************************************/ + +MMBroadbandModemHuawei * +mm_broadband_modem_huawei_new (const gchar *device, + const gchar *driver, + const gchar *plugin, + guint16 vendor_id, + guint16 product_id) +{ + return g_object_new (MM_TYPE_BROADBAND_MODEM_HUAWEI, + 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_huawei_init (MMBroadbandModemHuawei *self) +{ +} + +static void +mm_broadband_modem_huawei_class_init (MMBroadbandModemHuaweiClass *klass) +{ +} diff --git a/plugins/huawei/mm-broadband-modem-huawei.h b/plugins/huawei/mm-broadband-modem-huawei.h new file mode 100644 index 00000000..a5499424 --- /dev/null +++ b/plugins/huawei/mm-broadband-modem-huawei.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_HUAWEI_H +#define MM_BROADBAND_MODEM_HUAWEI_H + +#include "mm-broadband-modem.h" + +#define MM_TYPE_BROADBAND_MODEM_HUAWEI (mm_broadband_modem_huawei_get_type ()) +#define MM_BROADBAND_MODEM_HUAWEI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_BROADBAND_MODEM_HUAWEI, MMBroadbandModemHuawei)) +#define MM_BROADBAND_MODEM_HUAWEI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_BROADBAND_MODEM_HUAWEI, MMBroadbandModemHuaweiClass)) +#define MM_IS_BROADBAND_MODEM_HUAWEI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_BROADBAND_MODEM_HUAWEI)) +#define MM_IS_BROADBAND_MODEM_HUAWEI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_BROADBAND_MODEM_HUAWEI)) +#define MM_BROADBAND_MODEM_HUAWEI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_BROADBAND_MODEM_HUAWEI, MMBroadbandModemHuaweiClass)) + +typedef struct _MMBroadbandModemHuawei MMBroadbandModemHuawei; +typedef struct _MMBroadbandModemHuaweiClass MMBroadbandModemHuaweiClass; + +struct _MMBroadbandModemHuawei { + MMBroadbandModem parent; +}; + +struct _MMBroadbandModemHuaweiClass{ + MMBroadbandModemClass parent; +}; + +GType mm_broadband_modem_huawei_get_type (void); + +MMBroadbandModemHuawei *mm_broadband_modem_huawei_new (const gchar *device, + const gchar *driver, + const gchar *plugin, + guint16 vendor_id, + guint16 product_id); + +#endif /* MM_BROADBAND_MODEM_HUAWEI_H */ diff --git a/plugins/huawei/mm-plugin-huawei.c b/plugins/huawei/mm-plugin-huawei.c index a224a119..36dedf24 100644 --- a/plugins/huawei/mm-plugin-huawei.c +++ b/plugins/huawei/mm-plugin-huawei.c @@ -25,7 +25,7 @@ #include "mm-serial-enums-types.h" #include "mm-log.h" #include "mm-plugin-huawei.h" -#include "mm-broadband-modem.h" +#include "mm-broadband-modem-huawei.h" G_DEFINE_TYPE (MMPluginHuawei, mm_plugin_huawei, MM_TYPE_PLUGIN) @@ -423,11 +423,11 @@ create_modem (MMPlugin *self, { propagate_port_mode_results (probes); - 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_huawei_new (sysfs_path, + driver, + mm_plugin_get_name (self), + vendor, + product)); } static gboolean |