summaryrefslogtreecommitdiffstats
path: root/hidd/fakehid.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-12-09 12:05:13 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-12-09 12:05:13 +0000
commit9f80ae2025e4d14059ac313b678e7457e5c506aa (patch)
tree5d3e97039886a3e694f10799e96078e63f07da78 /hidd/fakehid.c
parentd7cde36719252eaab14fad2d2c094bb6e7003059 (diff)
Support different device names
Diffstat (limited to 'hidd/fakehid.c')
-rw-r--r--hidd/fakehid.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/hidd/fakehid.c b/hidd/fakehid.c
index b9fbc200..61f33ce8 100644
--- a/hidd/fakehid.c
+++ b/hidd/fakehid.c
@@ -161,7 +161,7 @@ static void epox_decode(int fd, unsigned char event)
}
}
-static int uinput_create(int keyboard, int mouse)
+static int uinput_create(char *name, int keyboard, int mouse)
{
struct uinput_dev dev;
int fd, aux;
@@ -180,9 +180,12 @@ static int uinput_create(int keyboard, int mouse)
}
memset(&dev, 0, sizeof(dev));
- strncpy(dev.name, "Bluetooth FakeHID", UINPUT_MAX_NAME_SIZE);
+
+ if (name)
+ strncpy(dev.name, name, UINPUT_MAX_NAME_SIZE);
+
dev.id.bustype = BUS_BLUETOOTH;
- dev.id.vendor = 0x0000;
+ dev.id.vendor = 0x0000;
dev.id.product = 0x0000;
dev.id.version = 0x0000;
@@ -285,7 +288,7 @@ void epox_presenter(const bdaddr_t *src, const bdaddr_t *dst, uint8_t channel)
if (sk < 0)
return;
- fd = uinput_create(1, 1);
+ fd = uinput_create("Bluetooth Presenter", 0, 1);
if (fd < 0) {
close(sk);
return;