From e7d00125079494dd3d170d7275a2883a2d82e292 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Mon, 28 Jan 2013 17:44:35 +0200 Subject: [PATCH] bluetooth: Add new bluetooth plugin --- Makefile.plugins | 2 ++ plugins/bluetooth.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 plugins/bluetooth.c diff --git a/Makefile.plugins b/Makefile.plugins index 9271cac..aabaf73 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 0000000..1b5aed0 --- /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 +#endif + +#include + +#define CONNMAN_API_SUBJECT_TO_CHANGE +#include +#include + +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) -- 2.7.4