aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2012-05-15 13:54:51 -0300
committerJoão Paulo Rechi Vita <jprvita@openbossa.org>2012-06-19 14:47:04 -0300
commit83c72a8b4e0f45c196a8790d918e8698b7bcdfa0 (patch)
treebb3d78c2e5421300f941cefee7eb33e12ffb47dc
parent39abd87d541ed840443f8848b05cd8125be756b8 (diff)
downloadbluez-83c72a8b4e0f45c196a8790d918e8698b7bcdfa0.tar.gz
bluez-83c72a8b4e0f45c196a8790d918e8698b7bcdfa0.tar.xz
bluez-83c72a8b4e0f45c196a8790d918e8698b7bcdfa0.zip
hog: Add checking for 'EnableGatt'
This patch adds the verification for 'EnableGatt' config option on HoG plugin. HoG should not be enabled if EnableGatt is disabled.
-rw-r--r--input/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/input/main.c b/input/main.c
index 2aac3dbe..722bc490 100644
--- a/input/main.c
+++ b/input/main.c
@@ -32,6 +32,7 @@
#include <gdbus.h>
#include "plugin.h"
+#include "hcid.h"
#include "log.h"
#include "manager.h"
@@ -87,11 +88,19 @@ BLUETOOTH_PLUGIN_DEFINE(input, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT,
static int hog_init(void)
{
+ if (!main_opts.gatt_enabled) {
+ DBG("GATT is disabled");
+ return -ENOTSUP;
+ }
+
return hog_manager_init();
}
static void hog_exit(void)
{
+ if (!main_opts.gatt_enabled)
+ return;
+
hog_manager_exit();
}