aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantiago Carot-Nemesio <sancane@gmail.com>2011-07-26 14:15:53 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2011-07-29 12:50:32 +0300
commit3e24f80260b044dea99916f151b235dd51f54282 (patch)
tree848433c8a854ebc479ac2b66a3912ad18585b174
parent67c15df485b260898f0bcb22a523c84c5e021c9d (diff)
downloadbluez-3e24f80260b044dea99916f151b235dd51f54282.tar.gz
bluez-3e24f80260b044dea99916f151b235dd51f54282.tar.xz
bluez-3e24f80260b044dea99916f151b235dd51f54282.zip
Add manager files for HTP
-rw-r--r--Makefile.am3
-rw-r--r--thermometer/main.c21
-rw-r--r--thermometer/manager.c38
-rw-r--r--thermometer/manager.h27
4 files changed, 86 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index eac9837b..ac8fdd42 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -216,7 +216,8 @@ endif
if THERMOMETERPLUGIN
builtin_modules += thermometer
-builtin_sources += thermometer/main.c
+builtin_sources += thermometer/main.c \
+ thermometer/manager.h thermometer/manager.c
endif
builtin_modules += hciops mgmtops
diff --git a/thermometer/main.c b/thermometer/main.c
index c47d396e..4a0ea341 100644
--- a/thermometer/main.c
+++ b/thermometer/main.c
@@ -27,18 +27,35 @@
#include <config.h>
#endif
+#include <glib.h>
+#include <errno.h>
+#include <gdbus.h>
+
#include "plugin.h"
+#include "manager.h"
+static DBusConnection *connection = NULL;
static int thermometer_init(void)
{
- /*TODO: */
+ connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
+ if (connection == NULL)
+ return -EIO;
+
+ if (thermometer_manager_init(connection) < 0) {
+ dbus_connection_unref(connection);
+ return -EIO;
+ }
+
return 0;
}
static void thermometer_exit(void)
{
- /*TODO: */
+ thermometer_manager_exit();
+
+ dbus_connection_unref(connection);
+ connection = NULL;
}
BLUETOOTH_PLUGIN_DEFINE(thermometer, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT,
diff --git a/thermometer/manager.c b/thermometer/manager.c
new file mode 100644
index 00000000..a243de00
--- /dev/null
+++ b/thermometer/manager.c
@@ -0,0 +1,38 @@
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2011 GSyC/LibreSoft, Universidad Rey Juan Carlos.
+ * Authors:
+ * Santiago Carot Nemesio <sancane at gmail.com>
+ * Jorge Fernandez Gonzalez <jorge.fernandez.gonzalez at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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
+ *
+ */
+
+#include <gdbus.h>
+#include "manager.h"
+
+int thermometer_manager_init(DBusConnection *conn)
+{
+ /*TODO: */
+ return 0;
+}
+
+void thermometer_manager_exit(void)
+{
+ /*TODO: */
+}
diff --git a/thermometer/manager.h b/thermometer/manager.h
new file mode 100644
index 00000000..8cf6fd0b
--- /dev/null
+++ b/thermometer/manager.h
@@ -0,0 +1,27 @@
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2011 GSyC/LibreSoft, Universidad Rey Juan Carlos.
+ * Authors:
+ * Santiago Carot Nemesio <sancane at gmail.com>
+ * Jorge Fernandez Gonzalez <jorge.fernandez.gonzalez at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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
+ *
+ */
+
+int thermometer_manager_init(DBusConnection *conn);
+void thermometer_manager_exit(void);