Hi, On Monday, 15 May 2017 20:06:02 CEST Christopher Collins wrote: > On Mon, May 15, 2017 at 11:01:38AM -0700, Christopher Collins wrote: > > Hi Łukasz, > > > > On Mon, May 15, 2017 at 12:33:59PM +0100, Łukasz Wolnik wrote: > > > Hello, > > > > > > From time to time my ble_gattc_write_flat (run as central) is timing out > > > after 20 seconds while sending to an Android 6 phone (in peripherial > > > mode). > > > Is there a way to reduce the timeout to just 1 second? At the moment if > > > there's an issue with writing, my newt program has to wait 20 seconds > > > until > > > it can respond to a timeout. > > > > > > What's the best strategy here? Keep "bombarding" the peripherial with > > > multiple writes until receiving first confirmation. Or reduce the > > > timeout > > > from 20 seconds (I don't know where this value is coming from) and > > > resend > > > only when got an HCI 19 timeout error in the callback? > > Oops, I forgot to respond to your actual question :). Sorry about that. > The 30-second timeout is hardcoded in the spec, and is currently not > configurable (Vol. 3, Part F, 3.3.3). It might be useful to make this > configurable, but the device would not be standards compliant.
To be precise we should never retry if ATT request has timed out without disconnecting link. From spec: "A transaction not completed within 30 seconds shall time out. Such a transaction shall be considered to have failed and the local higher layers shall be informed of this failure. No more attribute protocol requests, commands, indications or notifications shall be sent to the target device on this ATT Bearer. Note: To send another attribute protocol PDU, a new ATT Bearer must be established between these devices. The existing ATT Bearer may need to be disconnected or the bearer terminated before the new ATT Bearer is established." -- pozdrawiam Szymon Janc