diff options
author | Bruna Moreira <bruna.moreira@openbossa.org> | 2011-09-21 08:46:10 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2011-09-22 20:05:06 +0900 |
commit | d7925ed6c4bdca24140abe49a114dda0061d134e (patch) | |
tree | 067152f5d90ffb5de7e52695a8e08d4c4abc4b79 | |
parent | 8f769e9565430580a641302eefbcc20f6aa1b175 (diff) | |
download | bluez-d7925ed6c4bdca24140abe49a114dda0061d134e.tar.gz |
Add Phone Alert Server skeleton plugin
-rw-r--r-- | Makefile.am | 6 | ||||
-rw-r--r-- | acinclude.m4 | 6 | ||||
-rw-r--r-- | alert/main.c | 57 | ||||
-rw-r--r-- | alert/server.c | 38 | ||||
-rw-r--r-- | alert/server.h | 26 | ||||
-rwxr-xr-x | bootstrap-configure | 1 |
6 files changed, 134 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index 05ed56210..a63c469c5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -228,6 +228,12 @@ builtin_sources += time/main.c \ time/server.h time/server.c endif +if ALERTPLUGIN +builtin_modules += alert +builtin_sources += alert/main.c \ + alert/server.h alert/server.c +endif + if HEALTHPLUGIN builtin_modules += health builtin_sources += health/hdp_main.c health/hdp_types.h \ diff --git a/acinclude.m4 b/acinclude.m4 index 115cd903f..2097d7707 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -195,6 +195,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [ sap_enable=no proximity_enable=no time_enable=no + alert_enable=no service_enable=yes health_enable=no pnat_enable=no @@ -251,6 +252,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [ time_enable=${enableval} ]) + AC_ARG_ENABLE(alert, AC_HELP_STRING([--enable-alert], [enable Phone Alert Profile plugin]), [ + alert_enable=${enableval} + ]) + AC_ARG_ENABLE(serial, AC_HELP_STRING([--disable-serial], [disable serial plugin]), [ serial_enable=${enableval} ]) @@ -403,6 +408,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [ AM_CONDITIONAL(SAPPLUGIN, test "${sap_enable}" = "yes") AM_CONDITIONAL(PROXIMITYPLUGIN, test "${proximity_enable}" = "yes") AM_CONDITIONAL(TIMEPLUGIN, test "${time_enable}" = "yes") + AM_CONDITIONAL(ALERTPLUGIN, test "${alert_enable}" = "yes") AM_CONDITIONAL(SERVICEPLUGIN, test "${service_enable}" = "yes") AM_CONDITIONAL(HEALTHPLUGIN, test "${health_enable}" = "yes") AM_CONDITIONAL(MCAP, test "${health_enable}" = "yes") diff --git a/alert/main.c b/alert/main.c new file mode 100644 index 000000000..25100e991 --- /dev/null +++ b/alert/main.c @@ -0,0 +1,57 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2011 Nokia Corporation + * Copyright (C) 2011 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 <stdint.h> +#include <glib.h> + +#include "plugin.h" +#include "hcid.h" +#include "log.h" +#include "server.h" + +static int alert_init(void) +{ + if (!main_opts.attrib_server) { + DBG("Attribute server is disabled"); + return -1; + } + + return alert_server_init(); +} + +static void alert_exit(void) +{ + if (!main_opts.attrib_server) + return; + + alert_server_exit(); +} + +BLUETOOTH_PLUGIN_DEFINE(alert, VERSION, + BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, + alert_init, alert_exit) diff --git a/alert/server.c b/alert/server.c new file mode 100644 index 000000000..d91b15639 --- /dev/null +++ b/alert/server.c @@ -0,0 +1,38 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2011 Nokia Corporation + * Copyright (C) 2011 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 "server.h" + +int alert_server_init(void) +{ + return 0; +} + +void alert_server_exit(void) +{ +} diff --git a/alert/server.h b/alert/server.h new file mode 100644 index 000000000..e59bdb174 --- /dev/null +++ b/alert/server.h @@ -0,0 +1,26 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2011 Nokia Corporation + * Copyright (C) 2011 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 alert_server_init(void); +void alert_server_exit(void); diff --git a/bootstrap-configure b/bootstrap-configure index 65e266ff7..94da96916 100755 --- a/bootstrap-configure +++ b/bootstrap-configure @@ -20,6 +20,7 @@ fi --enable-gatt-example \ --enable-proximity \ --enable-time \ + --enable-alert \ --enable-health \ --enable-tracer \ --enable-tools \ |