Add a configuration option UHIDDestroy to control whether HoG uHID devices persist or are destroyed on disconnect. --- profiles/input/manager.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/profiles/input/manager.c b/profiles/input/manager.c index 1d31b06..b36e77e 100644 --- a/profiles/input/manager.c +++ b/profiles/input/manager.c @@ -43,6 +43,8 @@ #include "device.h" #include "server.h" +#include "profiles/input/hog-lib.h" + static int hid_server_probe(struct btd_profile *p, struct btd_adapter *adapter) { return server_start(btd_adapter_get_address(adapter)); @@ -96,7 +98,7 @@ static int input_init(void) config = load_config_file(CONFIGDIR "/input.conf"); if (config) { int idle_timeout; - gboolean uhid_enabled; + gboolean uhid_enabled, uhid_destroy; idle_timeout = g_key_file_get_integer(config, "General", "IdleTimeout", &err); @@ -114,6 +116,15 @@ static int input_init(void) input_enable_userspace_hid(uhid_enabled); } else g_clear_error(&err); + + uhid_destroy = g_key_file_get_boolean(config, "General", + "UHIDDestroy", &err); + if (!err) { + DBG("input.conf: UHIDDestroy=%s", uhid_destroy ? + "true" : "false"); + bt_hog_set_uhid_destroy(uhid_destroy); + } else + g_clear_error(&err); } btd_profile_register(&input_profile); -- 2.7.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