summaryrefslogtreecommitdiff
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
parentcd0d951025cec18bdec82d7c0847668cc6a151d2 (diff)
downloadconnman-e7d00125079494dd3d170d7275a2883a2d82e292.tar.gz
connman-e7d00125079494dd3d170d7275a2883a2d82e292.tar.bz2
connman-e7d00125079494dd3d170d7275a2883a2d82e292.zip
bluetooth: Add new bluetooth plugin
-rw-r--r--Makefile.plugins2
-rw-r--r--plugins/bluetooth.c49
2 files changed, 51 insertions, 0 deletions
diff --git a/Makefile.plugins b/Makefile.plugins
index 9271cac3..aabaf73c 100644
--- a/Makefile.plugins
+++ b/Makefile.plugins
@@ -27,6 +27,8 @@ endif
if BLUETOOTH
builtin_modules += bluetooth_legacy
builtin_sources += plugins/bluetooth_legacy.c
+builtin_modules += bluetooth
+builtin_sources += plugins/bluetooth.c
endif
if HH2SERIAL_GPS
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)