aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorScott James Remnant <scott@netsplit.com>2012-04-18 15:01:01 -0700
committerJohan Hedberg <johan.hedberg@intel.com>2012-04-19 10:50:20 +0300
commited31ac59ecb6e4e15c350e44637c05d7ef58c019 (patch)
treeddc242961390580c08d9f72b699e2b3dde5cf784 /plugins
parente61df1600a09334beab122a9580161ae1fabdca5 (diff)
downloadbluez-ed31ac59ecb6e4e15c350e44637c05d7ef58c019.tar.gz
bluez-ed31ac59ecb6e4e15c350e44637c05d7ef58c019.tar.xz
bluez-ed31ac59ecb6e4e15c350e44637c05d7ef58c019.zip
hciops: map KeyboardDisplay IO Capability to DisplayYesNo
Since hciops is not used for LE devices, if an agent announces the KeyboardDisplay IO Capability when creating a bonding, map it to DisplayYesNo. This matches the existing change in hciops_set_io_capability which is only used in the RegisterAgent path.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/hciops.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/hciops.c b/plugins/hciops.c
index a62b1606..ef444da0 100644
--- a/plugins/hciops.c
+++ b/plugins/hciops.c
@@ -3738,7 +3738,10 @@ static int hciops_create_bonding(int index, bdaddr_t *bdaddr,
if (conn->io != NULL)
return -EBUSY;
- conn->loc_cap = io_cap;
+ /* hciops is not to be used for SMP pairing for LE devices. So
+ * change the IO capability from KeyboardDisplay to DisplayYesNo
+ * in case it is set. */
+ conn->loc_cap = (io_cap == 0x04 ? 0x01 : io_cap);
/* If our IO capability is NoInputNoOutput use medium security
* level (i.e. don't require MITM protection) else use high