aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2012-05-01 15:16:08 -0300
committerJoão Paulo Rechi Vita <jprvita@openbossa.org>2012-06-21 18:00:18 -0300
commit822a7d18e09cfdd9327c410b6e49accb54645298 (patch)
tree76bcde85a0dc82fe3b75a7116ff01804baa89059
parente07d0a305f2412a462ca65a9e69b5c0b203796bf (diff)
downloadbluez-822a7d18e09cfdd9327c410b6e49accb54645298.tar.gz
bluez-822a7d18e09cfdd9327c410b6e49accb54645298.tar.xz
bluez-822a7d18e09cfdd9327c410b6e49accb54645298.zip
scan: Register device driver
This patch add the probe and remove callbacks for the GATT Scan Parameters service.
-rw-r--r--Makefile.am2
-rw-r--r--scanparam/main.c4
-rw-r--r--scanparam/manager.c65
-rw-r--r--scanparam/manager.h26
4 files changed, 95 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index b66d767a..c95220eb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -240,7 +240,7 @@ builtin_sources += thermometer/main.c \
deviceinfo/main.c \
deviceinfo/manager.h deviceinfo/manager.c \
deviceinfo/deviceinfo.h deviceinfo/deviceinfo.c \
- scanparam/main.c
+ scanparam/main.c scanparam/manager.h scanparam/manager.c
endif
diff --git a/scanparam/main.c b/scanparam/main.c
index e7771103..de50ca76 100644
--- a/scanparam/main.c
+++ b/scanparam/main.c
@@ -33,6 +33,7 @@
#include "log.h"
#include "plugin.h"
#include "hcid.h"
+#include "manager.h"
static int scan_param_init(void)
{
@@ -41,11 +42,12 @@ static int scan_param_init(void)
return -ENOTSUP;
}
- return 0;
+ return scan_param_manager_init();
}
static void scan_param_exit(void)
{
+ scan_param_manager_exit();
}
BLUETOOTH_PLUGIN_DEFINE(scanparam, VERSION,
diff --git a/scanparam/manager.c b/scanparam/manager.c
new file mode 100644
index 00000000..009cb5d3
--- /dev/null
+++ b/scanparam/manager.c
@@ -0,0 +1,65 @@
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2012 Instituto Nokia de Tecnologia - INdT
+ * Copyright (C) 2012 Marcel Holtmann <marcel@holtmann.org>
+ *
+ *
+ * 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
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <glib.h>
+
+#include "log.h"
+#include "adapter.h"
+#include "device.h"
+#include "manager.h"
+
+#define SCAN_PARAMETERS_UUID "00001813-0000-1000-8000-00805f9b34fb"
+
+static int scan_param_probe(struct btd_device *device, GSList *uuids)
+{
+ DBG("Probing Scan Parameters");
+
+ return 0;
+}
+
+static void scan_param_remove(struct btd_device *device)
+{
+}
+
+static struct btd_device_driver scan_driver = {
+ .name = "Scan Parameters Client Driver",
+ .uuids = BTD_UUIDS(SCAN_PARAMETERS_UUID),
+ .probe = scan_param_probe,
+ .remove = scan_param_remove,
+};
+
+int scan_param_manager_init(void)
+{
+ return btd_register_device_driver(&scan_driver);
+
+}
+
+void scan_param_manager_exit(void)
+{
+ btd_unregister_device_driver(&scan_driver);
+}
diff --git a/scanparam/manager.h b/scanparam/manager.h
new file mode 100644
index 00000000..0a72d6ae
--- /dev/null
+++ b/scanparam/manager.h
@@ -0,0 +1,26 @@
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2012 Instituto Nokia de Tecnologia - INdT
+ * Copyright (C) 2012 Marcel Holtmann <marcel@holtmann.org>
+ *
+ *
+ * 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 scan_param_manager_init(void);
+void scan_param_manager_exit(void);