Return-Path: From: Northfield Stuart Content-Type: multipart/signed; boundary="Apple-Mail=_AB957ADE-2E35-4081-A10A-F7368F488FAD"; protocol="application/pkcs7-signature"; micalg=sha1 Subject: Two second pending connection timeout prevents connection to devices with long advertising interval Date: Tue, 30 Aug 2016 13:13:42 +0100 Message-Id: Cc: johan.hedberg@intel.com To: linux-bluetooth@vger.kernel.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Sender: linux-bluetooth-owner@vger.kernel.org List-ID: --Apple-Mail=_AB957ADE-2E35-4081-A10A-F7368F488FAD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 We are currently working with a BLE device which (for power consumption = reasons) uses an unusually large advertisement period of ten seconds = (unusual, but allowed within the BLE specification). We don=E2=80=99t = have the option of reducing the advertising interval for this product. This works with older kernels (e.g. 4.2.6 in RH F23), but on later = kernels it appears that the kernel times out the connection attempt = after only two seconds. I believe I have tracked down the change responsible to a patch from = Johan Hedberg on 2014-07-06, which appears to = split the BLE connection timeout in to two variants, HCI_LE_CONN_TIMEOUT = which remains at 20 seconds, and the newly added one, = HCI_LE_AUTOCONN_TIMEOUT, which has been reduced down to two seconds.=20 I understand, from other threads touching on this subject (see links = below - I am at least not the only person to have hit this problem) that = this 2s timeout is chosen to avoid blocking other connections, and agree = that the average user probably doesn=E2=80=99t need to be able to handle = such slow devices. However, is there any reason why this timeout is = hardcoded in the source rather than a tuneable parameter, which would at = least allow those of us who do need to interact with such devices to be = able to configure the linux bluetooth stack suitably. Personally, I would regard a change which prevents interoperability with = a conformant device as a regression, but I can see why it was done, and = why it isn=E2=80=99t an issue for the vast majority of users and = devices. This is my third attempt to raise this issue on the list - I would = appreciate if someone could please explain what more I need to do to = actually get a response (or even some progress) on this issue? Thread discussing identical issue with slow advertising device (no = apparent solution though): Thread referenced from above which states why the 2s timeout is expected = behaviour: Regards Stu --Apple-Mail=_AB957ADE-2E35-4081-A10A-F7368F488FAD Content-Disposition: attachment; filename=smime.p7s Content-Type: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