aboutsummaryrefslogtreecommitdiff
path: root/attrib
diff options
context:
space:
mode:
authorBrian Gix <bgix@codeaurora.org>2011-02-16 13:16:24 -0800
committerJohan Hedberg <johan.hedberg@nokia.com>2011-02-16 18:21:45 -0300
commitdba40c880f0eac0ab670e2fd6ad9259dcbc93260 (patch)
tree42f8baad39b3f018b56ac1a16856828bf6dac30d /attrib
parent50102905d99a29d47377103c752f0dbe0ac71d03 (diff)
downloadbluez-dba40c880f0eac0ab670e2fd6ad9259dcbc93260.tar.gz
Fix Min MTU to reflect values for both L2CAP & LE
Diffstat (limited to 'attrib')
-rw-r--r--attrib/gatttool.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/attrib/gatttool.c b/attrib/gatttool.c
index 1e2a8db6..38636f9c 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;
}