summaryrefslogtreecommitdiffstats
path: root/input/device.c
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-06-22 19:14:38 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-06-22 19:14:38 +0000
commit7fb02908be38aaa273643ac6b78c5d72e40ae545 (patch)
tree8f103fe3a56f07d682fc27909efaace24a8533a9 /input/device.c
parenta47211b0097fe3612b96246f08bf37dccd15fd61 (diff)
input: fixed CreateDevice - verify the src and the dst address to discover if the device already exists
Diffstat (limited to 'input/device.c')
-rw-r--r--input/device.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/input/device.c b/input/device.c
index 69b7a482..d9dfbec4 100644
--- a/input/device.c
+++ b/input/device.c
@@ -1140,24 +1140,6 @@ int input_device_unregister(DBusConnection *conn, const char *path)
return 0;
}
-int input_device_get_bdaddr(DBusConnection *conn, const char *path,
- bdaddr_t *src, bdaddr_t *dst)
-{
- struct device *idev;
-
- if (!dbus_connection_get_object_user_data(conn, path,
- (void *) &idev))
- return -1;
-
- if (!idev)
- return -1;
-
- bacpy(src, &idev->src);
- bacpy(dst, &idev->dst);
-
- return 0;
-}
-
int l2cap_connect(bdaddr_t *src, bdaddr_t *dst, unsigned short psm,
GIOFunc cb, void *data)
{
@@ -1236,6 +1218,15 @@ static struct device *find_device(bdaddr_t *src, bdaddr_t *dst)
return NULL;
}
+gboolean input_device_is_registered(bdaddr_t *src, bdaddr_t *dst)
+{
+ struct device *idev = find_device(src, dst);
+ if (!idev)
+ return FALSE;
+ else
+ return TRUE;
+}
+
int input_device_set_channel(bdaddr_t *src, bdaddr_t *dst, int psm, int nsk)
{
struct device *idev = find_device(src, dst);