[PATCH 02/21] hog: Add checking for 'EnableGatt'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Claudio Takahasi <claudio.takahasi@xxxxxxxxxxxxx>

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 2aac3db..722bc49 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();
 }
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux