From 6be25e8bc36656d6fd8ba61c8552f9596043eca6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 9 Jun 2008 16:29:21 +0000 Subject: Detect Simple Pairing support and enable it --- hcid/device.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'hcid/device.c') 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 #include #include +#include #include #include @@ -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); -- cgit