summaryrefslogtreecommitdiff
path: root/profiles
diff options
context:
space:
mode:
authorAnderson Lizardo <anderson.lizardo@openbossa.org>2012-10-02 16:24:25 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2012-10-03 22:21:07 +0300
commit4d629a965673b0deb6b320c5aeb3545ca11ee48e (patch)
tree4a81f592f2976af4873a6bbd8a3c5544cb1c108a /profiles
parentbbaccd71b02be5c9786999c722167b099975109c (diff)
downloadbluez-4d629a965673b0deb6b320c5aeb3545ca11ee48e.tar.gz
alert: Introduce manager abstraction layer
This abstraction layer makes the GATT Phone Alert Status and Alert Notification implementation consistent with other GATT profiles.
Diffstat (limited to 'profiles')
-rw-r--r--profiles/alert/main.c6
-rw-r--r--profiles/alert/manager.c40
-rw-r--r--profiles/alert/manager.h26
3 files changed, 69 insertions, 3 deletions
diff --git a/profiles/alert/main.c b/profiles/alert/main.c
index ec4ab6d09..5e6910ae9 100644
--- a/profiles/alert/main.c
+++ b/profiles/alert/main.c
@@ -33,7 +33,7 @@
#include "plugin.h"
#include "hcid.h"
#include "log.h"
-#include "server.h"
+#include "manager.h"
static int alert_init(void)
{
@@ -42,7 +42,7 @@ static int alert_init(void)
return -ENOTSUP;
}
- return alert_server_init();
+ return alert_manager_init();
}
static void alert_exit(void)
@@ -50,7 +50,7 @@ static void alert_exit(void)
if (!main_opts.gatt_enabled)
return;
- alert_server_exit();
+ alert_manager_exit();
}
BLUETOOTH_PLUGIN_DEFINE(alert, VERSION,
diff --git a/profiles/alert/manager.c b/profiles/alert/manager.c
new file mode 100644
index 000000000..eb2d62708
--- /dev/null
+++ b/profiles/alert/manager.c
@@ -0,0 +1,40 @@
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2012 Nokia Corporation
+ * 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 "manager.h"
+#include "server.h"
+
+int alert_manager_init(void)
+{
+ return alert_server_init();
+}
+
+void alert_manager_exit(void)
+{
+ alert_server_exit();
+}
diff --git a/profiles/alert/manager.h b/profiles/alert/manager.h
new file mode 100644
index 000000000..e4c6bd026
--- /dev/null
+++ b/profiles/alert/manager.h
@@ -0,0 +1,26 @@
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2012 Nokia Corporation
+ * 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 alert_manager_init(void);
+void alert_manager_exit(void);