From 02effe89f55356121187771e2595f212aa43d4ab Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Tue, 3 Jul 2012 15:42:54 -0300 Subject: [PATCH] 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. --- input/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/input/main.c b/input/main.c index 2aac3dbef..722bc490a 100644 --- a/input/main.c +++ b/input/main.c @@ -32,6 +32,7 @@ #include #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(); } -- 2.47.3