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
27
#include "thermometer.h"
30
#define HEALTH_THERMOMETER_UUID "00001809-0000-1000-8000-00805f9b34fb"
32
static DBusConnection *connection = NULL;
34
static int thermometer_driver_probe(struct btd_device *device, GSList *uuids)
36
return thermometer_register(connection, device);
39
static void thermometer_driver_remove(struct btd_device *device)
41
thermometer_unregister(device);
44
static struct btd_device_driver thermometer_device_driver = {
45
.name = "thermometer-device-driver",
46
.uuids = BTD_UUIDS(HEALTH_THERMOMETER_UUID),
47
.probe = thermometer_driver_probe,
48
.remove = thermometer_driver_remove
51
int thermometer_manager_init(DBusConnection *conn)
55
ret = btd_register_device_driver(&thermometer_device_driver);
59
connection = dbus_connection_ref(conn);
63
void thermometer_manager_exit(void)
65
btd_unregister_device_driver(&thermometer_device_driver);
67
dbus_connection_unref(connection);