From: Johan Hedberg <johan.hedberg@gmail.com>
To: Sheldon Demario <sheldon.demario@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Emit Connect signal for LE capable devices
Date: Mon, 29 Nov 2010 16:05:26 +0200 [thread overview]
Message-ID: <20101129140525.GA17558@jh-x301> (raw)
In-Reply-To: <4CF3ABD4.6080809@openbossa.org>
Hi Sheldon,
On Mon, Nov 29, 2010, Sheldon Demario wrote:
> On 11/29/2010 07:52 AM, Johan Hedberg wrote:
> >Hi Sheldon,
> >
> >On Thu, Nov 25, 2010, Sheldon Demario wrote:
> >>+ if (le) {
> >>+ evt_le_connection_complete *evt = ptr;
> >>+ evt_bdaddr =&evt->peer_bdaddr;
> >>+ evt_handle = evt->handle;
> >>+ evt_status = evt->status;
> >>+ } else {
> >>+ evt_conn_complete *evt = ptr;
> >>+ evt_bdaddr =&evt->bdaddr;
> >>+ evt_handle = evt->handle;
> >>+ evt_status = evt->status;
> >>+
> >>+ if (evt->link_type != ACL_LINK)
> >>+ return;
> >>+ }
> >Instead of this kind of trickery, I have a feeling that the code would
> >be easier to read if you had a separate function for the LE connect
> >complete. Could try try to come up with a patch that does it like that?
>
> For sure, but don't you think that doing this way there will be a
> lot of duplicated code?
There will be more code, but not a lot (I'm guessing 10 lines or so
more). In the end readability & maintainability wins over that. It's
also possible that we'll need more special casing for the LE events
(e.g. wrt. random addresses) in the future so having it separate will
help there too.
Johan
next prev parent reply other threads:[~2010-11-29 14:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-25 17:22 [PATCH] Emit Connect signal for LE capable devices Sheldon Demario
2010-11-29 12:52 ` Johan Hedberg
2010-11-29 13:34 ` Sheldon Demario
2010-11-29 14:05 ` Johan Hedberg [this message]
2010-11-29 18:36 ` [PATCH v2] " Sheldon Demario
2010-11-29 20:22 ` Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101129140525.GA17558@jh-x301 \
--to=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=sheldon.demario@openbossa.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).