summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-06-12 16:45:42 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2008-06-12 16:45:42 +0000
commit6a19f799deaf0c4b30f6c3eb381d3a54576aba43 (patch)
tree7f6540eb7e71a915d1d230713bae92977d58459f
parent78e0c55c8a6d7adffd537d12318e8c1ed333e6c7 (diff)
Store IO capabilities of remote device in device object
-rw-r--r--hcid/dbus-hci.c18
-rw-r--r--hcid/device.h4
2 files changed, 22 insertions, 0 deletions
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,