diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-01-02 22:17:14 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-01-02 22:17:14 +0100 |
commit | e8a00fbb2a7cd2d85d67774b2bda11641e8586b7 (patch) | |
tree | 8d8fe841869b5c9e9a6f547c19d6c1c363b0d952 /plugins | |
parent | 5bbbce97de441f908dfdb738f8816b31153b75b4 (diff) | |
download | connman-e8a00fbb2a7cd2d85d67774b2bda11641e8586b7.tar.gz connman-e8a00fbb2a7cd2d85d67774b2bda11641e8586b7.tar.bz2 connman-e8a00fbb2a7cd2d85d67774b2bda11641e8586b7.zip |
Add plugin skeleton for HUAWEI devices
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Makefile.am | 6 | ||||
-rw-r--r-- | plugins/huawei.c | 83 |
2 files changed, 89 insertions, 0 deletions
diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 4d8815b6..a7db8732 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -23,6 +23,12 @@ endif bluetooth_la_SOURCES = bluetooth.c inet.h inet.c bluetooth_la_LIBADD = @GDBUS_LIBS@ +if HUAWEI +plugin_LTLIBRARIES += huawei.la + +huawei_la_SOURCES = huawei.c modem.h modem. +endif + if HSO plugin_LTLIBRARIES += hso.la diff --git a/plugins/huawei.c b/plugins/huawei.c new file mode 100644 index 00000000..d0dbe494 --- /dev/null +++ b/plugins/huawei.c @@ -0,0 +1,83 @@ +/* + * + * Connection Manager + * + * Copyright (C) 2007-2009 Intel Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#define CONNMAN_API_SUBJECT_TO_CHANGE +#include <connman/plugin.h> +#include <connman/device.h> +#include <connman/log.h> + +#include "modem.h" + +static int huawei_probe(struct connman_device *device) +{ + DBG("device %p", device); + + return 0; +} + +static void huawei_remove(struct connman_device *device) +{ + DBG("device %p", device); +} + +static int huawei_enable(struct connman_device *device) +{ + DBG("device %p", device); + + connman_device_set_powered(device, TRUE); + + return 0; +} + +static int huawei_disable(struct connman_device *device) +{ + DBG("device %p", device); + + connman_device_set_powered(device, FALSE); + + return 0; +} + +static struct connman_device_driver huawei_driver = { + .name = "huawei-device", + .type = CONNMAN_DEVICE_TYPE_HUAWEI, + .probe = huawei_probe, + .remove = huawei_remove, + .enable = huawei_enable, + .disable = huawei_disable, +}; + +static int huawei_init(void) +{ + return connman_device_driver_register(&huawei_driver); +} + +static void huawei_exit(void) +{ + connman_device_driver_unregister(&huawei_driver); +} + +CONNMAN_PLUGIN_DEFINE(huawei, "Option HUAWEI device plugin", VERSION, + huawei_init, huawei_exit) |