Linux bluetooth development
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Bruna Moreira <bruna.moreira@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 2/5] Add internal buffer to GAttrib struct
Date: Thu, 17 Mar 2011 14:30:31 +0200	[thread overview]
Message-ID: <20110317123031.GA12238@jh-x301> (raw)
In-Reply-To: <1300274712-3931-2-git-send-email-bruna.moreira@openbossa.org>

Hi Bruna,

On Wed, Mar 16, 2011, Bruna Moreira wrote:
> +gboolean g_attrib_set_buffer(GAttrib *attrib, int mtu)
> +{
> +	if (mtu < ATT_DEFAULT_LE_MTU)
> +		mtu = ATT_DEFAULT_LE_MTU;
> +
> +	if (mtu > ATT_MAX_MTU)
> +		mtu = ATT_MAX_MTU;
> +
> +	if (!bt_io_set(attrib->io, BT_IO_L2CAP, NULL,
> +			BT_IO_OPT_OMTU, mtu,
> +			BT_IO_OPT_INVALID))
> +		return FALSE;
> +
> +	attrib->buf = g_realloc(attrib->buf, mtu);
> +
> +	attrib->buflen = mtu;
> +
> +	return TRUE;
> +}

Wouldn't g_attrib_set_mtu make more sense for the name of this function?
Since it's named symmetrically to the _get version one would expect it
to take a buffer as an input parameter, but it's not doing that.

Johan

  reply	other threads:[~2011-03-17 12:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 11:25 [PATCH 1/5] TODO: remove 'fix MTU exchange' task Bruna Moreira
2011-03-16 11:25 ` [PATCH 2/5] Add internal buffer to GAttrib struct Bruna Moreira
2011-03-17 12:30   ` Johan Hedberg [this message]
2011-03-17 12:43     ` Bruna Moreira
2011-03-16 11:25 ` [PATCH 3/5] Use GAttrib buffer for ATT protocol PDUs Bruna Moreira
2011-03-16 11:25 ` [PATCH 4/5] Add Exchange MTU operation in GATT library Bruna Moreira
2011-03-16 11:25 ` [PATCH 5/5] Add Exchange MTU in interactive gatttool Bruna Moreira
2011-03-17 14:55 ` [PATCHv2 1/5] TODO: remove 'fix MTU exchange' task Bruna Moreira
2011-03-18  9:24   ` Johan Hedberg
2011-03-17 14:55 ` [PATCHv2 2/5] Add internal buffer to GAttrib struct Bruna Moreira
2011-03-17 14:55 ` [PATCHv2 3/5] Use GAttrib buffer for ATT protocol PDUs Bruna Moreira
2011-03-17 14:55 ` [PATCHv2 4/5] Add Exchange MTU operation in GATT library Bruna Moreira
2011-03-17 14:55 ` [PATCHv2 5/5] Add Exchange MTU in interactive gatttool Bruna Moreira

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=20110317123031.GA12238@jh-x301 \
    --to=johan.hedberg@gmail.com \
    --cc=bruna.moreira@openbossa.org \
    --cc=linux-bluetooth@vger.kernel.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