diff options
Diffstat (limited to 'hcid/device.c')
-rw-r--r-- | hcid/device.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/hcid/device.c b/hcid/device.c index 95efe3af..57986f88 100644 --- a/hcid/device.c +++ b/hcid/device.c @@ -32,6 +32,7 @@ #include <stdarg.h> #include <sys/time.h> #include <sys/stat.h> +#include <sys/ioctl.h> #include <sys/param.h> #include <sys/socket.h> @@ -325,6 +326,11 @@ int start_adapter(uint16_t dev_id) if (!(features[6] & LMP_SIMPLE_PAIR)) goto setup; + if (hcid_dbus_use_experimental()) { + if (ioctl(dd, HCIGETAUTHINFO, NULL) < 0 && errno != EINVAL) + hci_write_simple_pairing_mode(dd, 0x01, 2000); + } + if (hci_read_simple_pairing_mode(dd, &dev->ssp_mode, 1000) < 0) { err = errno; error("Can't read simple pairing mode on hci%d: %s (%d)", @@ -377,7 +383,7 @@ setup: if (inqmode < 1) goto done; - if (hci_write_inquiry_mode(dd, inqmode, 1000) < 0) { + if (hci_write_inquiry_mode(dd, inqmode, 2000) < 0) { err = errno; error("Can't write inquiry mode for hci%d: %s (%d)", dev_id, strerror(err), err); |