3 * BlueZ - Bluetooth protocol stack for Linux
5 * Copyright (C) 2011 GSyC/LibreSoft, Universidad Rey Juan Carlos.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
37 static DBusConnection *connection = NULL;
39 static int thermometer_init(void)
41 if (!main_opts.gatt_enabled) {
42 DBG("GATT is disabled");
46 connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
47 if (connection == NULL)
50 if (thermometer_manager_init(connection) < 0) {
51 dbus_connection_unref(connection);
58 static void thermometer_exit(void)
60 if (!main_opts.gatt_enabled)
63 thermometer_manager_exit();
65 dbus_connection_unref(connection);
69 BLUETOOTH_PLUGIN_DEFINE(thermometer, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT,
70 thermometer_init, thermometer_exit)