* [PATCH BlueZ 1/2] Add GATT Time Server skeleton plugin
2011-09-21 12:46 [PATCH BlueZ 0/2] Skeleton code for TIP and PASP GATT profiles (server role) Anderson Lizardo
@ 2011-09-21 12:46 ` Anderson Lizardo
2011-09-21 12:46 ` [PATCH BlueZ 2/2] Add Phone Alert " Anderson Lizardo
2011-09-27 9:20 ` [PATCH BlueZ 0/2] Skeleton code for TIP and PASP GATT profiles (server role) Johan Hedberg
2 siblings, 0 replies; 4+ messages in thread
From: Anderson Lizardo @ 2011-09-21 12:46 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Anderson Lizardo
---
Makefile.am | 6 +++++
acinclude.m4 | 6 +++++
bootstrap-configure | 1 +
time/main.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++
time/server.c | 38 ++++++++++++++++++++++++++++++++++
time/server.h | 26 +++++++++++++++++++++++
6 files changed, 134 insertions(+), 0 deletions(-)
create mode 100644 time/main.c
create mode 100644 time/server.c
create mode 100644 time/server.h
diff --git a/Makefile.am b/Makefile.am
index d51907a..05ed562 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -222,6 +222,12 @@ builtin_modules += gatt_example
builtin_sources += plugins/gatt-example.c
endif
+if TIMEPLUGIN
+builtin_modules += time
+builtin_sources += time/main.c \
+ time/server.h time/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 3cb9459..115cd90 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -194,6 +194,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
network_enable=yes
sap_enable=no
proximity_enable=no
+ time_enable=no
service_enable=yes
health_enable=no
pnat_enable=no
@@ -246,6 +247,10 @@ AC_DEFUN([AC_ARG_BLUEZ], [
proximity_enable=${enableval}
])
+ AC_ARG_ENABLE(time, AC_HELP_STRING([--enable-time], [enable Time Profile plugin]), [
+ time_enable=${enableval}
+ ])
+
AC_ARG_ENABLE(serial, AC_HELP_STRING([--disable-serial], [disable serial plugin]), [
serial_enable=${enableval}
])
@@ -397,6 +402,7 @@ AC_DEFUN([AC_ARG_BLUEZ], [
AM_CONDITIONAL(NETWORKPLUGIN, test "${network_enable}" = "yes")
AM_CONDITIONAL(SAPPLUGIN, test "${sap_enable}" = "yes")
AM_CONDITIONAL(PROXIMITYPLUGIN, test "${proximity_enable}" = "yes")
+ AM_CONDITIONAL(TIMEPLUGIN, test "${time_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/bootstrap-configure b/bootstrap-configure
index ec5d821..65e266f 100755
--- a/bootstrap-configure
+++ b/bootstrap-configure
@@ -19,6 +19,7 @@ fi
--enable-capng \
--enable-gatt-example \
--enable-proximity \
+ --enable-time \
--enable-health \
--enable-tracer \
--enable-tools \
diff --git a/time/main.c b/time/main.c
new file mode 100644
index 0000000..a4de0fe
--- /dev/null
+++ b/time/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 time_init(void)
+{
+ if (!main_opts.attrib_server) {
+ DBG("Attribute server is disabled");
+ return -1;
+ }
+
+ return time_server_init();
+}
+
+static void time_exit(void)
+{
+ if (!main_opts.attrib_server)
+ return;
+
+ time_server_exit();
+}
+
+BLUETOOTH_PLUGIN_DEFINE(time, VERSION,
+ BLUETOOTH_PLUGIN_PRIORITY_DEFAULT,
+ time_init, time_exit)
diff --git a/time/server.c b/time/server.c
new file mode 100644
index 0000000..89cc460
--- /dev/null
+++ b/time/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 time_server_init(void)
+{
+ return 0;
+}
+
+void time_server_exit(void)
+{
+}
diff --git a/time/server.h b/time/server.h
new file mode 100644
index 0000000..621bf2b
--- /dev/null
+++ b/time/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 time_server_init(void);
+void time_server_exit(void);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH BlueZ 2/2] Add Phone Alert Server skeleton plugin
2011-09-21 12:46 [PATCH BlueZ 0/2] Skeleton code for TIP and PASP GATT profiles (server role) Anderson Lizardo
2011-09-21 12:46 ` [PATCH BlueZ 1/2] Add GATT Time Server skeleton plugin Anderson Lizardo
@ 2011-09-21 12:46 ` Anderson Lizardo
2011-09-27 9:20 ` [PATCH BlueZ 0/2] Skeleton code for TIP and PASP GATT profiles (server role) Johan Hedberg
2 siblings, 0 replies; 4+ messages in thread
From: Anderson Lizardo @ 2011-09-21 12:46 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Bruna Moreira
From: Bruna Moreira <bruna.moreira@openbossa.org>
---
Makefile.am | 6 +++++
acinclude.m4 | 6 +++++
alert/main.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++
alert/server.c | 38 ++++++++++++++++++++++++++++++++++
alert/server.h | 26 +++++++++++++++++++++++
bootstrap-configure | 1 +
6 files changed, 134 insertions(+), 0 deletions(-)
create mode 100644 alert/main.c
create mode 100644 alert/server.c
create mode 100644 alert/server.h
diff --git a/Makefile.am b/Makefile.am
index 05ed562..a63c469 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 115cd90..2097d77 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 0000000..25100e9
--- /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 0000000..d91b156
--- /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 0000000..e59bdb1
--- /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 65e266f..94da969 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 \
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH BlueZ 0/2] Skeleton code for TIP and PASP GATT profiles (server role)
2011-09-21 12:46 [PATCH BlueZ 0/2] Skeleton code for TIP and PASP GATT profiles (server role) Anderson Lizardo
2011-09-21 12:46 ` [PATCH BlueZ 1/2] Add GATT Time Server skeleton plugin Anderson Lizardo
2011-09-21 12:46 ` [PATCH BlueZ 2/2] Add Phone Alert " Anderson Lizardo
@ 2011-09-27 9:20 ` Johan Hedberg
2 siblings, 0 replies; 4+ messages in thread
From: Johan Hedberg @ 2011-09-27 9:20 UTC (permalink / raw)
To: Anderson Lizardo; +Cc: linux-bluetooth
Hi Lizardo,
On Wed, Sep 21, 2011, Anderson Lizardo wrote:
> Now that the Time and Phone Alert Status profiles have finally been adopted
> (see https://www.bluetooth.org/Technical/Specifications/adopted.htm), we can
> now submit our current code for public review, and continue development on the
> open.
>
> This first series contains the skeleton for the new profiles. They are sent
> first to avoid interdependency between the next RFC series we are about to
> send. So please apply them before any other patches related to these profiles.
Both patches applied. Thanks.
Johan
^ permalink raw reply [flat|nested] 4+ messages in thread