From 6a19f799deaf0c4b30f6c3eb381d3a54576aba43 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 12 Jun 2008 16:45:42 +0000 Subject: Store IO capabilities of remote device in device object --- hcid/dbus-hci.c | 18 ++++++++++++++++++ hcid/device.h | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c index e770e70d..8700f4d1 100644 --- a/hcid/dbus-hci.c +++ b/hcid/dbus-hci.c @@ -2473,6 +2473,24 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote, int hcid_dbus_set_io_cap(bdaddr_t *local, bdaddr_t *remote, uint8_t cap, uint8_t auth) { + struct adapter *adapter; + struct device *device; + char addr[18]; + + adapter = manager_find_adapter(local); + if (!adapter) { + error("No matching adapter found"); + return -1; + } + + ba2str(remote, addr); + + device = adapter_get_device(connection, adapter, addr); + if (device) { + device->cap = cap; + device->auth = auth; + } + return 0; } diff --git a/hcid/device.h b/hcid/device.h index 985a7b46..b476b1da 100644 --- a/hcid/device.h +++ b/hcid/device.h @@ -40,6 +40,10 @@ struct device { gboolean temporary; struct agent *agent; guint disconn_timer; + + /* For Secure Simple Pairing */ + uint8_t cap; + uint8_t auth; }; struct device *device_create(DBusConnection *conn, struct adapter *adapter, -- cgit