Return-Path: Date: Fri, 21 Nov 2014 12:08:18 +0200 From: Johan Hedberg To: Arman Uguray , Marcel Holtmann , BlueZ development , Jakub Pawlowski Subject: Re: Handling EBUSY for LE connections. Message-ID: <20141121100818.GA25744@t440s.lan> References: <50181A20-3313-48C7-924B-05C67B975139@holtmann.org> <7ED5AE30-EF53-47EA-A9CE-DD371CE10910@holtmann.org> <20141119212751.GA6364@t440s.P-661HNU-F1> <20141120093403.GA20651@t440s.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20141120093403.GA20651@t440s.lan> List-ID: Hi Arman, On Thu, Nov 20, 2014, Johan Hedberg wrote: > On Wed, Nov 19, 2014, Arman Uguray wrote: > > I now have a few of questions before I start implementing anything: > > > > 1. I'm confused about how the current code handles the case where > > hci_connect_le returns -EBUSY while handling an advertisement report. > > The code simply ignores the error and hci_conn object gets created, so > > the next time an advertisement report gets received and we call > > hci_connect_le, won't that just return early since > > hci_conn_hash_lookup_ba will return something? How will this actually > > ever get to adding the LE Create Connection request? > > Regarding advertising reports while there's a connect attempt in > progress, hci_connect_le() disables advertising before issuing > HCI_LE_Create_Conn so advertising should never be active while we're > trying to connect. Only once the connection times out or we're > successfully connected does advertising get re-enabled and we're ready > again to connect any other device that might be around. Sorry, you must have gotten quite confused by my bs here. I was obviously mixing advertising and scanning. My point still stands though: hci_connect_le also disables scanning for the connection attempt so no advertising reports should be coming while trying to connect. Johan