summaryrefslogtreecommitdiff
path: root/attrib/gattrib.c
diff options
context:
space:
mode:
authorMichael Janssen <jamuraa@chromium.org>2014-10-31 11:14:52 -0700
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-11-03 17:16:56 +0200
commit566488510e0e8216a26e93c3422a36f560c380e1 (patch)
tree2e986cdd39adc7aad275d5323d4570132b9748b1 /attrib/gattrib.c
parent49f13e083d1458582c983f768fbc9ff0fe2a14b0 (diff)
downloadbluez-566488510e0e8216a26e93c3422a36f560c380e1.tar.gz
attrib: Add mtu argument to g_attrib_new
Instead of using the default MTU, use one passed in by the user, and detect it from the channel when it is created.
Diffstat (limited to 'attrib/gattrib.c')
-rw-r--r--attrib/gattrib.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/attrib/gattrib.c b/attrib/gattrib.c
index ba2f6cca2..a6511a2ab 100644
--- a/attrib/gattrib.c
+++ b/attrib/gattrib.c
@@ -473,10 +473,9 @@ done:
return TRUE;
}
-GAttrib *g_attrib_new(GIOChannel *io)
+GAttrib *g_attrib_new(GIOChannel *io, guint16 mtu)
{
struct _GAttrib *attrib;
- uint16_t att_mtu;
g_io_channel_set_encoding(io, NULL, NULL);
g_io_channel_set_buffered(io, FALSE);
@@ -485,10 +484,8 @@ GAttrib *g_attrib_new(GIOChannel *io)
if (attrib == NULL)
return NULL;
- att_mtu = ATT_DEFAULT_LE_MTU;
-
- attrib->buf = g_malloc0(att_mtu);
- attrib->buflen = att_mtu;
+ attrib->buf = g_malloc0(mtu);
+ attrib->buflen = mtu;
attrib->io = g_io_channel_ref(io);
attrib->requests = g_queue_new();