From 8e0f32408df6b817128d61eae264d8a5b38d7929 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 27 Aug 2008 18:12:19 +0200 Subject: Update IO capa selection process --- src/dbus-hci.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/dbus-hci.c b/src/dbus-hci.c index bc1528f8..44c56bbf 100644 --- a/src/dbus-hci.c +++ b/src/dbus-hci.c @@ -1820,6 +1820,7 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote, ba2str(remote, addr); + /* For CreatePairedDevice use dedicated bonding */ device = adapter_find_device(adapter, addr); if (device) { agent = device_get_agent(device); @@ -1830,6 +1831,7 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote, agent = adapter->agent; if (!agent) { + /* No agent available, and no bonding case */ if (device_get_auth(device) == 0x00 || device_get_auth(device) == 0x01) { /* No input, no output */ @@ -1840,6 +1842,13 @@ int hcid_dbus_get_io_cap(bdaddr_t *local, bdaddr_t *remote, return -1; } + if (device && *auth < 0x02) { + /* If remote requests dedicated bonding follow that lead */ + if (device_get_auth(device) == 0x02 || + device_get_auth(device) == 0x03) + *auth = 0x02; + } + *cap = agent_get_io_capability(agent); return 0; -- cgit