Add skeleton for Bluetooth plugin
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 13 Apr 2008 22:23:00 +0000 (00:23 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 13 Apr 2008 22:23:00 +0000 (00:23 +0200)
plugins/Makefile.am
plugins/bluetooth.c [new file with mode: 0644]

index 3ecb1ae..b34d79d 100644 (file)
@@ -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 (file)
index 0000000..7c75529
--- /dev/null
@@ -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 <config.h>
+#endif
+
+#include <connman/plugin.h>
+#include <connman/iface.h>
+#include <connman/log.h>
+
+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)