From 882010ac603c63cbbe36fff9d6e6fd38d0001009 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 14 Apr 2008 00:23:00 +0200 Subject: [PATCH] Add skeleton for Bluetooth plugin --- plugins/Makefile.am | 3 +++ plugins/bluetooth.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 plugins/bluetooth.c diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 3ecb1ae..b34d79d 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -2,12 +2,15 @@ plugindir = $(libdir)/connman/plugins plugin_LTLIBRARIES = libconnman-80203.la libconnman-80211.la \ + libconnman-bluetooth.la \ libconnman-dhclient.la libconnman-resolvconf.la libconnman_80203_la_SOURCES = 80203.c libconnman_80211_la_SOURCES = 80211.c supplicant.h supplicant.c +libconnman_bluetooth_la_SOURCES = bluetooth.c + libconnman_dhclient_la_SOURCES = dhclient.c libconnman_dhclient_la_LIBADD = @GDBUS_LIBS@ libconnman_dhclient_la_CFLAGS = @GDBUS_CFLAGS@ -DDHCLIENT=\"@DHCLIENT@\" \ diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c new file mode 100644 index 0000000..7c75529 --- /dev/null +++ b/plugins/bluetooth.c @@ -0,0 +1,65 @@ +/* + * + * Connection Manager + * + * Copyright (C) 2007-2008 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 +#endif + +#include +#include +#include + +static int bluetooth_probe(struct connman_iface *iface) +{ + DBG("iface %p", iface); + + iface->type = CONNMAN_IFACE_TYPE_BLUETOOTH; + + iface->flags = CONNMAN_IFACE_FLAG_RTNL | + CONNMAN_IFACE_FLAG_IPV4; + + return 0; +} + +static void bluetooth_remove(struct connman_iface *iface) +{ + DBG("iface %p", iface); +} + +static struct connman_iface_driver bluetooth_driver = { + .name = "bluetooth", + .capability = "bluetooth_hci", + .probe = bluetooth_probe, + .remove = bluetooth_remove, +}; + +static int bluetooth_init(void) +{ + return connman_iface_register(&bluetooth_driver); +} + +static void bluetooth_exit(void) +{ + connman_iface_unregister(&bluetooth_driver); +} + +CONNMAN_PLUGIN_DEFINE("bluetooth", "Bluetooth interface plugin", VERSION, + bluetooth_init, bluetooth_exit) -- 2.7.4