aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2012-05-01 06:42:29 -0300
committerJoão Paulo Rechi Vita <jprvita@openbossa.org>2012-06-21 18:00:18 -0300
commite07d0a305f2412a462ca65a9e69b5c0b203796bf (patch)
treefb4d6585dd62ad689897ca3b07828ee375f49238
parent4b3f92fba4d4deb14b21003895aeb15a78bf2d6f (diff)
downloadbluez-e07d0a305f2412a462ca65a9e69b5c0b203796bf.tar.gz
bluez-e07d0a305f2412a462ca65a9e69b5c0b203796bf.tar.xz
bluez-e07d0a305f2412a462ca65a9e69b5c0b203796bf.zip
scan: Add plugin skeleton
This patch adds the Makefile changes and plugin declaration to support Scan Parameters service. BlueZ will act as Scan Client writting to a Scan Server the scanning parameters.
-rw-r--r--Makefile.am5
-rw-r--r--scanparam/main.c53
2 files changed, 56 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index 2fb5a2a3..b66d767a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -225,7 +225,7 @@ endif
if GATTMODULES
builtin_modules += thermometer alert time gatt_example proximity \
- deviceinfo
+ deviceinfo scanparam
builtin_sources += thermometer/main.c \
thermometer/manager.h thermometer/manager.c \
thermometer/thermometer.h thermometer/thermometer.c \
@@ -239,7 +239,8 @@ builtin_sources += thermometer/main.c \
proximity/immalert.h proximity/immalert.c \
deviceinfo/main.c \
deviceinfo/manager.h deviceinfo/manager.c \
- deviceinfo/deviceinfo.h deviceinfo/deviceinfo.c
+ deviceinfo/deviceinfo.h deviceinfo/deviceinfo.c \
+ scanparam/main.c
endif
diff --git a/scanparam/main.c b/scanparam/main.c
new file mode 100644
index 00000000..e7771103
--- /dev/null
+++ b/scanparam/main.c
@@ -0,0 +1,53 @@
+/*
+ *
+ * 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 <errno.h>
+#include <stdint.h>
+#include <glib.h>
+
+#include "log.h"
+#include "plugin.h"
+#include "hcid.h"
+
+static int scan_param_init(void)
+{
+ if (!main_opts.gatt_enabled) {
+ DBG("GATT is disabled");
+ return -ENOTSUP;
+ }
+
+ return 0;
+}
+
+static void scan_param_exit(void)
+{
+}
+
+BLUETOOTH_PLUGIN_DEFINE(scanparam, VERSION,
+ BLUETOOTH_PLUGIN_PRIORITY_DEFAULT,
+ scan_param_init, scan_param_exit)