aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/hciops.c5
-rw-r--r--src/adapter.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/plugins/hciops.c b/plugins/hciops.c
index f1eb1a23..caf0bd8c 100644
--- a/plugins/hciops.c
+++ b/plugins/hciops.c
@@ -3578,7 +3578,10 @@ static int hciops_set_io_capability(int index, uint8_t io_capability)
{
struct dev_info *dev = &devs[index];
- dev->io_capability = io_capability;
+ /* 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. */
+ dev->io_capability = (io_capability == 0x04) ? 0x01 : io_capability;
return 0;
}
diff --git a/src/adapter.c b/src/adapter.c
index 7a41df9a..a75a0c4f 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -74,6 +74,7 @@
#define IO_CAPABILITY_DISPLAYYESNO 0x01
#define IO_CAPABILITY_KEYBOARDONLY 0x02
#define IO_CAPABILITY_NOINPUTNOOUTPUT 0x03
+#define IO_CAPABILITY_KEYBOARDDISPLAY 0x04
#define IO_CAPABILITY_INVALID 0xFF
#define check_address(address) bachk(address)
@@ -1533,6 +1534,8 @@ static uint8_t parse_io_capability(const char *capability)
return IO_CAPABILITY_KEYBOARDONLY;
if (g_str_equal(capability, "NoInputNoOutput"))
return IO_CAPABILITY_NOINPUTNOOUTPUT;
+ if (g_str_equal(capability, "KeyboardDisplay"))
+ return IO_CAPABILITY_KEYBOARDDISPLAY;
return IO_CAPABILITY_INVALID;
}