summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-03-19 15:17:15 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-03-19 15:17:15 +0000
commitd307da66278af3505e2bb1a35de4ef2ccefb9a6d (patch)
treeba04f5771d37c51dfec34d11c1db36ddbe09ab91
parenta798bf638f53dacb92d23265a0d228886e8bd5f0 (diff)
input: moving "struct input_device" to device.h
-rw-r--r--input/device.c23
-rw-r--r--input/device.h23
-rw-r--r--input/manager.c9
3 files changed, 27 insertions, 28 deletions
diff --git a/input/device.c b/input/device.c
index 8f255fd7..7e7325fb 100644
--- a/input/device.c
+++ b/input/device.c
@@ -61,29 +61,6 @@
#define UPDOWN_ENABLED 1
-struct fake_input {
- GIOChannel *io;
- int rfcomm; /* RFCOMM socket */
- int uinput; /* uinput socket */
- uint8_t ch; /* RFCOMM channel number */
-};
-
-struct pending_connect {
- DBusConnection *conn;
- DBusMessage *msg;
-};
-
-struct input_device {
- bdaddr_t src;
- bdaddr_t dst;
- char *name;
- uint8_t major;
- uint8_t minor;
- struct hidp_connadd_req hidp; /* FIXME: Use dynamic alloc? */
- struct fake_input *fake;
- struct pending_connect *pending_connect;
-};
-
static struct input_device *input_device_new(bdaddr_t *src, bdaddr_t *dst)
{
struct input_device *idev;
diff --git a/input/device.h b/input/device.h
index b51056e2..604d7b79 100644
--- a/input/device.h
+++ b/input/device.h
@@ -21,6 +21,29 @@
*
*/
+struct fake_input {
+ GIOChannel *io;
+ int rfcomm; /* RFCOMM socket */
+ int uinput; /* uinput socket */
+ uint8_t ch; /* RFCOMM channel number */
+};
+
+struct pending_connect {
+ DBusConnection *conn;
+ DBusMessage *msg;
+};
+
+struct input_device {
+ bdaddr_t src;
+ bdaddr_t dst;
+ char *name;
+ uint8_t major;
+ uint8_t minor;
+ struct hidp_connadd_req hidp; /* FIXME: Use dynamic alloc? */
+ struct fake_input *fake;
+ struct pending_connect *pending_connect;
+};
+
int input_device_register(DBusConnection *conn, bdaddr_t *src, bdaddr_t *dst,
struct hidp_connadd_req *hidp, const char **path);
int fake_input_register(DBusConnection *conn, bdaddr_t *src,
diff --git a/input/manager.c b/input/manager.c
index 143471bc..38020a22 100644
--- a/input/manager.c
+++ b/input/manager.c
@@ -103,7 +103,6 @@ static void pending_req_free(struct pending_req *pr)
g_free(pr);
}
-#if 0
static int path_bdaddr_cmp(const char *path, const bdaddr_t *bdaddr)
{
struct input_device *idev;
@@ -117,7 +116,7 @@ static int path_bdaddr_cmp(const char *path, const bdaddr_t *bdaddr)
return bacmp(&idev->dst, bdaddr);
}
-#endif
+
static int get_record(struct pending_req *pr, uint32_t handle,
DBusPendingCallNotifyFunction cb)
{
@@ -589,6 +588,7 @@ static DBusHandlerResult manager_create_device(DBusConnection *conn,
DBusError derr;
char adapter[18], adapter_path[32];
const char *addr;
+ GSList *l;
bdaddr_t dst;
uint32_t cls = 0;
int dev_id;
@@ -603,13 +603,12 @@ static DBusHandlerResult manager_create_device(DBusConnection *conn,
}
str2ba(addr, &dst);
-#if 0
- /* FIXME */
+
l = g_slist_find_custom(mgr->paths, &dst,
(GCompareFunc) path_bdaddr_cmp);
if (l)
return err_already_exists(conn, msg, "Input Already exists");
-#endif
+
/* FIXME: Move the following code to pending_req_new() */
ba2str(&mgr->src, adapter);
dev_id = hci_devid(adapter);