public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Gollub <dgollub@suse.de>
To: "BlueZ development" <bluez-devel@lists.sourceforge.net>
Cc: Stefan Seyfried <seife@suse.de>
Subject: [Bluez-devel] [PATCH] Input Service - Support for hidd configuration
Date: Fri, 8 Jun 2007 23:35:59 +0200	[thread overview]
Message-ID: <200706082336.00557.dgollub@suse.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 723 bytes --]

Hi,

attachted an input service patch which implements support for the hidd 
configuration. This is needed to have a smooth transition from hidd daemon to 
the new shiny input service ...

( ... and especially this is needed to be able to return from vacation back to 
the office - without getting blamed by Seife for not working bluetooth input 
devices ;P )

The patch reads the entries of hidd and stores it with store_device_info() 
function. The hidd doesn't get modified - this means the transition happens 
on every start of the input service. store_device_info() avoids duplicate 
entries. So there is still the possibility to have a working bluetooth input 
device when falling back to hidd.

best regards,
Daniel

[-- Attachment #2: bluez-utils-input-service-hidd-config.diff --]
[-- Type: text/x-diff, Size: 1227 bytes --]

--- input/manager.c	9 May 2007 14:53:34 -0000	1.25
+++ input/manager.c	8 Jun 2007 21:16:25 -0000
@@ -959,6 +959,23 @@ static void stored_input(char *key, char
 	device_paths = g_slist_append(device_paths, g_strdup(path));
 }
 
+/* hidd to input transition function */
+static void stored_hidd(char *key, char *value, void *data)
+{
+	const char *path;
+	struct hidp_connadd_req hidp; 
+	bdaddr_t dst, *src = data;
+
+	str2ba(key, &dst);
+
+	memset(&hidp, 0, sizeof(struct hidp_connadd_req));
+
+	if (parse_stored_device_info(value, &hidp) < 0)
+		return;
+
+	store_device_info(src, &dst, &hidp);
+}
+
 static void register_stored_inputs(void)
 {
 	char dirname[PATH_MAX + 1];
@@ -977,10 +994,16 @@ static void register_stored_inputs(void)
 		if (!isdigit(de->d_name[0]))
 			continue;
 
+		str2ba(de->d_name, &src);
+
+		/* move the hidd entries to the input storage */
 		create_name(filename, PATH_MAX, STORAGEDIR,
-						de->d_name, "input");
+						de->d_name, "hidd");
+		textfile_foreach(filename, stored_hidd, &src);
 
-		str2ba(de->d_name, &src);
+		/* load the input stored devices */
+		create_name(filename, PATH_MAX, STORAGEDIR,
+						de->d_name, "input");
 
 		textfile_foreach(filename, stored_input, &src);
 	}

[-- Attachment #3: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

             reply	other threads:[~2007-06-08 21:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-08 21:35 Daniel Gollub [this message]
2007-06-09  2:53 ` [Bluez-devel] [PATCH] Input Service - Support for hidd configuration Mo.Shahin
2007-06-16  7:50 ` Marcel Holtmann
2007-06-22 15:41 ` Daniel Gollub

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200706082336.00557.dgollub@suse.de \
    --to=dgollub@suse.de \
    --cc=bluez-devel@lists.sourceforge.net \
    --cc=seife@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox