From: Johan Hedberg <johan.hedberg@gmail.com>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH BlueZ 2/4] shared/gatt-client: Take fd in bt_gatt_client_new
Date: Wed, 1 Oct 2014 15:34:08 +0300 [thread overview]
Message-ID: <20141001123408.GA26432@t440s.lan> (raw)
In-Reply-To: <1412163494-20283-2-git-send-email-luiz.dentz@gmail.com>
Hi Luiz,
On Wed, Oct 01, 2014, Luiz Augusto von Dentz wrote:
> -struct bt_gatt_client *bt_gatt_client_new(struct bt_att *att, uint16_t mtu)
> +struct bt_gatt_client *bt_gatt_client_new(int fd, uint16_t mtu)
This becomes a bit cumbersome since pretty much any time you have a
connected ATT socket you must be able to be both client and server in
order not to exhibit broken behavior.
With the above change you'd need something like the following since the
fd should really only be processed in one place (bt_att).
client = client_new(fd);
att = client_get_att(client);
server = server_new(att);
Without your change I assume the code has been something like:
att = att_new(fd);
client = client_new(att);
server = server_new(att);
The above is fine except I don't really see the point in having separate
client and server objects to begin with. I might have missed the
reasoning behind it (in which case please enlighten me), but why don't
we hide both roles behind the same object, since they're anyway tied to
the same connection?
I have no objections to having clearly name-spaced functions for client
and server side behavior, and even keeping these in separate c-files,
but having independent objects for them seems a bit pointless. So why
couldn't we have server_foo(att) and client_foo(att) while keeping just
this one "att" context?
Johan
next prev parent reply other threads:[~2014-10-01 12:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-01 11:38 [PATCH BlueZ 1/4] shared/gatt-client: Simplify bt_gatt_client_new Luiz Augusto von Dentz
2014-10-01 11:38 ` [PATCH BlueZ 2/4] shared/gatt-client: Take fd in bt_gatt_client_new Luiz Augusto von Dentz
2014-10-01 12:34 ` Johan Hedberg [this message]
2014-10-01 12:50 ` Luiz Augusto von Dentz
2014-10-01 16:17 ` Arman Uguray
2014-10-02 8:36 ` Luiz Augusto von Dentz
2014-10-02 18:36 ` Arman Uguray
2014-10-01 11:38 ` [PATCH BlueZ 3/4] unit/test-gatt: Add TP/GAC/CL/BV-01-C test Luiz Augusto von Dentz
2014-10-01 11:38 ` [PATCH BlueZ 4/4] shared/gatt-client: Fix crash on bt_gatt_client_unref Luiz Augusto von Dentz
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=20141001123408.GA26432@t440s.lan \
--to=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.