From: Brian Gix <bgix@codeaurora.org>
To: linux-bluetooth@vger.kernel.org
Cc: johan.hedberg@nokia.com, padovan@profusion.mobi,
anderson.lizardo@openbossa.org, Brian Gix <bgix@codeaurora.org>
Subject: [PATCH 1/1] Fix Min MTU to reflect values for both L2CAP & LE
Date: Wed, 16 Feb 2011 13:16:24 -0800 [thread overview]
Message-ID: <1297890984-7809-2-git-send-email-bgix@codeaurora.org> (raw)
In-Reply-To: <1297890984-7809-1-git-send-email-bgix@codeaurora.org>
---
attrib/gatttool.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/attrib/gatttool.c b/attrib/gatttool.c
index 1e2a8db..38636f9 100644
--- a/attrib/gatttool.c
+++ b/attrib/gatttool.c
@@ -44,8 +44,9 @@
#include "gatt.h"
#include "gatttool.h"
-/* Minimum MTU for L2CAP connections over BR/EDR */
-#define ATT_MIN_MTU_L2CAP 48
+/* Minimum MTU for ATT connections */
+#define ATT_MIN_MTU_LE 23
+#define ATT_MIN_MTU_L2CAP 48
static gchar *opt_src = NULL;
static gchar *opt_dst = NULL;
@@ -93,9 +94,9 @@ GIOChannel *do_connect(gchar *dst, gboolean le, BtIOConnect connect_cb)
/* This check is required because currently setsockopt() returns no
* errors for MTU values smaller than the allowed minimum. */
- if (opt_mtu != 0 && opt_mtu < ATT_MIN_MTU_L2CAP) {
+ if (opt_mtu != 0 && opt_mtu < (le ? ATT_MIN_MTU_LE : ATT_MIN_MTU_L2CAP)) {
g_printerr("MTU cannot be smaller than %d\n",
- ATT_MIN_MTU_L2CAP);
+ (le ? ATT_MIN_MTU_LE : ATT_MIN_MTU_L2CAP));
return NULL;
}
--
1.7.1
--
Brian Gix
bgix@codeaurora.org
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
next prev parent reply other threads:[~2011-02-16 21:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-16 21:16 [PATCH 0/1] Fix Minimum gatttool MTU Brian Gix
2011-02-16 21:16 ` Brian Gix [this message]
2011-02-16 21:23 ` [PATCH 1/1] Fix Min MTU to reflect values for both L2CAP & LE Johan Hedberg
2011-02-16 21:36 ` Anderson Lizardo
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=1297890984-7809-2-git-send-email-bgix@codeaurora.org \
--to=bgix@codeaurora.org \
--cc=anderson.lizardo@openbossa.org \
--cc=johan.hedberg@nokia.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=padovan@profusion.mobi \
/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.