summaryrefslogtreecommitdiffstats
path: root/input/device.c
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-03-01 14:10:10 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-03-01 14:10:10 +0000
commit3f27f7f7a01ad43532b65504e6204194e3e259df (patch)
treea7e252bc8a60a4bb7440d3c6122e938abbb6fc35 /input/device.c
parent553db8d4150c59628105bf8df4ddb68311b2fb58 (diff)
Input: Use stored device name instead of the service name attribute
Diffstat (limited to 'input/device.c')
-rw-r--r--input/device.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/input/device.c b/input/device.c
index 6e701862..2d05d264 100644
--- a/input/device.c
+++ b/input/device.c
@@ -85,8 +85,9 @@ struct pending_connect {
};
struct input_device {
- bdaddr_t src;
- bdaddr_t dst;
+ bdaddr_t src;
+ bdaddr_t dst;
+ char *name;
uint8_t major;
uint8_t minor;
struct hidp_connadd_req hidp; /* FIXME: Use dynamic alloc? */
@@ -121,6 +122,11 @@ static struct input_device *input_device_new(bdaddr_t *src, bdaddr_t *dst, uint3
idev->major = (cls >> 8) & 0x1f;
idev->minor = (cls >> 2) & 0x3f;
+ read_device_name(src, dst, &idev->name);
+
+ /* FIXME: hidp could be alloc dynamically */
+ snprintf(idev->hidp.name, 128, "%s", idev->name);
+
return idev;
}
@@ -139,6 +145,8 @@ static void input_device_free(struct input_device *idev)
{
if (!idev)
return;
+ if (idev->name)
+ g_free(idev->name);
if (idev->hidp.rd_data)
g_free(idev->hidp.rd_data);
if (idev->fake)
@@ -594,7 +602,7 @@ static gboolean rfcomm_connect_cb(GIOChannel *chan, GIOCondition cond,
* first to report volume gain key events
*/
- fake->uinput = uinput_create("Fake input");
+ fake->uinput = uinput_create(idev->name);
if (fake->uinput < 0) {
err = errno;
goto failed;