summaryrefslogtreecommitdiff
path: root/plugins/bluetooth.c
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2013-01-28 17:44:35 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-01-30 10:27:50 +0200
commite7d00125079494dd3d170d7275a2883a2d82e292 (patch)
treefb7556937e52b7ba7c4d5831d3df0e872d5966a2 /plugins/bluetooth.c
parentcd0d951025cec18bdec82d7c0847668cc6a151d2 (diff)
downloadconnman-e7d00125079494dd3d170d7275a2883a2d82e292.tar.gz
bluetooth: Add new bluetooth plugin
Diffstat (limited to 'plugins/bluetooth.c')
-rw-r--r--plugins/bluetooth.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c
new file mode 100644
index 00000000..1b5aed01
--- /dev/null
+++ b/plugins/bluetooth.c
@@ -0,0 +1,49 @@
+/*
+ *
+ * Connection Manager
+ *
+ * Copyright (C) 2013 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 <errno.h>
+
+#define CONNMAN_API_SUBJECT_TO_CHANGE
+#include <connman/plugin.h>
+#include <connman/dbus.h>
+
+static DBusConnection *connection;
+
+static int bluetooth_init(void)
+{
+ connection = connman_dbus_get_connection();
+ if (connection == NULL)
+ return -EIO;
+
+ return 0;
+}
+
+static void bluetooth_exit(void)
+{
+ dbus_connection_unref(connection);
+}
+
+CONNMAN_PLUGIN_DEFINE(bluetooth, "Bluetooth technology plugin", VERSION,
+ CONNMAN_PLUGIN_PRIORITY_DEFAULT, bluetooth_init, bluetooth_exit)